summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBharadwaj Narasimha <bnarasimha@cyngn.com>2016-10-05 11:26:47 -0700
committerClark Scheff <clark@scheffsblend.com>2016-11-28 08:18:58 -0800
commit427433abaa7a05b396ec38594064e0eb6d6523be (patch)
treeadf9f5dcace1a1254330f4327a132c67de2bb08e
parent330d823c639537528f0e57a67ce2c82a99be0bde (diff)
downloadframeworks_base-427433abaa7a05b396ec38594064e0eb6d6523be.zip
frameworks_base-427433abaa7a05b396ec38594064e0eb6d6523be.tar.gz
frameworks_base-427433abaa7a05b396ec38594064e0eb6d6523be.tar.bz2
Themes: Don't cache explicitly themed resources
When a nav bar should be unchanged in the process of customization(like changing icons,fonts) the nav bar changes due to explicitly caching themed resources. Change-Id: I3135fac9df82a0551879908f6bf24deba0da0339
-rw-r--r--core/java/android/app/ResourcesManager.java27
1 files changed, 1 insertions, 26 deletions
diff --git a/core/java/android/app/ResourcesManager.java b/core/java/android/app/ResourcesManager.java
index c98167d..c8aec2e 100644
--- a/core/java/android/app/ResourcesManager.java
+++ b/core/java/android/app/ResourcesManager.java
@@ -335,18 +335,6 @@ public class ResourcesManager {
ResourcesKey key = new ResourcesKey(resDir, displayId, null, compatInfo.applicationScale,
isThemeable, themeConfig);
- synchronized (this) {
- WeakReference<Resources> wr = mActiveResources.get(key);
- r = wr != null ? wr.get() : null;
- if (r != null && r.getAssets().isUpToDate()) {
- if (false) {
- Slog.w(TAG, "Returning cached resources " + r + " " + resDir
- + ": appScale=" + r.getCompatibilityInfo().applicationScale);
- }
- return r;
- }
- }
-
AssetManager assets = new AssetManager();
assets.setAppName(packageName);
assets.setThemeSupport(isThemeable);
@@ -387,20 +375,7 @@ public class ResourcesManager {
+ r.getCompatibilityInfo().applicationScale);
}
- synchronized (this) {
- WeakReference<Resources> wr = mActiveResources.get(key);
- Resources existing = wr != null ? wr.get() : null;
- if (existing != null && existing.getAssets().isUpToDate()) {
- // Someone else already created the resources while we were
- // unlocked; go ahead and use theirs.
- r.getAssets().close();
- return existing;
- }
-
- // XXX need to remove entries when weak references go away
- mActiveResources.put(key, new WeakReference<Resources>(r));
- return r;
- }
+ return r;
}
/**