Reduce the chance of activity manager tests being flaky

It is possible we get the activity manager and window manager states
before the activities under test is visible. We now wait a little for
the activities to be visible before getting state information.

Also, added configuration handling to some pipeable activities.

Bug: 26982752
Change-Id: I0a367e9d5b4e4f4e5174deb38362a3d85444cf37
diff --git a/hostsidetests/services/activitymanager/app/AndroidManifest.xml b/hostsidetests/services/activitymanager/app/AndroidManifest.xml
index ed3cece..6b52188 100755
--- a/hostsidetests/services/activitymanager/app/AndroidManifest.xml
+++ b/hostsidetests/services/activitymanager/app/AndroidManifest.xml
@@ -46,11 +46,13 @@
         <activity android:name=".PipActivity"
                 android:resizeable="true"
                 android:supportsPictureInPicture="true"
+                android:configChanges="orientation|screenSize|smallestScreenSize|screenLayout"
                 android:exported="true"
         />
         <activity android:name=".AutoEnterPipActivity"
                   android:resizeable="true"
                   android:supportsPictureInPicture="true"
+                  android:configChanges="orientation|screenSize|smallestScreenSize|screenLayout"
                   android:exported="true"
         />
         <activity android:name=".AlwaysFocusablePipActivity"
@@ -65,6 +67,7 @@
                   android:resizeable="true"
                   android:supportsPictureInPicture="true"
                   androidprv:alwaysFocusable="true"
+                  android:configChanges="orientation|screenSize|smallestScreenSize|screenLayout"
                   android:exported="true"
         />
         <activity android:name=".VisibleBehindActivity"