Loading core/java/android/animation/AnimatorInflater.java +2 −2 Original line number Diff line number Diff line Loading @@ -108,7 +108,7 @@ public class AnimatorInflater { float pathErrorScale) throws NotFoundException { final ConfigurationBoundResourceCache<Animator> animatorCache = resources .getAnimatorCache(); Animator animator = animatorCache.getInstance(id, theme); Animator animator = animatorCache.getInstance(id, resources, theme); if (animator != null) { if (DBG_ANIMATOR_INFLATER) { Log.d(TAG, "loaded animator from cache, " + resources.getResourceName(id)); Loading Loading @@ -157,7 +157,7 @@ public class AnimatorInflater { final ConfigurationBoundResourceCache<StateListAnimator> cache = resources .getStateListAnimatorCache(); final Theme theme = context.getTheme(); StateListAnimator animator = cache.getInstance(id, theme); StateListAnimator animator = cache.getInstance(id, resources, theme); if (animator != null) { return animator; } Loading core/java/android/app/ResourcesManager.java +3 −1 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.content.res.AssetManager; import android.content.res.CompatibilityInfo; import android.content.res.Configuration; import android.content.res.Resources; import android.content.res.ResourcesImpl; import android.content.res.ResourcesKey; import android.hardware.display.DisplayManagerGlobal; import android.util.ArrayMap; Loading Loading @@ -250,7 +251,8 @@ public class ResourcesManager { } else { config = getConfiguration(); } r = new Resources(assets, dm, config, compatInfo, classLoader); r = new Resources(classLoader); r.setImpl(new ResourcesImpl(assets, dm, config, compatInfo)); if (DEBUG) Slog.i(TAG, "Created app resources " + resDir + " " + r + ": " + r.getConfiguration() + " appScale=" + r.getCompatibilityInfo().applicationScale); Loading core/java/android/content/res/ConfigurationBoundResourceCache.java +3 −13 Original line number Diff line number Diff line Loading @@ -23,29 +23,19 @@ package android.content.res; * @hide For internal use only. */ public class ConfigurationBoundResourceCache<T> extends ThemedResourceCache<ConstantState<T>> { private final Resources mResources; /** * Creates a cache for the given Resources instance. * * @param resources the resources to use when creating new instances */ public ConfigurationBoundResourceCache(Resources resources) { mResources = resources; } /** * If the resource is cached, creates and returns a new instance of it. * * @param key a key that uniquely identifies the drawable resource * @param resources a Resources object from which to create new instances. * @param theme the theme where the resource will be used * @return a new instance of the resource, or {@code null} if not in * the cache */ public T getInstance(long key, Resources.Theme theme) { public T getInstance(long key, Resources resources, Resources.Theme theme) { final ConstantState<T> entry = get(key, theme); if (entry != null) { return entry.newInstance(mResources, theme); return entry.newInstance(resources, theme); } return null; Loading core/java/android/content/res/DrawableCache.java +3 −13 Original line number Diff line number Diff line Loading @@ -22,29 +22,19 @@ import android.graphics.drawable.Drawable; * Class which can be used to cache Drawable resources against a theme. */ class DrawableCache extends ThemedResourceCache<Drawable.ConstantState> { private final Resources mResources; /** * Creates a cache for the given Resources instance. * * @param resources the resources to use when creating new instances */ public DrawableCache(Resources resources) { mResources = resources; } /** * If the resource is cached, creates and returns a new instance of it. * * @param key a key that uniquely identifies the drawable resource * @param resources a Resources object from which to create new instances. * @param theme the theme where the resource will be used * @return a new instance of the resource, or {@code null} if not in * the cache */ public Drawable getInstance(long key, Resources.Theme theme) { public Drawable getInstance(long key, Resources resources, Resources.Theme theme) { final Drawable.ConstantState entry = get(key, theme); if (entry != null) { return entry.newDrawable(mResources, theme); return entry.newDrawable(resources, theme); } return null; Loading core/java/android/content/res/Resources.java +221 −1063 File changed.Preview size limit exceeded, changes collapsed. Show changes Loading
core/java/android/animation/AnimatorInflater.java +2 −2 Original line number Diff line number Diff line Loading @@ -108,7 +108,7 @@ public class AnimatorInflater { float pathErrorScale) throws NotFoundException { final ConfigurationBoundResourceCache<Animator> animatorCache = resources .getAnimatorCache(); Animator animator = animatorCache.getInstance(id, theme); Animator animator = animatorCache.getInstance(id, resources, theme); if (animator != null) { if (DBG_ANIMATOR_INFLATER) { Log.d(TAG, "loaded animator from cache, " + resources.getResourceName(id)); Loading Loading @@ -157,7 +157,7 @@ public class AnimatorInflater { final ConfigurationBoundResourceCache<StateListAnimator> cache = resources .getStateListAnimatorCache(); final Theme theme = context.getTheme(); StateListAnimator animator = cache.getInstance(id, theme); StateListAnimator animator = cache.getInstance(id, resources, theme); if (animator != null) { return animator; } Loading
core/java/android/app/ResourcesManager.java +3 −1 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.content.res.AssetManager; import android.content.res.CompatibilityInfo; import android.content.res.Configuration; import android.content.res.Resources; import android.content.res.ResourcesImpl; import android.content.res.ResourcesKey; import android.hardware.display.DisplayManagerGlobal; import android.util.ArrayMap; Loading Loading @@ -250,7 +251,8 @@ public class ResourcesManager { } else { config = getConfiguration(); } r = new Resources(assets, dm, config, compatInfo, classLoader); r = new Resources(classLoader); r.setImpl(new ResourcesImpl(assets, dm, config, compatInfo)); if (DEBUG) Slog.i(TAG, "Created app resources " + resDir + " " + r + ": " + r.getConfiguration() + " appScale=" + r.getCompatibilityInfo().applicationScale); Loading
core/java/android/content/res/ConfigurationBoundResourceCache.java +3 −13 Original line number Diff line number Diff line Loading @@ -23,29 +23,19 @@ package android.content.res; * @hide For internal use only. */ public class ConfigurationBoundResourceCache<T> extends ThemedResourceCache<ConstantState<T>> { private final Resources mResources; /** * Creates a cache for the given Resources instance. * * @param resources the resources to use when creating new instances */ public ConfigurationBoundResourceCache(Resources resources) { mResources = resources; } /** * If the resource is cached, creates and returns a new instance of it. * * @param key a key that uniquely identifies the drawable resource * @param resources a Resources object from which to create new instances. * @param theme the theme where the resource will be used * @return a new instance of the resource, or {@code null} if not in * the cache */ public T getInstance(long key, Resources.Theme theme) { public T getInstance(long key, Resources resources, Resources.Theme theme) { final ConstantState<T> entry = get(key, theme); if (entry != null) { return entry.newInstance(mResources, theme); return entry.newInstance(resources, theme); } return null; Loading
core/java/android/content/res/DrawableCache.java +3 −13 Original line number Diff line number Diff line Loading @@ -22,29 +22,19 @@ import android.graphics.drawable.Drawable; * Class which can be used to cache Drawable resources against a theme. */ class DrawableCache extends ThemedResourceCache<Drawable.ConstantState> { private final Resources mResources; /** * Creates a cache for the given Resources instance. * * @param resources the resources to use when creating new instances */ public DrawableCache(Resources resources) { mResources = resources; } /** * If the resource is cached, creates and returns a new instance of it. * * @param key a key that uniquely identifies the drawable resource * @param resources a Resources object from which to create new instances. * @param theme the theme where the resource will be used * @return a new instance of the resource, or {@code null} if not in * the cache */ public Drawable getInstance(long key, Resources.Theme theme) { public Drawable getInstance(long key, Resources resources, Resources.Theme theme) { final Drawable.ConstantState entry = get(key, theme); if (entry != null) { return entry.newDrawable(mResources, theme); return entry.newDrawable(resources, theme); } return null; Loading
core/java/android/content/res/Resources.java +221 −1063 File changed.Preview size limit exceeded, changes collapsed. Show changes