From 59adb290ee622f6c0de339242b4063e23d4ecce8 Mon Sep 17 00:00:00 2001 From: Chandru Date: Tue, 13 Sep 2022 13:41:32 +0000 Subject: [PATCH] Do not delay bouncer for running face auth if face unlock is locked out. Test: atest KeyguardBouncerTest Bug: 244402839 Change-Id: Ie46f327dcac3ee0acfed9e91c37f9c2c1e0bc87c --- .../systemui/statusbar/phone/KeyguardBouncer.java | 1 + .../systemui/statusbar/phone/KeyguardBouncerTest.java | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java index 0001cd0a2798d..d380e9f03720c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java @@ -220,6 +220,7 @@ public class KeyguardBouncer { && !mKeyguardUpdateMonitor.getCachedIsUnlockWithFingerprintPossible( KeyguardUpdateMonitor.getCurrentUser()) && !needsFullscreenBouncer() + && !mKeyguardUpdateMonitor.isFaceLockedOut() && !mKeyguardUpdateMonitor.userNeedsStrongAuth() && !mKeyguardBypassController.getBypassEnabled()) { mHandler.postDelayed(mShowRunnable, BOUNCER_FACE_DELAY); diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBouncerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBouncerTest.java index 60a3d95e24f6c..ab209d130b2fe 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBouncerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBouncerTest.java @@ -408,6 +408,16 @@ public class KeyguardBouncerTest extends SysuiTestCase { mBouncer.hide(false /* destroyView */); verify(mHandler).removeCallbacks(eq(showRunnable.getValue())); } + + @Test + public void testShow_doesNotDelaysIfFaceAuthIsLockedOut() { + when(mKeyguardStateController.isFaceAuthEnabled()).thenReturn(true); + when(mKeyguardUpdateMonitor.isFaceLockedOut()).thenReturn(true); + mBouncer.show(true /* reset */); + + verify(mHandler, never()).postDelayed(any(), anyLong()); + } + @Test public void testShow_delaysIfFaceAuthIsRunning_unlessBypassEnabled() { when(mKeyguardStateController.isFaceAuthEnabled()).thenReturn(true);