diff options
author | LibXZR <i@xzr.moe> | 2022-05-13 21:08:48 +0800 |
---|---|---|
committer | alk3pInjection <webmaster@raspii.tech> | 2022-06-29 16:52:50 +0800 |
commit | a00065dfa389ae1862387755d2dae3a960f85048 (patch) | |
tree | 2bc0696726aeec1e996689304876ef91aaffc897 | |
parent | 1062bc589000e7ecde7497f024e7077bc837d47d (diff) |
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 <i@xzr.moe>
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java | 15 |
1 files 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 |