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
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
@@ -191,6 +193,34 @@ public class BiometricsUnlockControllerTest extends SysuiTestCase {
|
||||
verify(mStatusBarKeyguardViewManager).notifyKeyguardAuthenticated(eq(false));
|
||||
}
|
||||
|
||||
@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);
|
||||
|
||||
Reference in New Issue
Block a user