Merge "Waiting for broadcasts idle in TaplInstrumentation constructor" into sc-v2-dev am: 0e8f7098b4 am: ea8fa012e5

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/15302542

Change-Id: I3ca0d6c3c9d4134195e1292ab3e2b1a0eb61ea72
diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
index ef809d5..1e7f8a5 100644
--- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
+++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
@@ -207,6 +207,11 @@
     public LauncherInstrumentation(Instrumentation instrumentation) {
         mInstrumentation = instrumentation;
         mDevice = UiDevice.getInstance(instrumentation);
+        try {
+            mDevice.executeShellCommand("am wait-for-broadcast-idle");
+        } catch (IOException e) {
+            log("Failed to wait for broadcast idle");
+        }
 
         // Launcher should run in test harness so that custom accessibility protocol between
         // Launcher and TAPL is enabled. In-process tests enable this protocol with a direct call