From a0109b463a29072a1afcee1780deb884e811b8c3 Mon Sep 17 00:00:00 2001 From: d34d Date: Sun, 15 Feb 2015 16:45:53 -0800 Subject: Themes: Include ThemeConfig for ResourceKey hash This patch will help guarantee we retrieve the correct resources including any themed assets that need to be attached. This fixes a bug with SystemUI no longer accepting theme changes because it was returning a cached version of the Resources object from mActiveResources. Change-Id: Icabc2edc6a8a839e459076374db55296e5b21a13 --- core/java/android/content/res/ResourcesKey.java | 3 ++- core/java/android/content/res/ThemeConfig.java | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'core/java/android/content/res') diff --git a/core/java/android/content/res/ResourcesKey.java b/core/java/android/content/res/ResourcesKey.java index f2ed758..466d810 100644 --- a/core/java/android/content/res/ResourcesKey.java +++ b/core/java/android/content/res/ResourcesKey.java @@ -32,7 +32,7 @@ public final class ResourcesKey { public final Configuration mOverrideConfiguration; public ResourcesKey(String resDir, int displayId, Configuration overrideConfiguration, - float scale, boolean isThemeable) { + float scale, boolean isThemeable, ThemeConfig themeConfig) { mResDir = resDir; mDisplayId = displayId; mOverrideConfiguration = overrideConfiguration != null @@ -46,6 +46,7 @@ public final class ResourcesKey { hash = 31 * hash + mOverrideConfiguration.hashCode(); hash = 31 * hash + Float.floatToIntBits(mScale); hash = 31 * hash + (mIsThemeable ? 1 : 0); + hash = 31 * hash + (themeConfig != null ? themeConfig.hashCode() : 0); mHash = hash; } diff --git a/core/java/android/content/res/ThemeConfig.java b/core/java/android/content/res/ThemeConfig.java index a10151d..b1a6d90 100644 --- a/core/java/android/content/res/ThemeConfig.java +++ b/core/java/android/content/res/ThemeConfig.java @@ -146,6 +146,14 @@ public class ThemeConfig implements Cloneable, Parcelable, Comparable