Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 58857c8b authored by Alan Viverette's avatar Alan Viverette
Browse files

Always propagate changingConfigurations to newly-created drawables

Bug: 32395972
Test: ResourcesTest#testChangingConfigurations
Change-Id: I555f3271854bdb6026db15f855847714c4986af3
parent daf72290
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -553,6 +553,7 @@ public class ResourcesImpl {
            if (!mPreloading && useCache) {
                final Drawable cachedDrawable = caches.getInstance(key, wrapper, theme);
                if (cachedDrawable != null) {
                    cachedDrawable.setChangingConfigurations(value.changingConfigurations);
                    return cachedDrawable;
                }
            }
@@ -588,10 +589,12 @@ public class ResourcesImpl {
            // If we were able to obtain a drawable, store it in the appropriate
            // cache: preload, not themed, null theme, or theme-specific. Don't
            // pollute the cache with drawables loaded from a foreign density.
            if (dr != null && useCache) {
            if (dr != null) {
                dr.setChangingConfigurations(value.changingConfigurations);
                if (useCache) {
                    cacheDrawable(value, isColorDrawable, caches, theme, canApplyTheme, key, dr);
                }
            }

            return dr;
        } catch (Exception e) {