From 181b2c1706314ba971292203ccb8f3c824787eb6 Mon Sep 17 00:00:00 2001 From: Beverly Date: Mon, 16 May 2022 18:30:05 +0000 Subject: [PATCH] Don't delay bouncer if face + fp enrolled Only delay the bouncer if face is the only biometric enrolled and face auth is set to non-bypass. Test: manual Test: atest KeyguardBouncerTest Fixes: 232798977 Change-Id: I63b36a9b37769765fdb5837894feb5cb135ed83a --- .../systemui/statusbar/phone/KeyguardBouncer.java | 9 ++++++--- .../statusbar/phone/KeyguardBouncerTest.java | 13 +++++++++++-- 2 files changed, 17 insertions(+), 5 deletions(-) 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 8792118fb9ef2..918d6bf93151f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java @@ -216,9 +216,12 @@ public class KeyguardBouncer { // Split up the work over multiple frames. DejankUtils.removeCallbacks(mResetRunnable); - if (mKeyguardStateController.isFaceAuthEnabled() && !needsFullscreenBouncer() - && !mKeyguardUpdateMonitor.userNeedsStrongAuth() - && !mKeyguardBypassController.getBypassEnabled()) { + if (mKeyguardStateController.isFaceAuthEnabled() + && !mKeyguardUpdateMonitor.getCachedIsUnlockWithFingerprintPossible( + KeyguardUpdateMonitor.getCurrentUser()) + && !needsFullscreenBouncer() + && !mKeyguardUpdateMonitor.userNeedsStrongAuth() + && !mKeyguardBypassController.getBypassEnabled()) { mHandler.postDelayed(mShowRunnable, BOUNCER_FACE_DELAY); } else { DejankUtils.postAfterTraversal(mShowRunnable); 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 9c02216722e2b..39021d8732d37 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 @@ -399,9 +399,8 @@ public class KeyguardBouncerTest extends SysuiTestCase { mBouncer.hide(false /* destroyView */); verify(mHandler).removeCallbacks(eq(showRunnable.getValue())); } - @Test - public void testShow_delaysIfFaceAuthIsRunning_unlessBypass() { + public void testShow_delaysIfFaceAuthIsRunning_unlessBypassEnabled() { when(mKeyguardStateController.isFaceAuthEnabled()).thenReturn(true); when(mKeyguardBypassController.getBypassEnabled()).thenReturn(true); mBouncer.show(true /* reset */); @@ -409,6 +408,16 @@ public class KeyguardBouncerTest extends SysuiTestCase { verify(mHandler, never()).postDelayed(any(), anyLong()); } + @Test + public void testShow_delaysIfFaceAuthIsRunning_unlessFingerprintEnrolled() { + when(mKeyguardStateController.isFaceAuthEnabled()).thenReturn(true); + when(mKeyguardUpdateMonitor.getCachedIsUnlockWithFingerprintPossible(0)) + .thenReturn(true); + mBouncer.show(true /* reset */); + + verify(mHandler, never()).postDelayed(any(), anyLong()); + } + @Test public void testRegisterUpdateMonitorCallback() { verify(mKeyguardUpdateMonitor).registerCallback(any());