Merge "Reorganize intents to have the same order" into qt-dev
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 34d1742..4944e33 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -76,64 +76,19 @@
android:launchMode="singleTask"
android:windowSoftInputMode="adjustPan"
android:exported="true">
- <!-- Set priority high enough to trump the phone setting app -->
+ <!-- Keep the order of intents same as .common.FragmentResolver -->
<intent-filter android:priority="1">
<action android:name="android.settings.SETTINGS" />
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
- <!-- Handles wifi related intent -->
- <intent-filter android:priority="1">
- <action android:name="android.settings.WIFI_SETTINGS" />
- <action android:name="android.settings.WIRELESS_SETTINGS" />
- <category android:name="android.intent.category.DEFAULT" />
- </intent-filter>
-
- <intent-filter android:priority="100">
- <action android:name="android.net.wifi.PICK_WIFI_NETWORK" />
- <category android:name="android.intent.category.DEFAULT" />
- </intent-filter>
-
<intent-filter android:priority="1">
<action android:name="android.settings.NIGHT_DISPLAY_SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter android:priority="1">
- <action android:name="android.settings.USER_SETTINGS" />
- <category android:name="android.intent.category.DEFAULT" />
- </intent-filter>
-
- <intent-filter android:priority="1">
- <action android:name="android.settings.BLUETOOTH_SETTINGS" />
- <category android:name="android.intent.category.DEFAULT" />
- </intent-filter>
-
- <intent-filter android:priority="100">
- <action android:name="android.settings.DEVICE_INFO_SETTINGS" />
- <action android:name="android.settings.DEVICE_NAME" />
- <category android:name="android.intent.category.DEFAULT" />
- </intent-filter>
-
- <intent-filter android:priority="100">
- <action android:name="android.settings.LOCALE_SETTINGS" />
- <category android:name="android.intent.category.DEFAULT"/>
- </intent-filter>
-
- <intent-filter android:priority="100">
- <action android:name="android.settings.INPUT_METHOD_SETTINGS" />
- <category android:name="android.intent.category.DEFAULT"/>
- </intent-filter>
-
- <intent-filter android:priority="1">
- <action android:name="android.settings.APPLICATION_DETAILS_SETTINGS" />
- <data android:scheme="package" />
- <category android:name="android.intent.category.DEFAULT" />
- </intent-filter>
-
- <intent-filter android:priority="1">
- <action android:name="android.settings.DATE_SETTINGS" />
- <action android:name="android.intent.action.QUICK_CLOCK" />
+ <action android:name="android.settings.DISPLAY_SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
@@ -142,16 +97,27 @@
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
- <intent-filter android:priority="1">
- <action android:name="android.settings.DISPLAY_SETTINGS" />
- <action android:name="android.settings.NIGHT_DISPLAY_SETTINGS" />
+ <intent-filter android:priority="100">
+ <action android:name="android.net.wifi.PICK_WIFI_NETWORK" />
+ <action android:name="android.settings.WIFI_SETTINGS" />
+ <action android:name="android.settings.WIRELESS_SETTINGS" />
+ <category android:name="android.intent.category.DEFAULT" />
+ </intent-filter>
+
+ <intent-filter android:priority="100">
+ <action android:name="android.settings.DATA_USAGE_SETTINGS" />
+ <action android:name="android.settings.MOBILE_DATA_USAGE" />
+ <category android:name="android.intent.category.DEFAULT" />
+ </intent-filter>
+
+ <intent-filter android:priority="100">
+ <action android:name="android.settings.DATA_ROAMING_SETTINGS" />
+ <action android:name="android.settings.NETWORK_OPERATOR_SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter android:priority="1">
- <action android:name="android.settings.APPLICATION_SETTINGS" />
- <action android:name="android.settings.MANAGE_APPLICATIONS_SETTINGS" />
- <action android:name="android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS" />
+ <action android:name="android.settings.BLUETOOTH_SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
@@ -165,18 +131,18 @@
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
- <intent-filter android:priority="100">
- <action android:name="android.settings.SYNC_SETTINGS" />
+ <intent-filter android:priority="1">
+ <action android:name="android.settings.APPLICATION_SETTINGS" />
+ <action android:name="android.settings.MANAGE_APPLICATIONS_SETTINGS" />
+ <action android:name="android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter android:priority="100">
- <action android:name="android.settings.ADD_ACCOUNT_SETTINGS" />
- <category android:name="android.intent.category.DEFAULT" />
- </intent-filter>
-
- <intent-filter android:priority="100">
- <action android:name="android.settings.INTERNAL_STORAGE_SETTINGS" />
+ <action android:name="android.settings.APPLICATION_DETAILS_SETTINGS" />
+ <action android:name="android.settings.CHANNEL_NOTIFICATION_SETTINGS" />
+ <action android:name="android.settings.APP_NOTIFICATION_SETTINGS" />
+ <data android:scheme="package" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
@@ -191,11 +157,41 @@
</intent-filter>
<intent-filter android:priority="100">
- <action android:name="android.settings.DATA_USAGE_SETTINGS" />
- <action android:name="android.settings.MOBILE_DATA_USAGE" />
+ <action android:name="android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
+ <intent-filter android:priority="1">
+ <action android:name="android.settings.DATE_SETTINGS" />
+ <action android:name="android.intent.action.QUICK_CLOCK" />
+ <category android:name="android.intent.category.DEFAULT" />
+ </intent-filter>
+
+ <intent-filter android:priority="1">
+ <action android:name="android.settings.USER_SETTINGS" />
+ <category android:name="android.intent.category.DEFAULT" />
+ </intent-filter>
+
+ <intent-filter android:priority="100">
+ <action android:name="android.settings.ADD_ACCOUNT_SETTINGS" />
+ <category android:name="android.intent.category.DEFAULT" />
+ </intent-filter>
+
+ <intent-filter android:priority="100">
+ <action android:name="android.settings.SYNC_SETTINGS" />
+ <category android:name="android.intent.category.DEFAULT" />
+ </intent-filter>
+
+ <intent-filter android:priority="100">
+ <action android:name="android.settings.INTERNAL_STORAGE_SETTINGS" />
+ <category android:name="android.intent.category.DEFAULT" />
+ </intent-filter>
+
+ <intent-filter android:priority="100">
+ <action android:name="android.settings.LOCALE_SETTINGS" />
+ <category android:name="android.intent.category.DEFAULT"/>
+ </intent-filter>
+
<intent-filter android:priority="100">
<action android:name="android.settings.REQUEST_SET_AUTOFILL_SERVICE" />
<category android:name="android.intent.category.DEFAULT" />
@@ -203,22 +199,16 @@
</intent-filter>
<intent-filter android:priority="100">
- <action android:name="android.settings.DATA_ROAMING_SETTINGS" />
- <action android:name="android.settings.NETWORK_OPERATOR_SETTINGS" />
- <category android:name="android.intent.category.DEFAULT" />
+ <action android:name="android.settings.INPUT_METHOD_SETTINGS" />
+ <category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
<intent-filter android:priority="100">
- <action android:name="android.settings.CHANNEL_NOTIFICATION_SETTINGS" />
- <action android:name="android.settings.APP_NOTIFICATION_SETTINGS" />
+ <action android:name="android.settings.DEVICE_INFO_SETTINGS" />
+ <action android:name="android.settings.DEVICE_NAME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
-
- <intent-filter android:priority="100">
- <action android:name="android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS" />
- <category android:name="android.intent.category.DEFAULT" />
- </intent-filter>
-
+
<meta-data android:name="distractionOptimized" android:value="true"/>
</activity>
diff --git a/src/com/android/car/settings/common/FragmentResolver.java b/src/com/android/car/settings/common/FragmentResolver.java
index 43d9b78..8e0d467 100644
--- a/src/com/android/car/settings/common/FragmentResolver.java
+++ b/src/com/android/car/settings/common/FragmentResolver.java
@@ -63,7 +63,8 @@
/**
* Returns a {@link Fragment} that can handle the given action, returns {@code null} if no
- * {@link Fragment} that can handle this {@link Intent} can be found.
+ * {@link Fragment} that can handle this {@link Intent} can be found. Keep the order of intent
+ * actions same as in the manifest.
*/
@Nullable
static Fragment getFragmentForIntent(Context context, @Nullable Intent intent) {
@@ -78,58 +79,36 @@
case Settings.ACTION_SETTINGS:
return new HomepageFragment();
- case Settings.ACTION_INTERNAL_STORAGE_SETTINGS:
- return new StorageSettingsFragment();
+ case Settings.ACTION_NIGHT_DISPLAY_SETTINGS:
+ return new QuickSettingFragment();
- case Settings.ACTION_VOICE_INPUT_SETTINGS:
- return new ManageAssistFragment();
+ case Settings.ACTION_DISPLAY_SETTINGS:
+ return new DisplaySettingsFragment();
- case Settings.ACTION_DATA_USAGE_SETTINGS:
- case Settings.ACTION_MOBILE_DATA_USAGE:
- return new DataUsageFragment();
-
- case Settings.ACTION_REQUEST_SET_AUTOFILL_SERVICE:
- return new DefaultAutofillPickerFragment();
-
- case Settings.ACTION_DATA_ROAMING_SETTINGS:
- case Settings.ACTION_NETWORK_OPERATOR_SETTINGS:
- return new MobileNetworkFragment();
-
- case Settings.ACTION_LOCATION_SOURCE_SETTINGS:
- return new LocationSettingsFragment();
-
- case Settings.ACTION_LOCATION_SCANNING_SETTINGS:
- return new LocationScanningFragment();
+ case Settings.ACTION_SOUND_SETTINGS:
+ return new SoundSettingsFragment();
case android.net.wifi.WifiManager.ACTION_PICK_WIFI_NETWORK:
case Settings.ACTION_WIFI_SETTINGS:
case Settings.ACTION_WIRELESS_SETTINGS:
return new WifiSettingsFragment();
- case Settings.ACTION_NIGHT_DISPLAY_SETTINGS:
- return new QuickSettingFragment();
+ case Settings.ACTION_DATA_USAGE_SETTINGS:
+ case Settings.ACTION_MOBILE_DATA_USAGE:
+ return new DataUsageFragment();
- case Settings.ACTION_USER_SETTINGS:
- return new UsersListFragment();
+ case Settings.ACTION_DATA_ROAMING_SETTINGS:
+ case Settings.ACTION_NETWORK_OPERATOR_SETTINGS:
+ return new MobileNetworkFragment();
case Settings.ACTION_BLUETOOTH_SETTINGS:
return new BluetoothSettingsFragment();
- case Intent.ACTION_QUICK_CLOCK:
- case Settings.ACTION_DATE_SETTINGS:
- return new DatetimeSettingsFragment();
+ case Settings.ACTION_LOCATION_SOURCE_SETTINGS:
+ return new LocationSettingsFragment();
- case Settings.ACTION_SOUND_SETTINGS:
- return new SoundSettingsFragment();
-
- case Settings.ACTION_DISPLAY_SETTINGS:
- return new DisplaySettingsFragment();
-
- case Settings.ACTION_LOCALE_SETTINGS:
- return new LanguagePickerFragment();
-
- case Settings.ACTION_INPUT_METHOD_SETTINGS:
- return new KeyboardFragment();
+ case Settings.ACTION_LOCATION_SCANNING_SETTINGS:
+ return new LocationScanningFragment();
case Settings.ACTION_APPLICATION_SETTINGS:
case Settings.ACTION_MANAGE_APPLICATIONS_SETTINGS:
@@ -151,18 +130,40 @@
}
return ApplicationDetailsFragment.getInstance(pkg);
- case Settings.ACTION_NOTIFICATION_LISTENER_SETTINGS:
- return new NotificationAccessFragment();
+ case Settings.ACTION_VOICE_INPUT_SETTINGS:
+ return new ManageAssistFragment();
case Settings.ACTION_MANAGE_DOMAIN_URLS:
return new ManageDomainUrlsFragment();
- case Settings.ACTION_SYNC_SETTINGS:
- return new AccountSettingsFragment();
+ case Settings.ACTION_NOTIFICATION_LISTENER_SETTINGS:
+ return new NotificationAccessFragment();
+
+ case Intent.ACTION_QUICK_CLOCK:
+ case Settings.ACTION_DATE_SETTINGS:
+ return new DatetimeSettingsFragment();
+
+ case Settings.ACTION_USER_SETTINGS:
+ return new UsersListFragment();
case Settings.ACTION_ADD_ACCOUNT:
return new ChooseAccountFragment();
+ case Settings.ACTION_SYNC_SETTINGS:
+ return new AccountSettingsFragment();
+
+ case Settings.ACTION_INTERNAL_STORAGE_SETTINGS:
+ return new StorageSettingsFragment();
+
+ case Settings.ACTION_LOCALE_SETTINGS:
+ return new LanguagePickerFragment();
+
+ case Settings.ACTION_REQUEST_SET_AUTOFILL_SERVICE:
+ return new DefaultAutofillPickerFragment();
+
+ case Settings.ACTION_INPUT_METHOD_SETTINGS:
+ return new KeyboardFragment();
+
case Settings.ACTION_DEVICE_INFO_SETTINGS:
case Settings.DEVICE_NAME_SETTINGS:
return new AboutSettingsFragment();