Check if app has pip window for device setup

To srdown correctly in the flicker tests we need to know if the device has a pip window active , so that we can bring the device to a known state.

Test: atest FlickerTests
Change-Id: I982685fa7de9f3aa067f844c27313b5ff6de3833
diff --git a/libraries/flicker/src/com/android/server/wm/flicker/helpers/AutomationUtils.java b/libraries/flicker/src/com/android/server/wm/flicker/helpers/AutomationUtils.java
index 17f046b..03bb3ba 100644
--- a/libraries/flicker/src/com/android/server/wm/flicker/helpers/AutomationUtils.java
+++ b/libraries/flicker/src/com/android/server/wm/flicker/helpers/AutomationUtils.java
@@ -251,6 +251,10 @@
         sleep(2000);
     }
 
+    public static boolean hasPipWindow(UiDevice device) {
+        return device.wait(Until.findObject(getPipWindowSelector()), FIND_TIMEOUT) != null;
+    }
+
     public static BySelector getPipWindowSelector() {
         return By.res(SYSTEMUI_PACKAGE, "background");
     }