diff options
author | d34d <clark@cyngn.com> | 2016-02-09 12:27:36 -0800 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyngn.com> | 2016-02-11 21:09:25 +0000 |
commit | b4d4e5bde554267c1fc88ee8d1996ff8cc2098b9 (patch) | |
tree | 82b39252e19dff421ed8b4563927d6aa68ecb461 /src | |
parent | 94ee92a4532da3727a1604500b2f57d91329a74b (diff) | |
download | packages_apps_ThemeChooser-b4d4e5bde554267c1fc88ee8d1996ff8cc2098b9.zip packages_apps_ThemeChooser-b4d4e5bde554267c1fc88ee8d1996ff8cc2098b9.tar.gz packages_apps_ThemeChooser-b4d4e5bde554267c1fc88ee8d1996ff8cc2098b9.tar.bz2 |
Return SYSTEM_DEFAULT for applied theme when config is null
If ThemeConfig is null we can assume that no theme is applied and
therefore the System theme should be considered the currently
applied theme. The ThemeConfig would be non null on first run of
the theme chooser if the device's default theme, which is not System,
is applied via OOBE.
Change-Id: I3d913b1c9f2fee4b1b954fb4148441256be08eec
TICKET: CYNGNOS-1947
Diffstat (limited to 'src')
-rw-r--r-- | src/com/cyngn/theme/util/PreferenceUtils.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/com/cyngn/theme/util/PreferenceUtils.java b/src/com/cyngn/theme/util/PreferenceUtils.java index c8d26bb..6444c41 100644 --- a/src/com/cyngn/theme/util/PreferenceUtils.java +++ b/src/com/cyngn/theme/util/PreferenceUtils.java @@ -34,10 +34,10 @@ public class PreferenceUtils { final Resources res = context.getResources(); final ThemeConfig config = res.getConfiguration().themeConfig; - String appliedTheme = config != null ? config.getOverlayPkgName() : null; - return prefs.getString(PREF_APPLIED_BASE_THEME, - (!TextUtils.isEmpty(appliedTheme)) ? appliedTheme : - Utils.getDefaultThemePackageName(context)); + String appliedTheme = config != null + ? config.getOverlayPkgName() + : ThemeConfig.SYSTEM_DEFAULT; + return prefs.getString(PREF_APPLIED_BASE_THEME, appliedTheme); } public static void setAppliedBaseTheme(Context context, String pkgName) { |