diff options
author | d34d <clark@cyngn.com> | 2015-02-15 16:45:53 -0800 |
---|---|---|
committer | Clark Scheff <clark@cyngn.com> | 2015-10-27 10:40:12 -0700 |
commit | a0109b463a29072a1afcee1780deb884e811b8c3 (patch) | |
tree | ce8712679cf6322dc1bf5be07c22dc88536104ec /core/java/android/content | |
parent | 1efc14c608e0522640f4ccfd424628fd038721c0 (diff) | |
download | frameworks_base-a0109b463a29072a1afcee1780deb884e811b8c3.zip frameworks_base-a0109b463a29072a1afcee1780deb884e811b8c3.tar.gz frameworks_base-a0109b463a29072a1afcee1780deb884e811b8c3.tar.bz2 |
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
Diffstat (limited to 'core/java/android/content')
-rw-r--r-- | core/java/android/content/res/ResourcesKey.java | 3 | ||||
-rw-r--r-- | core/java/android/content/res/ThemeConfig.java | 8 |
2 files changed, 10 insertions, 1 deletions
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<ThemeConfi return result.toString(); } + @Override + public int hashCode() { + int hash = 17; + hash = 31 * hash + mThemes.hashCode(); + hash = 31 * hash + (int) mThemeChangeTimestamp; + return hash; + } + public String toJson() { return JsonSerializer.toJson(this); } |