Merge "Run unlock animation when device is already unlocked" into tm-dev am: e16348ebdf
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18674984 Change-Id: If9c46be0bd567a6517f4707f409befe055126703 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -558,6 +558,9 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback imp
|
|||||||
if (!mUpdateMonitor.isDeviceInteractive()) {
|
if (!mUpdateMonitor.isDeviceInteractive()) {
|
||||||
if (!mKeyguardViewController.isShowing()
|
if (!mKeyguardViewController.isShowing()
|
||||||
&& !mScreenOffAnimationController.isKeyguardShowDelayed()) {
|
&& !mScreenOffAnimationController.isKeyguardShowDelayed()) {
|
||||||
|
if (mKeyguardStateController.isUnlocked()) {
|
||||||
|
return MODE_WAKE_AND_UNLOCK;
|
||||||
|
}
|
||||||
return MODE_ONLY_WAKE;
|
return MODE_ONLY_WAKE;
|
||||||
} else if (mDozeScrimController.isPulsing() && unlockingAllowed) {
|
} else if (mDozeScrimController.isPulsing() && unlockingAllowed) {
|
||||||
return MODE_WAKE_AND_UNLOCK_PULSING;
|
return MODE_WAKE_AND_UNLOCK_PULSING;
|
||||||
|
|||||||
@@ -124,6 +124,7 @@ public class BiometricsUnlockControllerTest extends SysuiTestCase {
|
|||||||
when(mStatusBarKeyguardViewManager.isShowing()).thenReturn(true);
|
when(mStatusBarKeyguardViewManager.isShowing()).thenReturn(true);
|
||||||
when(mUpdateMonitor.isDeviceInteractive()).thenReturn(true);
|
when(mUpdateMonitor.isDeviceInteractive()).thenReturn(true);
|
||||||
when(mKeyguardStateController.isFaceAuthEnabled()).thenReturn(true);
|
when(mKeyguardStateController.isFaceAuthEnabled()).thenReturn(true);
|
||||||
|
when(mKeyguardStateController.isUnlocked()).thenReturn(false);
|
||||||
when(mKeyguardBypassController.onBiometricAuthenticated(any(), anyBoolean()))
|
when(mKeyguardBypassController.onBiometricAuthenticated(any(), anyBoolean()))
|
||||||
.thenReturn(true);
|
.thenReturn(true);
|
||||||
when(mAuthController.isUdfpsFingerDown()).thenReturn(false);
|
when(mAuthController.isUdfpsFingerDown()).thenReturn(false);
|
||||||
@@ -185,6 +186,24 @@ public class BiometricsUnlockControllerTest extends SysuiTestCase {
|
|||||||
.isEqualTo(BiometricUnlockController.MODE_WAKE_AND_UNLOCK_PULSING);
|
.isEqualTo(BiometricUnlockController.MODE_WAKE_AND_UNLOCK_PULSING);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void onBiometricAuthenticated_whenDeviceIsAlreadyUnlocked_wakeAndUnlock() {
|
||||||
|
reset(mUpdateMonitor);
|
||||||
|
reset(mStatusBarKeyguardViewManager);
|
||||||
|
when(mStatusBarKeyguardViewManager.isShowing()).thenReturn(false);
|
||||||
|
when(mKeyguardStateController.isUnlocked()).thenReturn(true);
|
||||||
|
when(mUpdateMonitor.isUnlockingWithBiometricAllowed(anyBoolean())).thenReturn(true);
|
||||||
|
when(mDozeScrimController.isPulsing()).thenReturn(false);
|
||||||
|
// the value of isStrongBiometric doesn't matter here since we only care about the returned
|
||||||
|
// value of isUnlockingWithBiometricAllowed()
|
||||||
|
mBiometricUnlockController.onBiometricAuthenticated(UserHandle.USER_CURRENT,
|
||||||
|
BiometricSourceType.FINGERPRINT, true /* isStrongBiometric */);
|
||||||
|
|
||||||
|
verify(mKeyguardViewMediator).onWakeAndUnlocking();
|
||||||
|
assertThat(mBiometricUnlockController.getMode())
|
||||||
|
.isEqualTo(BiometricUnlockController.MODE_WAKE_AND_UNLOCK);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void onBiometricAuthenticated_whenFingerprint_notifyKeyguardAuthenticated() {
|
public void onBiometricAuthenticated_whenFingerprint_notifyKeyguardAuthenticated() {
|
||||||
when(mUpdateMonitor.isUnlockingWithBiometricAllowed(anyBoolean())).thenReturn(true);
|
when(mUpdateMonitor.isUnlockingWithBiometricAllowed(anyBoolean())).thenReturn(true);
|
||||||
|
|||||||
Reference in New Issue
Block a user