Merge "Fix AnimationDrawable double-start bug"
diff --git a/graphics/java/android/graphics/drawable/AnimationDrawable.java b/graphics/java/android/graphics/drawable/AnimationDrawable.java
index 7efdc6c..f02d0f9 100644
--- a/graphics/java/android/graphics/drawable/AnimationDrawable.java
+++ b/graphics/java/android/graphics/drawable/AnimationDrawable.java
@@ -42,7 +42,7 @@
  * <p>spin_animation.xml file in res/drawable/ folder:</p>
  * <pre>&lt;!-- Animation frames are wheel0.png -- wheel5.png files inside the
  * res/drawable/ folder --&gt;
- * &lt;animation-list android:id=&quot;selected&quot; android:oneshot=&quot;false&quot;&gt;
+ * &lt;animation-list android:id=&quot;@+id/selected&quot; android:oneshot=&quot;false&quot;&gt;
  *    &lt;item android:drawable=&quot;@drawable/wheel0&quot; android:duration=&quot;50&quot; /&gt;
  *    &lt;item android:drawable=&quot;@drawable/wheel1&quot; android:duration=&quot;50&quot; /&gt;
  *    &lt;item android:drawable=&quot;@drawable/wheel2&quot; android:duration=&quot;50&quot; /&gt;
@@ -216,6 +216,8 @@
             unscheduleSelf(this);
         }
         if (animate) {
+            // Unscheduling may have clobbered this value; restore it to record that we're animating
+            mCurFrame = frame;
             scheduleSelf(this, SystemClock.uptimeMillis() + mAnimationState.mDurations[frame]);
         }
     }