Merge "ResourcesManager: Fix a cache issue" into nyc-dev

am: ce2a399

* commit 'ce2a3990323433a3278100531ef6e9184497d058':
  ResourcesManager: Fix a cache issue

Change-Id: I6ec0fb190687fb7a421445938f71cc20aa0bf9af
This commit is contained in:
Adam Lesinski
2016-04-01 19:05:10 +00:00
committed by android-build-merger

View File

@@ -440,6 +440,11 @@ public class ResourcesManager {
compatInfo);
classLoader = classLoader != null ? classLoader : ClassLoader.getSystemClassLoader();
if (DEBUG) {
Slog.d(TAG, "createBaseActivityResources activity=" + activityToken
+ " with key=" + key);
}
synchronized (this) {
final ActivityResources activityResources = getOrCreateActivityResourcesStructLocked(
activityToken);
@@ -651,6 +656,16 @@ public class ResourcesManager {
activityResources.overrideConfig.setToDefaults();
}
if (DEBUG) {
Throwable here = new Throwable();
here.fillInStackTrace();
Slog.d(TAG, "updating resources override for activity=" + activityToken
+ " from oldConfig=" + Configuration.resourceQualifierString(oldConfig)
+ " to newConfig="
+ Configuration.resourceQualifierString(activityResources.overrideConfig),
here);
}
final boolean activityHasOverrideConfig =
!activityResources.overrideConfig.equals(Configuration.EMPTY);
@@ -692,9 +707,15 @@ public class ResourcesManager {
oldKey.mOverlayDirs, oldKey.mLibDirs, oldKey.mDisplayId,
rebasedOverrideConfig, oldKey.mCompatInfo);
if (DEBUG) {
Slog.d(TAG, "rebasing ref=" + resources + " from oldKey=" + oldKey
+ " to newKey=" + newKey);
}
ResourcesImpl resourcesImpl = findResourcesImplForKeyLocked(newKey);
if (resourcesImpl == null) {
resourcesImpl = createResourcesImpl(newKey);
mResourceImpls.put(newKey, new WeakReference<>(resourcesImpl));
}
if (resourcesImpl != resources.getImpl()) {