diff options
author | d34d <clark@cyngn.com> | 2015-03-03 10:25:52 -0800 |
---|---|---|
committer | Clark Scheff <clark@cyngn.com> | 2015-10-27 10:41:05 -0700 |
commit | a17db2b5c7fb407fa40de99f8f89bb8fda1584fd (patch) | |
tree | 3e8f9aac00978af2e40855acf9790d8fd6970717 /services/java | |
parent | 88331c1b4a1fe075ca4d73e5fe1ee7f4e1239d32 (diff) | |
download | frameworks_base-a17db2b5c7fb407fa40de99f8f89bb8fda1584fd.zip frameworks_base-a17db2b5c7fb407fa40de99f8f89bb8fda1584fd.tar.gz frameworks_base-a17db2b5c7fb407fa40de99f8f89bb8fda1584fd.tar.bz2 |
Themes: Use ThemeChangeRequest when resetting theme
The AppsFailureReceiver was still using the old methods for applying
a theme. This patch migrates it over to using the ThemeChangeRequest.
Change-Id: If8fac97ed6783b6ee66f632a31ed821839808b47
Diffstat (limited to 'services/java')
-rw-r--r-- | services/java/com/android/server/AppsFailureReceiver.java | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/services/java/com/android/server/AppsFailureReceiver.java b/services/java/com/android/server/AppsFailureReceiver.java index bebef9b..3265720 100644 --- a/services/java/com/android/server/AppsFailureReceiver.java +++ b/services/java/com/android/server/AppsFailureReceiver.java @@ -22,6 +22,7 @@ import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.pm.ThemeUtils; +import android.content.res.ThemeChangeRequest; import android.content.res.ThemeConfig; import android.content.res.ThemeManager; import android.os.SystemClock; @@ -64,19 +65,22 @@ public class AppsFailureReceiver extends BroadcastReceiver { // let the theme manager take care of getting us back on the default theme ThemeManager tm = (ThemeManager) context.getSystemService(Context.THEME_SERVICE); - List<String> components = new ArrayList<String>(); - components.add(ThemesContract.ThemesColumns.MODIFIES_FONTS); - components.add(ThemesContract.ThemesColumns.MODIFIES_LAUNCHER); - components.add(ThemesContract.ThemesColumns.MODIFIES_ALARMS); - components.add(ThemesContract.ThemesColumns.MODIFIES_BOOT_ANIM); - components.add(ThemesContract.ThemesColumns.MODIFIES_ICONS); - components.add(ThemesContract.ThemesColumns.MODIFIES_LOCKSCREEN); - components.add(ThemesContract.ThemesColumns.MODIFIES_NOTIFICATIONS); - components.add(ThemesContract.ThemesColumns.MODIFIES_OVERLAYS); - components.add(ThemesContract.ThemesColumns.MODIFIES_RINGTONES); - components.add(ThemesContract.ThemesColumns.MODIFIES_STATUS_BAR); - components.add(ThemesContract.ThemesColumns.MODIFIES_NAVIGATION_BAR); - tm.requestThemeChange(ThemeConfig.SYSTEM_DEFAULT, components); + final String themePkgName = ThemeConfig.SYSTEM_DEFAULT; + ThemeChangeRequest.Builder builder = new ThemeChangeRequest.Builder(); + builder.setOverlay(themePkgName) + .setStatusBar(themePkgName) + .setNavBar(themePkgName) + .setIcons(themePkgName) + .setFont(themePkgName) + .setBootanimation(themePkgName) + .setWallpaper(themePkgName) + .setLockWallpaper(themePkgName) + .setAlarm(themePkgName) + .setNotification(themePkgName) + .setRingtone(themePkgName); + // Since we are resetting everything to the system theme, we can have the + // theme service remove all per app themes without setting them explicitly :) + tm.requestThemeChange(builder.build(), true); postThemeResetNotification(context); } } |