summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Robin Lee <rgl@google.com> 2023-03-30 17:08:45 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2023-03-30 17:08:45 +0000
commit49a253fc0241ef8e9f231a6ff6887ca53ca81c4b (patch)
tree6b2f6ab07b3afdb8c0625f7a517d529ccc20156f
parent652f5bb548c48369413e27d922b0e3c0ed254526 (diff)
parent98dc39863e45e1b50a540510e9b272bba17fc084 (diff)
RESTRICT AUTOMERGE Revert "Hold onto occluded change until it's committed" am: 98dc39863e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22336269 Change-Id: I660a8347efdb4d4b60cd04903fc2f73e1343e248 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--services/core/java/com/android/server/policy/PhoneWindowManager.java24
1 files changed, 15 insertions, 9 deletions
diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java
index cdf475e265c3..01c7e52a269f 100644
--- a/services/core/java/com/android/server/policy/PhoneWindowManager.java
+++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java
@@ -3378,7 +3378,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
mPendingKeyguardOccluded = occluded;
mKeyguardOccludedChanged = true;
} else {
- setKeyguardOccludedLw(occluded, false /* transitionStarted */);
+ setKeyguardOccludedLw(occluded, false /* force */,
+ false /* transitionStarted */);
}
}
@@ -3387,7 +3388,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
if (mKeyguardOccludedChanged) {
if (DEBUG_KEYGUARD) Slog.d(TAG, "transition/occluded changed occluded="
+ mPendingKeyguardOccluded);
- if (setKeyguardOccludedLw(mPendingKeyguardOccluded, transitionStarted)) {
+ if (setKeyguardOccludedLw(mPendingKeyguardOccluded, false /* force */,
+ transitionStarted)) {
return FINISH_LAYOUT_REDO_LAYOUT | FINISH_LAYOUT_REDO_WALLPAPER;
}
}
@@ -3641,15 +3643,22 @@ public class PhoneWindowManager implements WindowManagerPolicy {
}
/**
- * Updates the occluded state of the Keyguard immediately via
- * {@link com.android.internal.policy.IKeyguardService}.
+ * Updates the occluded state of the Keyguard.
*
* @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.
* @return Whether the flags have changed and we have to redo the layout.
*/
- private boolean setKeyguardOccludedLw(boolean isOccluded, boolean transitionStarted) {
+ private boolean setKeyguardOccludedLw(boolean isOccluded, boolean force,
+ boolean transitionStarted) {
if (DEBUG_KEYGUARD) Slog.d(TAG, "setKeyguardOccluded occluded=" + isOccluded);
+ mKeyguardOccludedChanged = false;
+ if (isKeyguardOccluded() == isOccluded && !force) {
+ return false;
+ }
+
final boolean showing = mKeyguardDelegate.isShowing();
final boolean animate = showing && !isOccluded;
// When remote animation is enabled for keyguard (un)occlude transition, KeyguardService
@@ -3657,10 +3666,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
// to notify here.
final boolean notify = !WindowManagerService.sEnableRemoteKeyguardOccludeAnimation
|| !transitionStarted;
- if (notify) {
- mKeyguardOccludedChanged = false;
- mKeyguardDelegate.setOccluded(isOccluded, animate, notify);
- }
+ mKeyguardDelegate.setOccluded(isOccluded, animate, notify);
return showing;
}