Fix flake in BubbleBarViewAnimatorTest

The flake was probably happening because the animation end listener
has not finished running on the UI thread. This change waits for
the UI thread to become idle before proceeding.

Flag: com.android.wm.shell.enable_bubble_bar
Bug: 341161005
Test: ran BubbleBarViewAnimatorTest#animateToInitialState_inApp 100x
Change-Id: Ide3b0a34095ed01cc179534fa608aecd5d3f3a20
diff --git a/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/bubbles/animation/BubbleBarViewAnimatorTest.kt b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/bubbles/animation/BubbleBarViewAnimatorTest.kt
index c54755b..49e54fb 100644
--- a/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/bubbles/animation/BubbleBarViewAnimatorTest.kt
+++ b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/bubbles/animation/BubbleBarViewAnimatorTest.kt
@@ -299,6 +299,7 @@
         InstrumentationRegistry.getInstrumentation().runOnMainSync {}
         PhysicsAnimatorTestUtils.blockUntilAnimationsEnd(DynamicAnimation.TRANSLATION_Y)
 
+        InstrumentationRegistry.getInstrumentation().waitForIdleSync()
         assertThat(bubbleBarView.isAnimatingNewBubble).isFalse()
         assertThat(bubbleBarView.alpha).isEqualTo(0)
         assertThat(handle.translationY).isEqualTo(0)