Merge "Merge "Merge "Merge "Merge "AnimationDrawableTest will fail when AnimationDrawable created from cache" into lollipop-mr1-cts-dev am: 44738771c9" into marshmallow-cts-dev am: 5483fb6a0e" into nougat-cts-dev am: fd86d39a38" into nougat-mr1-cts-dev am: 8a330a1a38"
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 33b99a4..1183c11 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("android.graphics.cts", 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