Loading core/java/android/app/ResourcesManager.java +21 −0 Original line number Original line Diff line number Diff line Loading @@ -440,6 +440,11 @@ public class ResourcesManager { compatInfo); compatInfo); classLoader = classLoader != null ? classLoader : ClassLoader.getSystemClassLoader(); classLoader = classLoader != null ? classLoader : ClassLoader.getSystemClassLoader(); if (DEBUG) { Slog.d(TAG, "createBaseActivityResources activity=" + activityToken + " with key=" + key); } synchronized (this) { synchronized (this) { final ActivityResources activityResources = getOrCreateActivityResourcesStructLocked( final ActivityResources activityResources = getOrCreateActivityResourcesStructLocked( activityToken); activityToken); Loading Loading @@ -651,6 +656,16 @@ public class ResourcesManager { activityResources.overrideConfig.setToDefaults(); 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 = final boolean activityHasOverrideConfig = !activityResources.overrideConfig.equals(Configuration.EMPTY); !activityResources.overrideConfig.equals(Configuration.EMPTY); Loading Loading @@ -692,9 +707,15 @@ public class ResourcesManager { oldKey.mOverlayDirs, oldKey.mLibDirs, oldKey.mDisplayId, oldKey.mOverlayDirs, oldKey.mLibDirs, oldKey.mDisplayId, rebasedOverrideConfig, oldKey.mCompatInfo); rebasedOverrideConfig, oldKey.mCompatInfo); if (DEBUG) { Slog.d(TAG, "rebasing ref=" + resources + " from oldKey=" + oldKey + " to newKey=" + newKey); } ResourcesImpl resourcesImpl = findResourcesImplForKeyLocked(newKey); ResourcesImpl resourcesImpl = findResourcesImplForKeyLocked(newKey); if (resourcesImpl == null) { if (resourcesImpl == null) { resourcesImpl = createResourcesImpl(newKey); resourcesImpl = createResourcesImpl(newKey); mResourceImpls.put(newKey, new WeakReference<>(resourcesImpl)); } } if (resourcesImpl != resources.getImpl()) { if (resourcesImpl != resources.getImpl()) { Loading Loading
core/java/android/app/ResourcesManager.java +21 −0 Original line number Original line Diff line number Diff line Loading @@ -440,6 +440,11 @@ public class ResourcesManager { compatInfo); compatInfo); classLoader = classLoader != null ? classLoader : ClassLoader.getSystemClassLoader(); classLoader = classLoader != null ? classLoader : ClassLoader.getSystemClassLoader(); if (DEBUG) { Slog.d(TAG, "createBaseActivityResources activity=" + activityToken + " with key=" + key); } synchronized (this) { synchronized (this) { final ActivityResources activityResources = getOrCreateActivityResourcesStructLocked( final ActivityResources activityResources = getOrCreateActivityResourcesStructLocked( activityToken); activityToken); Loading Loading @@ -651,6 +656,16 @@ public class ResourcesManager { activityResources.overrideConfig.setToDefaults(); 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 = final boolean activityHasOverrideConfig = !activityResources.overrideConfig.equals(Configuration.EMPTY); !activityResources.overrideConfig.equals(Configuration.EMPTY); Loading Loading @@ -692,9 +707,15 @@ public class ResourcesManager { oldKey.mOverlayDirs, oldKey.mLibDirs, oldKey.mDisplayId, oldKey.mOverlayDirs, oldKey.mLibDirs, oldKey.mDisplayId, rebasedOverrideConfig, oldKey.mCompatInfo); rebasedOverrideConfig, oldKey.mCompatInfo); if (DEBUG) { Slog.d(TAG, "rebasing ref=" + resources + " from oldKey=" + oldKey + " to newKey=" + newKey); } ResourcesImpl resourcesImpl = findResourcesImplForKeyLocked(newKey); ResourcesImpl resourcesImpl = findResourcesImplForKeyLocked(newKey); if (resourcesImpl == null) { if (resourcesImpl == null) { resourcesImpl = createResourcesImpl(newKey); resourcesImpl = createResourcesImpl(newKey); mResourceImpls.put(newKey, new WeakReference<>(resourcesImpl)); } } if (resourcesImpl != resources.getImpl()) { if (resourcesImpl != resources.getImpl()) { Loading