summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorChet Haase <chet@google.com>2014-08-18 22:03:20 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-08-18 21:31:41 +0000
commit32e966ccb3da268af7b0ecdf5987d10700600473 (patch)
treeeca5214662fc81ccf672ec305cb63e6c96dcdf70 /graphics
parent71809ee7f63229d0ea4f6169922ddfbfee330fd2 (diff)
parent030435773dc5413a690d460e97fd681740cd32ef (diff)
downloadframeworks_base-32e966ccb3da268af7b0ecdf5987d10700600473.zip
frameworks_base-32e966ccb3da268af7b0ecdf5987d10700600473.tar.gz
frameworks_base-32e966ccb3da268af7b0ecdf5987d10700600473.tar.bz2
Merge "Fix crash in AnimationDrawable" into lmp-dev
Diffstat (limited to 'graphics')
-rw-r--r--graphics/java/android/graphics/drawable/AnimationDrawable.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/graphics/java/android/graphics/drawable/AnimationDrawable.java b/graphics/java/android/graphics/drawable/AnimationDrawable.java
index 5318fa7..d87e8e4 100644
--- a/graphics/java/android/graphics/drawable/AnimationDrawable.java
+++ b/graphics/java/android/graphics/drawable/AnimationDrawable.java
@@ -114,7 +114,9 @@ public class AnimationDrawable extends DrawableContainer implements Runnable, An
final boolean changed = super.setVisible(visible, restart);
if (visible) {
if (restart || changed) {
- setFrame(restart ? 0 : mCurFrame, true, mAnimating);
+ boolean startFromZero = restart || mCurFrame < 0 ||
+ mCurFrame >= mAnimationState.getChildCount();
+ setFrame(startFromZero ? 0 : mCurFrame, true, mAnimating);
}
} else {
unscheduleSelf(this);