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
This commit is contained in:
Louis Chang
2023-06-07 03:25:59 +00:00
parent f82b94680c
commit ddda9bd87a

View File

@@ -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);