Merge "Merge "AnimationDrawableTest will fail when AnimationDrawable created from cache" into lollipop-mr1-cts-dev am: 44738771c9" into marshmallow-cts-dev
am: 5483fb6a0e
Change-Id: I8b9195c1a48d0799ebbeef538328e93ad1469d36
diff --git a/tests/tests/graphics/src/android/graphics/drawable/cts/AnimationDrawableTest.java b/tests/tests/graphics/src/android/graphics/drawable/cts/AnimationDrawableTest.java
index 28a3c6b..ab7ca90 100644
--- a/tests/tests/graphics/src/android/graphics/drawable/cts/AnimationDrawableTest.java
+++ b/tests/tests/graphics/src/android/graphics/drawable/cts/AnimationDrawableTest.java
@@ -48,6 +48,7 @@
private AnimationDrawable mAnimationDrawable;
private Resources mResources;
+ private boolean mInitialOneShotValue;
public AnimationDrawableTest() {
super("com.android.cts.graphics", ImageViewCtsActivity.class);
@@ -64,6 +65,7 @@
ImageView imageView = (ImageView) activity.findViewById(R.id.imageview);
imageView.setBackgroundResource(R.drawable.animationdrawable);
mAnimationDrawable = (AnimationDrawable) imageView.getBackground();
+ mInitialOneShotValue = mAnimationDrawable.isOneShot();
}
});
} catch (Throwable t) {
@@ -71,6 +73,12 @@
}
}
+ @Override
+ protected void tearDown() throws Exception {
+ mAnimationDrawable.setOneShot(mInitialOneShotValue);
+ super.tearDown();
+ }
+
public void testConstructor() {
mAnimationDrawable = new AnimationDrawable();
// Check the values set in the constructor