summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/SettingsActivity.java
diff options
context:
space:
mode:
authorJan Tomljanovic <jtomljanovic@google.com>2021-04-27 20:58:12 +0100
committerJan Tomljanovic <jtomljanovic@google.com>2021-04-29 17:38:52 +0100
commit07bffff45407aabbd670742c7240eec830b08b10 (patch)
treef65001327a31778d708e1b7d9d1f42f361f5076d /src/com/android/settings/SettingsActivity.java
parent6be940f396e22abc5f93c4652e9eee17c8f28803 (diff)
downloadpackages_apps_Settings-07bffff45407aabbd670742c7240eec830b08b10.tar.gz
packages_apps_Settings-07bffff45407aabbd670742c7240eec830b08b10.tar.bz2
packages_apps_Settings-07bffff45407aabbd670742c7240eec830b08b10.zip
Launch SecurityHub fragment on SECURITY_SETTINGS intent when available.
Test: atest SettingsUnitTests Test: adb shell am start -a android.settings.SECURITY_SETTINGS opens SecurityHub screen (when SecurityHub enabled) Test: assistant opens SecurityHub screen (when SecurityHub enabled) when given instrucion to "open security settings" Bug: 183930061 Change-Id: Ie8fcb2f2dce4cd0a2a84c6cd21a0a1c0b2b3665e
Diffstat (limited to 'src/com/android/settings/SettingsActivity.java')
-rw-r--r--src/com/android/settings/SettingsActivity.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java
index b6729179d1..923c2bd719 100644
--- a/src/com/android/settings/SettingsActivity.java
+++ b/src/com/android/settings/SettingsActivity.java
@@ -219,7 +219,7 @@ public class SettingsActivity extends SettingsBaseActivity
private String getMetricsTag() {
String tag = null;
if (getIntent() != null && getIntent().hasExtra(EXTRA_SHOW_FRAGMENT)) {
- tag = getIntent().getStringExtra(EXTRA_SHOW_FRAGMENT);
+ tag = getInitialFragmentName(getIntent());
}
if (TextUtils.isEmpty(tag)) {
Log.w(LOG_TAG, "MetricsTag is invalid " + tag);
@@ -262,7 +262,7 @@ public class SettingsActivity extends SettingsBaseActivity
}
// Getting Intent properties can only be done after the super.onCreate(...)
- final String initialFragmentName = intent.getStringExtra(EXTRA_SHOW_FRAGMENT);
+ final String initialFragmentName = getInitialFragmentName(intent);
// This is a "Sub Settings" when:
// - this is a real SubSettings
@@ -363,6 +363,12 @@ public class SettingsActivity extends SettingsBaseActivity
}
}
+ /** Returns the initial fragment name that the activity will launch. */
+ @VisibleForTesting
+ public String getInitialFragmentName(Intent intent) {
+ return intent.getStringExtra(EXTRA_SHOW_FRAGMENT);
+ }
+
@Override
protected void onApplyThemeResource(Theme theme, int resid, boolean first) {
theme.applyStyle(R.style.SetupWizardPartnerResource, true);