From ddda9bd87aa5bfdbd171a45d07874bc2c2c9f890 Mon Sep 17 00:00:00 2001 From: Louis Chang Date: Wed, 7 Jun 2023 03:25:59 +0000 Subject: [PATCH] Requesting a new transition when user switches Home task was moved to top while switching to a new user and the home activity was started afterward. A new transition was started while starting the home activity and the previous top activity visibility changes were also collected. The transition was somehow aborted since the launch result was DELIVERED_TO_TOP. Therefore, the previous top activity remained visible in the background. Requesting a new transition when user switches, so that all the hierarchy changes would be collected and the visibility would be updated after transition completed. Bug: 284458878 Test: verified by the repro steps on the bug Change-Id: I27177ba4b0017f89701d82cb4ffbb3db106725ea --- .../core/java/com/android/server/wm/WindowManagerService.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index 322c11a7cc4b3..0bb03f8a05f1c 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -88,6 +88,7 @@ import static android.view.WindowManager.LayoutParams.TYPE_VOLUME_OVERLAY; import static android.view.WindowManager.LayoutParams.TYPE_WALLPAPER; import static android.view.WindowManager.REMOVE_CONTENT_MODE_UNDEFINED; import static android.view.WindowManager.TRANSIT_NONE; +import static android.view.WindowManager.TRANSIT_OPEN; import static android.view.WindowManager.fixScale; import static android.view.WindowManagerGlobal.ADD_OKAY; import static android.view.WindowManagerGlobal.RELAYOUT_RES_CANCEL_AND_REDRAW; @@ -3591,6 +3592,7 @@ public class WindowManagerService extends IWindowManager.Stub public void setCurrentUser(@UserIdInt int newUserId) { synchronized (mGlobalLock) { + mAtmService.getTransitionController().requestTransitionIfNeeded(TRANSIT_OPEN, null); mCurrentUserId = newUserId; mPolicy.setCurrentUserLw(newUserId); mKeyguardDisableHandler.setCurrentUser(newUserId);