diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java index 7f1679a8299d0..449801da426cf 100644 --- a/services/core/java/com/android/server/policy/PhoneWindowManager.java +++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java @@ -3501,8 +3501,8 @@ public class PhoneWindowManager implements WindowManagerPolicy { } @Override - public void onKeyguardOccludedChangedLw(boolean occluded) { - if (mKeyguardDelegate != null && mKeyguardDelegate.isShowing()) { + public void onKeyguardOccludedChangedLw(boolean occluded, boolean waitAppTransition) { + if (mKeyguardDelegate != null && waitAppTransition) { mPendingKeyguardOccluded = occluded; mKeyguardOccludedChanged = true; } else { diff --git a/services/core/java/com/android/server/policy/WindowManagerPolicy.java b/services/core/java/com/android/server/policy/WindowManagerPolicy.java index ca5fa5f1b630f..3c4dbf2479344 100644 --- a/services/core/java/com/android/server/policy/WindowManagerPolicy.java +++ b/services/core/java/com/android/server/policy/WindowManagerPolicy.java @@ -164,9 +164,10 @@ public interface WindowManagerPolicy extends WindowManagerPolicyConstants { /** * Called when the Keyguard occluded state changed. + * * @param occluded Whether Keyguard is currently occluded or not. */ - void onKeyguardOccludedChangedLw(boolean occluded); + void onKeyguardOccludedChangedLw(boolean occluded, boolean waitAppTransition); /** * @param notify {@code true} if the status change should be immediately notified via diff --git a/services/core/java/com/android/server/wm/KeyguardController.java b/services/core/java/com/android/server/wm/KeyguardController.java index e9badefe1bb17..32b3ccf85c945 100644 --- a/services/core/java/com/android/server/wm/KeyguardController.java +++ b/services/core/java/com/android/server/wm/KeyguardController.java @@ -401,8 +401,10 @@ class KeyguardController { return; } - mWindowManager.mPolicy.onKeyguardOccludedChangedLw(isDisplayOccluded(DEFAULT_DISPLAY)); - if (isKeyguardLocked(displayId)) { + final boolean waitAppTransition = isKeyguardLocked(displayId); + mWindowManager.mPolicy.onKeyguardOccludedChangedLw(isDisplayOccluded(DEFAULT_DISPLAY), + waitAppTransition); + if (waitAppTransition) { mService.deferWindowLayout(); try { mRootWindowContainer.getDefaultDisplay() diff --git a/services/tests/wmtests/src/com/android/server/wm/TestWindowManagerPolicy.java b/services/tests/wmtests/src/com/android/server/wm/TestWindowManagerPolicy.java index 3344bdb24d1ec..1d0715ab04601 100644 --- a/services/tests/wmtests/src/com/android/server/wm/TestWindowManagerPolicy.java +++ b/services/tests/wmtests/src/com/android/server/wm/TestWindowManagerPolicy.java @@ -222,7 +222,7 @@ class TestWindowManagerPolicy implements WindowManagerPolicy { } @Override - public void onKeyguardOccludedChangedLw(boolean occluded) { + public void onKeyguardOccludedChangedLw(boolean occluded, boolean waitAppTransition) { } public void setSafeMode(boolean safeMode) {