Fix AnimationTest#testSetAnimationListener

Test is flakey so waitForIdleSync when the animation posts a message to
call the listener.

Bug 6563048

Change-Id: I742b6fc8c8534cd14a0ffb3880ccf1acb726603b
diff --git a/tests/src/android/view/animation/cts/AnimationTestUtils.java b/tests/src/android/view/animation/cts/AnimationTestUtils.java
index a2b786d..f9675c7 100644
--- a/tests/src/android/view/animation/cts/AnimationTestUtils.java
+++ b/tests/src/android/view/animation/cts/AnimationTestUtils.java
@@ -81,6 +81,8 @@
                 return animation.hasEnded();
             }
         }.run();
+
+        instrumentation.waitForIdleSync();
     }
 
     /**