Make sure all activities are gone.

Otherwise we might not get a window-state-changed event which times out
the test.

Before the test failed ~50% of the time. Afterwards I ran 12 runs
without any issues.

Fixes: 28867635
Change-Id: Ic8e1687382e476ee3332b6669cd99c3039843d2e
diff --git a/hostsidetests/appsecurity/test-apps/UsePermissionApp23/src/com/android/cts/usepermission/BasePermissionsTest.java b/hostsidetests/appsecurity/test-apps/UsePermissionApp23/src/com/android/cts/usepermission/BasePermissionsTest.java
index 61bc0c7..250a198 100644
--- a/hostsidetests/appsecurity/test-apps/UsePermissionApp23/src/com/android/cts/usepermission/BasePermissionsTest.java
+++ b/hostsidetests/appsecurity/test-apps/UsePermissionApp23/src/com/android/cts/usepermission/BasePermissionsTest.java
@@ -246,6 +246,8 @@
         waitForIdle();
         getUiDevice().pressBack();
         waitForIdle();
+        getUiDevice().pressBack();
+        waitForIdle();
 
         // Open the app details settings
         Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);