Fixes getting the wrong app transition going home after minimized (2/2)
This is a side affect from ag/2125707. When minimizing and unminimizing
back to home would cause the same affect in the bug, where the app
transition is from activity to activity and not app. The issue was a
"updateAllDrawn" is normally called at the end of the surface
transaction and therefore removing this call (that would run inbetween
the transaction) should fix prematurely calculating the app transition
before setting the wallpaper target.
Fixes: 62727547
Test: go/wm-smoke
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test
CtsServicesHostTestCases
android.server.cts.ActivityManagerDockedStackTests#
testMinimizeAndUnminimizeThenGoingHome
Change-Id: I5a0f2d6087640ad17fa2cf1a19840e17aa166151
diff --git a/hostsidetests/services/activityandwindowmanager/activitymanager/src/android/server/cts/ActivityManagerDockedStackTests.java b/hostsidetests/services/activityandwindowmanager/activitymanager/src/android/server/cts/ActivityManagerDockedStackTests.java
index 5a49af72..cf3540c 100644
--- a/hostsidetests/services/activityandwindowmanager/activitymanager/src/android/server/cts/ActivityManagerDockedStackTests.java
+++ b/hostsidetests/services/activityandwindowmanager/activitymanager/src/android/server/cts/ActivityManagerDockedStackTests.java
@@ -21,6 +21,8 @@
import java.awt.Rectangle;
+import static android.server.cts.WindowManagerState.TRANSIT_WALLPAPER_OPEN;
+
/**
* Build: mmma -j32 cts/hostsidetests/services
* Run: cts/hostsidetests/services/activityandwindowmanager/util/run-test CtsServicesHostTestCases android.server.cts.ActivityManagerDockedStackTests
@@ -409,6 +411,37 @@
mAmWmState.computeState(mDevice, waitForActivitiesVisible);
}
+ public void testMinimizeAndUnminimizeThenGoingHome() throws Exception {
+ if (!supportsSplitScreenMultiWindow()) {
+ CLog.logAndDisplay(LogLevel.INFO, "Skipping test: no split multi-window support");
+ return;
+ }
+
+ // Rotate the screen to check that minimize, unminimize, dismiss the docked stack and then
+ // going home has the correct app transition
+ for (int i = 0; i < 4; i++) {
+ setDeviceRotation(i);
+ launchActivityInDockStackAndMinimize(DOCKED_ACTIVITY_NAME);
+ assertDockMinimized();
+
+ // Unminimize the docked stack
+ pressAppSwitchButton();
+ waitForDockNotMinimized();
+ assertDockNotMinimized();
+
+ // Dismiss the dock stack
+ launchActivityInStack(TEST_ACTIVITY_NAME, FULLSCREEN_WORKSPACE_STACK_ID);
+ moveActivityToStack(DOCKED_ACTIVITY_NAME, FULLSCREEN_WORKSPACE_STACK_ID);
+ mAmWmState.computeState(mDevice, new String[]{DOCKED_ACTIVITY_NAME});
+
+ // Go home and check the app transition
+ assertNotSame(TRANSIT_WALLPAPER_OPEN, mAmWmState.getWmState().getLastTransition());
+ pressHomeButton();
+ mAmWmState.computeState(mDevice, null);
+ assertEquals(TRANSIT_WALLPAPER_OPEN, mAmWmState.getWmState().getLastTransition());
+ }
+ }
+
public void testFinishDockActivityWhileMinimized() throws Exception {
if (!supportsSplitScreenMultiWindow()) {
CLog.logAndDisplay(LogLevel.INFO, "Skipping test: no split multi-window support");