Merge changes from topic "reorganize_intent" into pi-car-dev
* changes:
Add a couple more intents that were missed
DO NOT MERGE Reorganize intents to have the same order
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index a893e0b..f4d2a8e 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -75,64 +75,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>
@@ -141,16 +96,32 @@
<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.WIFI_IP_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>
@@ -164,13 +135,19 @@
<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.NOTIFICATION_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>
@@ -180,21 +157,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" />
@@ -202,19 +204,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..0bd14c6 100644
--- a/src/com/android/car/settings/common/FragmentResolver.java
+++ b/src/com/android/car/settings/common/FragmentResolver.java
@@ -49,6 +49,7 @@
import com.android.car.settings.system.AboutSettingsFragment;
import com.android.car.settings.users.UsersListFragment;
import com.android.car.settings.wifi.WifiSettingsFragment;
+import com.android.car.settings.wifi.preferences.WifiPreferencesFragment;
/**
@@ -63,7 +64,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,68 +80,47 @@
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_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_WIFI_IP_SETTINGS:
+ return new WifiPreferencesFragment();
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_BLUETOOTH_SETTINGS:
+ return new BluetoothSettingsFragment();
+
case Settings.ACTION_LOCATION_SOURCE_SETTINGS:
return new LocationSettingsFragment();
case Settings.ACTION_LOCATION_SCANNING_SETTINGS:
return new LocationScanningFragment();
- 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_USER_SETTINGS:
- return new UsersListFragment();
-
- case Settings.ACTION_BLUETOOTH_SETTINGS:
- return new BluetoothSettingsFragment();
-
- case Intent.ACTION_QUICK_CLOCK:
- case Settings.ACTION_DATE_SETTINGS:
- return new DatetimeSettingsFragment();
-
- 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_APPLICATION_SETTINGS:
case Settings.ACTION_MANAGE_APPLICATIONS_SETTINGS:
case Settings.ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS:
return new ApplicationsSettingsFragment();
case Settings.ACTION_APPLICATION_DETAILS_SETTINGS:
+ case Settings.ACTION_NOTIFICATION_SETTINGS:
case Settings.ACTION_CHANNEL_NOTIFICATION_SETTINGS:
case Settings.ACTION_APP_NOTIFICATION_SETTINGS:
String pkg = intent.getStringExtra(Settings.EXTRA_APP_PACKAGE);
@@ -154,14 +135,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: