From a00065dfa389ae1862387755d2dae3a960f85048 Mon Sep 17 00:00:00 2001 From: LibXZR Date: Fri, 13 May 2022 21:08:48 +0800 Subject: SystemUI: Fix unintended wakeup with biometric unlock enabled This hack fixes the issue that the screen is randomly turned back on right after being turned off without changing the original behavior. We still need to wait for Google to come up with a proper fix. Change-Id: I5ce99e72bcffe160fca9f4478058d3fcb51eca78 Signed-off-by: LibXZR --- .../statusbar/phone/StatusBarKeyguardViewManager.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java index 87c693b29a55..f48e26da6477 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java @@ -70,6 +70,8 @@ import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.statusbar.policy.KeyguardStateController; import java.io.PrintWriter; +import java.lang.StackTraceElement; +import java.lang.Thread; import java.util.ArrayList; import java.util.Objects; @@ -119,9 +121,18 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb private final BouncerExpansionCallback mExpansionCallback = new BouncerExpansionCallback() { @Override public void onFullyShown() { + boolean shouldWakeup = true; + for (StackTraceElement e : Thread.currentThread().getStackTrace()) { + if ("handleShow".equals(e.getMethodName())) { + shouldWakeup = false; + break; + } + } updateStates(); - mStatusBar.wakeUpIfDozing(SystemClock.uptimeMillis(), - mStatusBar.getBouncerContainer(), "BOUNCER_VISIBLE"); + if (shouldWakeup) { + mStatusBar.wakeUpIfDozing(SystemClock.uptimeMillis(), + mStatusBar.getBouncerContainer(), "BOUNCER_VISIBLE"); + } } @Override -- cgit v1.2.3