From b4d4e5bde554267c1fc88ee8d1996ff8cc2098b9 Mon Sep 17 00:00:00 2001 From: d34d Date: Tue, 9 Feb 2016 12:27:36 -0800 Subject: 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 --- src/com/cyngn/theme/util/PreferenceUtils.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') 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) { -- cgit v1.1