From f9600f10008491df7bb83ed7e36e5dd8597e1701 Mon Sep 17 00:00:00 2001 From: wilsonshih Date: Tue, 7 Feb 2023 07:57:40 +0000 Subject: [PATCH] [Shell-Trans] Update keyguard occluded status to KeyguardService ...even if no change involved. The occluded status could change while screen off, so there will no visibility change in that transition. But we should allow that transition to dispatched to KeyguardService so the occluding status can align. Bug: 266953625 Test: run testLaunchNoHistoryActivityOnNewDisplay with enable keyguard. Verify the KeyguardService won't stuck in occluded after test finish. Change-Id: I7438de3c1892bccaf80ce644548a4c86c078cd17 --- .../src/com/android/wm/shell/transition/Transitions.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java index 5275e90b931f7..75d19393b98a4 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java @@ -20,6 +20,7 @@ import static android.view.WindowManager.TRANSIT_CHANGE; import static android.view.WindowManager.TRANSIT_CLOSE; import static android.view.WindowManager.TRANSIT_FIRST_CUSTOM; import static android.view.WindowManager.TRANSIT_KEYGUARD_GOING_AWAY; +import static android.view.WindowManager.TRANSIT_KEYGUARD_UNOCCLUDE; import static android.view.WindowManager.TRANSIT_OPEN; import static android.view.WindowManager.TRANSIT_TO_BACK; import static android.view.WindowManager.TRANSIT_TO_FRONT; @@ -504,7 +505,9 @@ public class Transitions implements RemoteCallable { mObservers.get(i).onTransitionReady(transitionToken, info, t, finishT); } - if (!info.getRootLeash().isValid()) { + // Allow to notify keyguard un-occluding state to KeyguardService, which can happen while + // screen-off, so there might no visibility change involved. + if (!info.getRootLeash().isValid() && info.getType() != TRANSIT_KEYGUARD_UNOCCLUDE) { // Invalid root-leash implies that the transition is empty/no-op, so just do // housekeeping and return. ProtoLog.v(ShellProtoLogGroup.WM_SHELL_TRANSITIONS, "Invalid root leash (%s): %s",