diff options
| author | 2019-07-16 13:46:25 -0700 | |
|---|---|---|
| committer | 2019-07-16 14:21:42 -0700 | |
| commit | a055a671dfeb46b19f080e96cc3de3afbc5686c9 (patch) | |
| tree | 9300c1c5c26299f3ffe7dc8c1727ca7292c01624 | |
| parent | 60d8434884f7f1b7bd78a75f901b13e5bbc55f78 (diff) | |
Dismiss bouncer properly on SHADE_LOCKED
Test: atest BiometricsUnlockControllerTest
Test: dismiss bouncer after hitting reply button
Test: hit back on bouncer on shade_locked
Test: tap on padlock on camera app, swipe up to retry
Bug: 134096479
Fixes: 137517676
Change-Id: I12e5bbd2c5ceac642a281fc16c5398e09e65ca9d
2 files changed, 35 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/BiometricUnlockController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/BiometricUnlockController.java index ea25ca89c883..6a0d6e1954ab 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/BiometricUnlockController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/BiometricUnlockController.java @@ -467,8 +467,11 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback { } if (mStatusBarKeyguardViewManager.isShowing()) { if (mStatusBarKeyguardViewManager.bouncerIsOrWillBeShowing() && unlockingAllowed) { - return bypass && !mKeyguardBypassController.canPlaySubtleWindowAnimations() - ? MODE_UNLOCK_COLLAPSING : MODE_UNLOCK_FADING; + if (bypass && mKeyguardBypassController.canPlaySubtleWindowAnimations()) { + return MODE_UNLOCK_FADING; + } else { + return MODE_DISMISS_BOUNCER; + } } else if (unlockingAllowed) { return bypass ? MODE_UNLOCK_FADING : MODE_NONE; } else { diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/BiometricsUnlockControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/BiometricsUnlockControllerTest.java index a99dc7fb6924..7d9920db36a4 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/BiometricsUnlockControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/BiometricsUnlockControllerTest.java @@ -16,6 +16,8 @@ package com.android.systemui.statusbar.phone; +import static com.google.common.truth.Truth.assertThat; + import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.ArgumentMatchers.anyFloat; @@ -192,6 +194,34 @@ public class BiometricsUnlockControllerTest extends SysuiTestCase { } @Test + public void onBiometricAuthenticated_whenBypassOnBouncer_dismissBouncer() { + reset(mKeyguardBypassController); + when(mUpdateMonitor.isUnlockingWithBiometricAllowed()).thenReturn(true); + when(mKeyguardBypassController.getBypassEnabled()).thenReturn(true); + when(mKeyguardBypassController.onBiometricAuthenticated(any())).thenReturn(true); + when(mStatusBarKeyguardViewManager.bouncerIsOrWillBeShowing()).thenReturn(true); + mBiometricUnlockController.onBiometricAuthenticated(UserHandle.USER_CURRENT, + BiometricSourceType.FACE); + + verify(mStatusBarKeyguardViewManager).notifyKeyguardAuthenticated(eq(false)); + assertThat(mBiometricUnlockController.getMode()) + .isEqualTo(BiometricUnlockController.MODE_DISMISS_BOUNCER); + } + + @Test + public void onBiometricAuthenticated_whenBypassOnBouncer_respectsCanPlaySubtleAnim() { + when(mUpdateMonitor.isUnlockingWithBiometricAllowed()).thenReturn(true); + when(mKeyguardBypassController.getBypassEnabled()).thenReturn(true); + when(mStatusBarKeyguardViewManager.bouncerIsOrWillBeShowing()).thenReturn(true); + mBiometricUnlockController.onBiometricAuthenticated(UserHandle.USER_CURRENT, + BiometricSourceType.FACE); + + verify(mStatusBarKeyguardViewManager).notifyKeyguardAuthenticated(eq(false)); + assertThat(mBiometricUnlockController.getMode()) + .isEqualTo(BiometricUnlockController.MODE_UNLOCK_FADING); + } + + @Test public void onBiometricAuthenticated_whenFaceAndPulsing_dontDismissKeyguard() { reset(mUpdateMonitor); reset(mStatusBarKeyguardViewManager); |