Merge "Hold onto occluded change until it's committed" into tm-qpr-dev am: 0cbdbb64c8

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22177534

Change-Id: I824ea1f31c2b661e461f7c0cdb081198cdd52ab5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
TreeHugger Robot
2023-03-23 22:04:34 +00:00
committed by Automerger Merge Worker

View File

@@ -3378,8 +3378,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
mPendingKeyguardOccluded = occluded; mPendingKeyguardOccluded = occluded;
mKeyguardOccludedChanged = true; mKeyguardOccludedChanged = true;
} else { } else {
setKeyguardOccludedLw(occluded, false /* force */, setKeyguardOccludedLw(occluded, false /* transitionStarted */);
false /* transitionStarted */);
} }
} }
@@ -3388,8 +3387,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
if (mKeyguardOccludedChanged) { if (mKeyguardOccludedChanged) {
if (DEBUG_KEYGUARD) Slog.d(TAG, "transition/occluded changed occluded=" if (DEBUG_KEYGUARD) Slog.d(TAG, "transition/occluded changed occluded="
+ mPendingKeyguardOccluded); + mPendingKeyguardOccluded);
if (setKeyguardOccludedLw(mPendingKeyguardOccluded, false /* force */, if (setKeyguardOccludedLw(mPendingKeyguardOccluded, transitionStarted)) {
transitionStarted)) {
return FINISH_LAYOUT_REDO_LAYOUT | FINISH_LAYOUT_REDO_WALLPAPER; return FINISH_LAYOUT_REDO_LAYOUT | FINISH_LAYOUT_REDO_WALLPAPER;
} }
} }
@@ -3643,22 +3641,15 @@ public class PhoneWindowManager implements WindowManagerPolicy {
} }
/** /**
* Updates the occluded state of the Keyguard. * Updates the occluded state of the Keyguard immediately via
* {@link com.android.internal.policy.IKeyguardService}.
* *
* @param isOccluded Whether the Keyguard is occluded by another window. * @param isOccluded Whether the Keyguard is occluded by another window.
* @param force notify the occluded status to KeyguardService and update flags even though
* occlude status doesn't change.
* @param transitionStarted {@code true} if keyguard (un)occluded transition started. * @param transitionStarted {@code true} if keyguard (un)occluded transition started.
* @return Whether the flags have changed and we have to redo the layout. * @return Whether the flags have changed and we have to redo the layout.
*/ */
private boolean setKeyguardOccludedLw(boolean isOccluded, boolean force, private boolean setKeyguardOccludedLw(boolean isOccluded, boolean transitionStarted) {
boolean transitionStarted) {
if (DEBUG_KEYGUARD) Slog.d(TAG, "setKeyguardOccluded occluded=" + isOccluded); if (DEBUG_KEYGUARD) Slog.d(TAG, "setKeyguardOccluded occluded=" + isOccluded);
mKeyguardOccludedChanged = false;
if (isKeyguardOccluded() == isOccluded && !force) {
return false;
}
final boolean showing = mKeyguardDelegate.isShowing(); final boolean showing = mKeyguardDelegate.isShowing();
final boolean animate = showing && !isOccluded; final boolean animate = showing && !isOccluded;
// When remote animation is enabled for keyguard (un)occlude transition, KeyguardService // When remote animation is enabled for keyguard (un)occlude transition, KeyguardService
@@ -3666,7 +3657,10 @@ public class PhoneWindowManager implements WindowManagerPolicy {
// to notify here. // to notify here.
final boolean notify = !WindowManagerService.sEnableRemoteKeyguardOccludeAnimation final boolean notify = !WindowManagerService.sEnableRemoteKeyguardOccludeAnimation
|| !transitionStarted; || !transitionStarted;
if (notify) {
mKeyguardOccludedChanged = false;
mKeyguardDelegate.setOccluded(isOccluded, animate, notify); mKeyguardDelegate.setOccluded(isOccluded, animate, notify);
}
return showing; return showing;
} }