DO NOT MERGE Reorganize intents to have the same order
Before AndroidManifest.xml and FragmentResolver.java placed the intents
in random order. This CL organizes them roughly in the order they
currently appear in AOSP Car Settings.
Bug: 114008723
Test: Build
Change-Id: I48af6bd6886b692760811c5d9b5b826b54bdb181
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index b797d9e..92e94f9 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -74,64 +74,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>
@@ -140,16 +95,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>
@@ -163,13 +129,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" />
+ <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>
@@ -179,21 +150,46 @@
</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.VOICE_INPUT_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" />
+ <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" />
@@ -201,19 +197,13 @@
</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" />
- <category android:name="android.intent.category.DEFAULT" />
- </intent-filter>
-
- <intent-filter android:priority="100">
- <action android:name="android.settings.ACTION_NOTIFICATION_LISTENER_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>
diff --git a/src/com/android/car/settings/common/FragmentResolver.java b/src/com/android/car/settings/common/FragmentResolver.java
index c756034..2dab0c2 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,61 +79,36 @@
case Settings.ACTION_SETTINGS:
return new HomepageFragment();
- case Settings.ACTION_MANAGE_DEFAULT_APPS_SETTINGS:
- return new DefaultApplicationsSettingsFragment();
+ case Settings.ACTION_NIGHT_DISPLAY_SETTINGS:
+ return new QuickSettingFragment();
- case Settings.ACTION_INTERNAL_STORAGE_SETTINGS:
- return new StorageSettingsFragment();
+ case Settings.ACTION_DISPLAY_SETTINGS:
+ return new DisplaySettingsFragment();
- case Settings.ACTION_VOICE_INPUT_SETTINGS:
- return new ManageAssistFragment();
-
- 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:
@@ -154,14 +130,39 @@
}
return ApplicationDetailsFragment.getInstance(pkg);
+ case Settings.ACTION_MANAGE_DEFAULT_APPS_SETTINGS:
+ return new DefaultApplicationsSettingsFragment();
+
+ case Settings.ACTION_VOICE_INPUT_SETTINGS:
+ return new ManageAssistFragment();
+
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_ADD_ACCOUNT:
- return new ChooseAccountFragment();
+ 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: