Merge "Revert "Refresh opacity and statefulness on tint change"" into oc-dev
diff --git a/graphics/java/android/graphics/drawable/DrawableContainer.java b/graphics/java/android/graphics/drawable/DrawableContainer.java
index 04864bdc..d88aee9 100644
--- a/graphics/java/android/graphics/drawable/DrawableContainer.java
+++ b/graphics/java/android/graphics/drawable/DrawableContainer.java
@@ -88,9 +88,7 @@
     }
 
     @Override
-    public
-    @Config
-    int getChangingConfigurations() {
+    public @Config int getChangingConfigurations() {
         return super.getChangingConfigurations()
                 | mDrawableContainerState.getChangingConfigurations();
     }
@@ -212,7 +210,6 @@
     /**
      * Change the global fade duration when a new drawable is entering
      * the scene.
-     *
      * @param ms The amount of time to fade in milliseconds.
      */
     public void setEnterFadeDuration(int ms) {
@@ -222,7 +219,6 @@
     /**
      * Change the global fade duration when a new drawable is leaving
      * the scene.
-     *
      * @param ms The amount of time to fade in milliseconds.
      */
     public void setExitFadeDuration(int ms) {
@@ -379,13 +375,6 @@
 
     @Override
     public void invalidateDrawable(@NonNull Drawable who) {
-        // This may have been called as the result of a tint changing, in
-        // which case we may need to refresh the cached statefulness or
-        // opacity.
-        if (mDrawableContainerState != null) {
-            mDrawableContainerState.invalidateCache();
-        }
-
         if (who == mCurrDrawable && getCallback() != null) {
             getCallback().invalidateDrawable(this);
         }
@@ -833,8 +822,8 @@
             mDrawables[pos] = dr;
             mNumChildren++;
             mChildrenChangingConfigurations |= dr.getChangingConfigurations();
-
-            invalidateCache();
+            mCheckedStateful = false;
+            mCheckedOpacity = false;
 
             mConstantPadding = null;
             mCheckedPadding = false;
@@ -844,14 +833,6 @@
             return pos;
         }
 
-        /**
-         * Invalidates the cached opacity and statefulness.
-         */
-        void invalidateCache() {
-            mCheckedOpacity = false;
-            mCheckedStateful = false;
-        }
-
         final int getCapacity() {
             return mDrawables.length;
         }
diff --git a/graphics/java/android/graphics/drawable/LayerDrawable.java b/graphics/java/android/graphics/drawable/LayerDrawable.java
index 322e55b..355e45e 100644
--- a/graphics/java/android/graphics/drawable/LayerDrawable.java
+++ b/graphics/java/android/graphics/drawable/LayerDrawable.java
@@ -986,11 +986,6 @@
         if (mSuspendChildInvalidation) {
             mChildRequestedInvalidation = true;
         } else {
-            // This may have been called as the result of a tint changing, in
-            // which case we may need to refresh the cached statefulness or
-            // opacity.
-            mLayerState.invalidateCache();
-
             invalidateSelf();
         }
     }
@@ -2126,10 +2121,7 @@
             return true;
         }
 
-        /**
-         * Invalidates the cached opacity and statefulness.
-         */
-        void invalidateCache() {
+        public void invalidateCache() {
             mCheckedOpacity = false;
             mCheckedStateful = false;
         }