summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Alastair Breeze <abreeze@google.com> 2021-09-23 14:42:29 +0100
committer Alastair Breeze <abreeze@google.com> 2021-09-28 10:19:58 +0000
commitf1ba6081ebfde37bc9f2cc433ab7036b602ca709 (patch)
tree93b58c880de856421518392856ef9fe4499ee7d3
parentb85da640d13ced31165c543e686bb47027bff54f (diff)
Launch injected location settings on same task
Removes activity launch flags that cause the injected location settings to launch in a new task. This improves animations and settings support for different form factors. Fixes: 197608838 Fixes: 197608555 Test: manual Change-Id: If2deb44058f7d7786a27310d4430f2e83879baa9
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/location/SettingsInjector.java16
1 files changed, 2 insertions, 14 deletions
diff --git a/packages/SettingsLib/src/com/android/settingslib/location/SettingsInjector.java b/packages/SettingsLib/src/com/android/settingslib/location/SettingsInjector.java
index a0c8663a8271..ea5105bd9e0d 100644
--- a/packages/SettingsLib/src/com/android/settingslib/location/SettingsInjector.java
+++ b/packages/SettingsLib/src/com/android/settingslib/location/SettingsInjector.java
@@ -319,23 +319,11 @@ public class SettingsInjector {
@Override
public boolean onPreferenceClick(Preference preference) {
- // Activity to start if they click on the preference. Must start in new task to ensure
- // that "android.settings.LOCATION_SOURCE_SETTINGS" brings user back to
- // Settings > Location.
+ // Activity to start if they click on the preference.
Intent settingIntent = new Intent();
settingIntent.setClassName(mInfo.packageName, mInfo.settingsActivity);
+ // No flags set to ensure the activity is launched within the same settings task.
logPreferenceClick(settingIntent);
- // Sometimes the user may navigate back to "Settings" and launch another different
- // injected setting after one injected setting has been launched.
- //
- // FLAG_ACTIVITY_CLEAR_TOP allows multiple Activities to stack on each other. When
- // "back" button is clicked, the user will navigate through all the injected settings
- // launched before. Such behavior could be quite confusing sometimes.
- //
- // In order to avoid such confusion, we use FLAG_ACTIVITY_CLEAR_TASK, which always clear
- // up all existing injected settings and make sure that "back" button always brings the
- // user back to "Settings" directly.
- settingIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
mContext.startActivityAsUser(settingIntent, mInfo.mUserHandle);
return true;
}