From 267ecd151e8e7ad313cbe1a511f18d2d78f2e459 Mon Sep 17 00:00:00 2001 From: Matt Pietal Date: Wed, 23 Feb 2022 09:16:27 -0500 Subject: [DO NOT MERGE] Keyguard was hiding occluding activities Most reproducible while the device is asleep on AoD for a period of time. The system detects the double tap power gesture, and launches the camera activity immediately. However, in the failing case, DreamManagerService only stops the dream after the activity has been launched. This setOccluded path has already happened when the call to wakeup comes in and decides that the StatusBarState should equal KEYGUARD, which is incorrect. This blocks the activity which is running underneath. The correct state is SHADE. Add a check for occlusion before deciding to show the keyguard Fixes: 199349731 Test: launch camera over lockscreen Change-Id: I817fcdc80db79ad95367dc7a49eadaa5e366c3ef (cherry picked from commit 7a2abccf35a28accc7acc563a7c34a44f9bb2212) --- .../src/com/android/systemui/statusbar/phone/StatusBar.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java index d4ce34010bfd..071c8c9117ec 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java @@ -2937,8 +2937,9 @@ public class StatusBar extends SystemUI implements // turned off fully. boolean keyguardForDozing = mDozeServiceHost.getDozingRequested() && (!mDeviceInteractive || isGoingToSleep() && (isScreenFullyOff() || mIsKeyguard)); + boolean isWakingAndOccluded = isOccluded() && isWaking(); boolean shouldBeKeyguard = (mStatusBarStateController.isKeyguardRequested() - || keyguardForDozing) && !wakeAndUnlocking; + || keyguardForDozing) && !wakeAndUnlocking && !isWakingAndOccluded; if (keyguardForDozing) { updatePanelExpansionForKeyguard(); } @@ -3716,6 +3717,10 @@ public class StatusBar extends SystemUI implements == WakefulnessLifecycle.WAKEFULNESS_GOING_TO_SLEEP; } + boolean isWaking() { + return mWakefulnessLifecycle.getWakefulness() == WakefulnessLifecycle.WAKEFULNESS_WAKING; + } + public void notifyBiometricAuthModeChanged() { mDozeServiceHost.updateDozing(); updateScrimController(); -- cgit v1.2.3-59-g8ed1b