Update drawable state after updating tint list

BUG: 18155988
Change-Id: Ic536027a54c10b2082fbc22476530165b76e2c59
diff --git a/core/java/android/widget/CompoundButton.java b/core/java/android/widget/CompoundButton.java
index 092e31c..447ccc2 100644
--- a/core/java/android/widget/CompoundButton.java
+++ b/core/java/android/widget/CompoundButton.java
@@ -315,6 +315,12 @@
             if (mHasButtonTintMode) {
                 mButtonDrawable.setTintMode(mButtonTintMode);
             }
+
+            // The drawable (or one of its children) may not have been
+            // stateful before applying the tint, so let's try again.
+            if (mButtonDrawable.isStateful()) {
+                mButtonDrawable.setState(getDrawableState());
+            }
         }
     }