Check for stopped state after launching AlwaysExpandActivity over the main activity in addition to paused
It seems like the main activity goes through to the paused state when the activity is opened over it but then quickly to stopping and stopped, but if that is faster than our wait condition checking interval we just always wait for paused which has already passed now that we are in stopped.
Test: atest com.android.server.wm.flicker.activityembedding.open.MainActivityStartsSecondaryWithAlwaysExpandTest
Bug: 291916460
Change-Id: Id64fd02a728a3a94504ab0d7f7884efad0236b5f
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/helpers/ActivityEmbeddingAppHelper.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/helpers/ActivityEmbeddingAppHelper.kt
index 35353c6..f20e8e9 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/helpers/ActivityEmbeddingAppHelper.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/helpers/ActivityEmbeddingAppHelper.kt
@@ -171,12 +171,15 @@
wmHelper
.StateSyncBuilder()
.withActivityState(ALWAYS_EXPAND_ACTIVITY_COMPONENT, PlatformConsts.STATE_RESUMED)
- .withActivityState(MAIN_ACTIVITY_COMPONENT, PlatformConsts.STATE_PAUSED)
+ .withActivityState(MAIN_ACTIVITY_COMPONENT, PlatformConsts.STATE_PAUSED,
+ PlatformConsts.STATE_STOPPED)
.waitForAndVerify()
}
private fun launchSecondaryActivityFromButton(
- wmHelper: WindowManagerStateHelper, buttonName: String) {
+ wmHelper: WindowManagerStateHelper,
+ buttonName: String
+ ) {
val launchButton =
uiDevice.wait(Until.findObject(By.res(getPackage(), buttonName)), FIND_TIMEOUT)
require(launchButton != null) {