summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/SettingsActivity.java
diff options
context:
space:
mode:
authorFabrice Di Meglio <fdimeglio@google.com>2014-08-13 16:22:38 -0700
committerFabrice Di Meglio <fdimeglio@google.com>2014-08-15 11:36:31 -0700
commit61a1fec49fbfbe8bdd0137ddb06e5eacf4f8ec54 (patch)
treefe8378adba969bd44b0a1315037b6dd306b00a02 /src/com/android/settings/SettingsActivity.java
parent898671f14123695d74bd308450a462d11a341d1a (diff)
downloadpackages_apps_Settings-61a1fec49fbfbe8bdd0137ddb06e5eacf4f8ec54.zip
packages_apps_Settings-61a1fec49fbfbe8bdd0137ddb06e5eacf4f8ec54.tar.gz
packages_apps_Settings-61a1fec49fbfbe8bdd0137ddb06e5eacf4f8ec54.tar.bz2
Fix bug #16703191 APN settings shows back button even when you intent into it
- change a bit the way we recognize a SubSetting. Now we can pass the new ":settings:show_fragment_as_subsetting" Intent extra for forcing it. - convert ApnSettings to a SettingsPreferenceFragment Change-Id: I22167ad317530c0a58c4d522a72826f9d34ad2d3
Diffstat (limited to 'src/com/android/settings/SettingsActivity.java')
-rw-r--r--src/com/android/settings/SettingsActivity.java28
1 files changed, 20 insertions, 8 deletions
diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java
index bf0d9a1..9f1600b 100644
--- a/src/com/android/settings/SettingsActivity.java
+++ b/src/com/android/settings/SettingsActivity.java
@@ -184,8 +184,13 @@ public class SettingsActivity extends Activity
* that fragment.
*/
public static final String EXTRA_SHOW_FRAGMENT_TITLE = ":settings:show_fragment_title";
- public static final String EXTRA_SHOW_FRAGMENT_TITLE_RESID = ":settings:show_fragment_title_resid";
- public static final String EXTRA_SHOW_FRAGMENT_AS_SHORTCUT = ":settings:show_fragment_as_shortcut";
+ public static final String EXTRA_SHOW_FRAGMENT_TITLE_RESID =
+ ":settings:show_fragment_title_resid";
+ public static final String EXTRA_SHOW_FRAGMENT_AS_SHORTCUT =
+ ":settings:show_fragment_as_shortcut";
+
+ public static final String EXTRA_SHOW_FRAGMENT_AS_SUBSETTING =
+ ":settings:show_fragment_as_subsetting";
private static final String META_DATA_KEY_FRAGMENT_CLASS =
"com.android.settings.FRAGMENT_CLASS";
@@ -290,7 +295,8 @@ public class SettingsActivity extends Activity
NotificationAppList.class.getName(),
AppNotificationSettings.class.getName(),
OtherSoundSettings.class.getName(),
- QuickLaunchSettings.class.getName()
+ QuickLaunchSettings.class.getName(),
+ ApnSettings.class.getName()
};
@@ -495,12 +501,15 @@ public class SettingsActivity extends Activity
final String className = cn.getClassName();
mIsShowingDashboard = className.equals(Settings.class.getName());
- final boolean isSubSettings = className.equals(SubSettings.class.getName());
- // If this is a sub settings or not the main Dashboard and not a Shortcut and an initial
- // Fragment then apply the SubSettings theme for the ActionBar content insets
- if (isSubSettings ||
- (!mIsShowingDashboard && !mIsShortcut && (initialFragmentName != null))) {
+ // This is a "Sub Settings" when:
+ // - this is a real SubSettings
+ // - or :settings:show_fragment_as_subsetting is passed to the Intent
+ final boolean isSubSettings = className.equals(SubSettings.class.getName()) ||
+ intent.getBooleanExtra(EXTRA_SHOW_FRAGMENT_AS_SUBSETTING, false);
+
+ // If this is a sub settings, then apply the SubSettings Theme for the ActionBar content insets
+ if (isSubSettings) {
// Check also that we are not a Theme Dialog as we don't want to override them
final int themeResId = getThemeResId();
if (themeResId != R.style.Theme_DialogWhenLarge &&
@@ -550,6 +559,9 @@ public class SettingsActivity extends Activity
} else if (isSubSettings) {
mDisplayHomeAsUpEnabled = true;
mDisplaySearch = true;
+ } else {
+ mDisplayHomeAsUpEnabled = false;
+ mDisplaySearch = false;
}
setTitleFromIntent(intent);