Merge "FIx occlusion status mismatch issue when screen turns off and on quickly"

This commit is contained in:
Josh Tsuji
2023-02-14 17:38:52 +00:00
committed by Android (Google) Code Review
4 changed files with 9 additions and 6 deletions

View File

@@ -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 {

View File

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

View File

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

View File

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