summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/SettingsActivity.java
diff options
context:
space:
mode:
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);