From 06aa3eb165a5fd24472adb80c89add8632fa6b31 Mon Sep 17 00:00:00 2001 From: d34d Date: Mon, 25 Jan 2016 11:19:15 -0800 Subject: Themes: Re-enable applying theme in OOBE Change-Id: I0b027bff18c3b33fc0a925ee756766ed31740b35 TICKET: OPO-361 --- .../setupwizard/setup/CyanogenSettingsPage.java | 25 +++++++++++----------- 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'src/com/cyanogenmod/setupwizard/setup') diff --git a/src/com/cyanogenmod/setupwizard/setup/CyanogenSettingsPage.java b/src/com/cyanogenmod/setupwizard/setup/CyanogenSettingsPage.java index 6184055..de0b284 100644 --- a/src/com/cyanogenmod/setupwizard/setup/CyanogenSettingsPage.java +++ b/src/com/cyanogenmod/setupwizard/setup/CyanogenSettingsPage.java @@ -24,14 +24,13 @@ import android.content.Intent; import android.content.SharedPreferences; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; -/*import android.content.pm.ThemeUtils; +import android.content.pm.ThemeUtils; import android.content.res.ThemeConfig; -import android.content.res.ThemeManager;*/ +import android.content.res.ThemeManager; import android.net.Uri; import android.os.Bundle; import android.os.RemoteException; import android.preference.PreferenceManager; -import android.provider.Settings; import android.text.Spannable; import android.text.SpannableString; import android.text.SpannableStringBuilder; @@ -178,9 +177,10 @@ public class CyanogenSettingsPage extends SetupPage { } private void handleDefaultThemeSetup() { - /*Bundle privacyData = getData(); - if (!ThemeUtils.getDefaultThemePackageName(mContext).equals(ThemeConfig.SYSTEM_DEFAULT) && - privacyData != null && privacyData.getBoolean(KEY_APPLY_DEFAULT_THEME)) { + Bundle privacyData = getData(); + if (!SetupWizardUtils.getDefaultThemePackageName(mContext).equals( + ThemeConfig.SYSTEM_DEFAULT) && privacyData != null && + privacyData.getBoolean(KEY_APPLY_DEFAULT_THEME)) { SetupStats.addEvent(SetupStats.Categories.SETTING_CHANGED, SetupStats.Action.APPLY_CUSTOM_THEME, SetupStats.Label.CHECKED, @@ -189,9 +189,9 @@ public class CyanogenSettingsPage extends SetupPage { final ThemeManager tm = (ThemeManager) mContext.getSystemService(Context.THEME_SERVICE); tm.applyDefaultTheme(); - } else { */ + } else { getCallbacks().finishSetup(); - //} + } } private static boolean hideKeyDisabler(Context ctx) { @@ -221,9 +221,10 @@ public class CyanogenSettingsPage extends SetupPage { SetupWizardUtils.isSimMissing(context)); } - /*private static boolean hideThemeSwitch(Context context) { - return ThemeUtils.getDefaultThemePackageName(context).equals(ThemeConfig.SYSTEM_DEFAULT); - }*/ + private static boolean hideThemeSwitch(Context context) { + return SetupWizardUtils.getDefaultThemePackageName(context) + .equals(ThemeConfig.SYSTEM_DEFAULT); + } public static class CyanogenSettingsFragment extends SetupPageFragment { @@ -333,7 +334,7 @@ public class CyanogenSettingsPage extends SetupPage { mMetrics = (CheckBox) mRootView.findViewById(R.id.enable_metrics_checkbox); mDefaultThemeRow = mRootView.findViewById(R.id.theme); - mHideThemeRow = true; // hideThemeSwitch(getActivity()); + mHideThemeRow = hideThemeSwitch(getActivity()); if (mHideThemeRow) { mDefaultThemeRow.setVisibility(View.GONE); } else { -- cgit v1.1