Do not animate padlock when fp
Do not animate the padlock opening when unlocking with fingerprint, the animation duration is too long, and overlaps with the activity transition. Fixes: 161656850 Test: manual, on crosshatch Test: atest BiometricsUnlockControllerTest Change-Id: If99d5b20d0f69491d38cfdbc21dfa8d2fe2d0edb Merged-In: If99d5b20d0f69491d38cfdbc21dfa8d2fe2d0edb
This commit is contained in:
@@ -152,6 +152,7 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback imp
|
|||||||
private final Context mContext;
|
private final Context mContext;
|
||||||
private final int mWakeUpDelay;
|
private final int mWakeUpDelay;
|
||||||
private int mMode;
|
private int mMode;
|
||||||
|
private BiometricSourceType mBiometricType;
|
||||||
private KeyguardViewController mKeyguardViewController;
|
private KeyguardViewController mKeyguardViewController;
|
||||||
private DozeScrimController mDozeScrimController;
|
private DozeScrimController mDozeScrimController;
|
||||||
private KeyguardViewMediator mKeyguardViewMediator;
|
private KeyguardViewMediator mKeyguardViewMediator;
|
||||||
@@ -340,6 +341,7 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback imp
|
|||||||
Trace.endSection();
|
Trace.endSection();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
mBiometricType = biometricSourceType;
|
||||||
mMetricsLogger.write(new LogMaker(MetricsEvent.BIOMETRIC_AUTH)
|
mMetricsLogger.write(new LogMaker(MetricsEvent.BIOMETRIC_AUTH)
|
||||||
.setType(MetricsEvent.TYPE_SUCCESS).setSubtype(toSubtype(biometricSourceType)));
|
.setType(MetricsEvent.TYPE_SUCCESS).setSubtype(toSubtype(biometricSourceType)));
|
||||||
Optional.ofNullable(BiometricUiEvent.SUCCESS_EVENT_BY_SOURCE_TYPE.get(biometricSourceType))
|
Optional.ofNullable(BiometricUiEvent.SUCCESS_EVENT_BY_SOURCE_TYPE.get(biometricSourceType))
|
||||||
@@ -615,6 +617,7 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback imp
|
|||||||
|
|
||||||
private void resetMode() {
|
private void resetMode() {
|
||||||
mMode = MODE_NONE;
|
mMode = MODE_NONE;
|
||||||
|
mBiometricType = null;
|
||||||
mNotificationShadeWindowController.setForceDozeBrightness(false);
|
mNotificationShadeWindowController.setForceDozeBrightness(false);
|
||||||
if (mStatusBar.getNavigationBarView() != null) {
|
if (mStatusBar.getNavigationBarView() != null) {
|
||||||
mStatusBar.getNavigationBarView().setWakeAndUnlocking(false);
|
mStatusBar.getNavigationBarView().setWakeAndUnlocking(false);
|
||||||
@@ -680,8 +683,8 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback imp
|
|||||||
/**
|
/**
|
||||||
* Successful authentication with fingerprint, face, or iris when the lockscreen fades away
|
* Successful authentication with fingerprint, face, or iris when the lockscreen fades away
|
||||||
*/
|
*/
|
||||||
public boolean isUnlockFading() {
|
public BiometricSourceType getBiometricType() {
|
||||||
return mMode == MODE_UNLOCK_FADING;
|
return mBiometricType;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ public class LockscreenLockIconController {
|
|||||||
private boolean mWakeAndUnlockRunning;
|
private boolean mWakeAndUnlockRunning;
|
||||||
private boolean mShowingLaunchAffordance;
|
private boolean mShowingLaunchAffordance;
|
||||||
private boolean mBouncerShowingScrimmed;
|
private boolean mBouncerShowingScrimmed;
|
||||||
|
private boolean mFingerprintUnlock;
|
||||||
private int mStatusBarState = StatusBarState.SHADE;
|
private int mStatusBarState = StatusBarState.SHADE;
|
||||||
private LockIcon mLockIcon;
|
private LockIcon mLockIcon;
|
||||||
|
|
||||||
@@ -389,14 +390,19 @@ public class LockscreenLockIconController {
|
|||||||
/**
|
/**
|
||||||
* We need to hide the lock whenever there's a fingerprint unlock, otherwise you'll see the
|
* We need to hide the lock whenever there's a fingerprint unlock, otherwise you'll see the
|
||||||
* icon on top of the black front scrim.
|
* icon on top of the black front scrim.
|
||||||
|
* We also want to halt padlock the animation when we're in face bypass mode or dismissing the
|
||||||
|
* keyguard with fingerprint.
|
||||||
* @param wakeAndUnlock are we wake and unlocking
|
* @param wakeAndUnlock are we wake and unlocking
|
||||||
* @param isUnlock are we currently unlocking
|
* @param isUnlock are we currently unlocking
|
||||||
*/
|
*/
|
||||||
public void onBiometricAuthModeChanged(boolean wakeAndUnlock, boolean isUnlock) {
|
public void onBiometricAuthModeChanged(boolean wakeAndUnlock, boolean isUnlock,
|
||||||
|
BiometricSourceType type) {
|
||||||
if (wakeAndUnlock) {
|
if (wakeAndUnlock) {
|
||||||
mWakeAndUnlockRunning = true;
|
mWakeAndUnlockRunning = true;
|
||||||
}
|
}
|
||||||
if (isUnlock && mKeyguardBypassController.getBypassEnabled() && canBlockUpdates()) {
|
mFingerprintUnlock = type == BiometricSourceType.FINGERPRINT;
|
||||||
|
if (isUnlock && (mFingerprintUnlock || mKeyguardBypassController.getBypassEnabled())
|
||||||
|
&& canBlockUpdates()) {
|
||||||
// We don't want the icon to change while we are unlocking
|
// We don't want the icon to change while we are unlocking
|
||||||
mBlockUpdates = true;
|
mBlockUpdates = true;
|
||||||
}
|
}
|
||||||
@@ -513,10 +519,13 @@ public class LockscreenLockIconController {
|
|||||||
&& (!mStatusBarStateController.isPulsing() || mDocked);
|
&& (!mStatusBarStateController.isPulsing() || mDocked);
|
||||||
boolean invisible = onAodNotPulsingOrDocked || mWakeAndUnlockRunning
|
boolean invisible = onAodNotPulsingOrDocked || mWakeAndUnlockRunning
|
||||||
|| mShowingLaunchAffordance;
|
|| mShowingLaunchAffordance;
|
||||||
if (mKeyguardBypassController.getBypassEnabled() && !mBouncerShowingScrimmed) {
|
boolean fingerprintOrBypass = mFingerprintUnlock
|
||||||
|
|| mKeyguardBypassController.getBypassEnabled();
|
||||||
|
if (fingerprintOrBypass && !mBouncerShowingScrimmed) {
|
||||||
if ((mHeadsUpManagerPhone.isHeadsUpGoingAway()
|
if ((mHeadsUpManagerPhone.isHeadsUpGoingAway()
|
||||||
|| mHeadsUpManagerPhone.hasPinnedHeadsUp()
|
|| mHeadsUpManagerPhone.hasPinnedHeadsUp()
|
||||||
|| mStatusBarState == StatusBarState.KEYGUARD)
|
|| mStatusBarState == StatusBarState.KEYGUARD
|
||||||
|
|| mStatusBarState == StatusBarState.SHADE)
|
||||||
&& !mNotificationWakeUpCoordinator.getNotificationsFullyHidden()) {
|
&& !mNotificationWakeUpCoordinator.getNotificationsFullyHidden()) {
|
||||||
invisible = true;
|
invisible = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3969,7 +3969,8 @@ public class StatusBar extends SystemUI implements DemoMode,
|
|||||||
updateScrimController();
|
updateScrimController();
|
||||||
mLockscreenLockIconController.onBiometricAuthModeChanged(
|
mLockscreenLockIconController.onBiometricAuthModeChanged(
|
||||||
mBiometricUnlockController.isWakeAndUnlock(),
|
mBiometricUnlockController.isWakeAndUnlock(),
|
||||||
mBiometricUnlockController.isBiometricUnlock());
|
mBiometricUnlockController.isBiometricUnlock(),
|
||||||
|
mBiometricUnlockController.getBiometricType());
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
|
|||||||
@@ -136,6 +136,8 @@ public class BiometricsUnlockControllerTest extends SysuiTestCase {
|
|||||||
anyFloat());
|
anyFloat());
|
||||||
assertThat(mBiometricUnlockController.getMode())
|
assertThat(mBiometricUnlockController.getMode())
|
||||||
.isEqualTo(BiometricUnlockController.MODE_SHOW_BOUNCER);
|
.isEqualTo(BiometricUnlockController.MODE_SHOW_BOUNCER);
|
||||||
|
assertThat(mBiometricUnlockController.getBiometricType())
|
||||||
|
.isEqualTo(BiometricSourceType.FINGERPRINT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -268,6 +270,8 @@ public class BiometricsUnlockControllerTest extends SysuiTestCase {
|
|||||||
verify(mStatusBarKeyguardViewManager).notifyKeyguardAuthenticated(eq(false));
|
verify(mStatusBarKeyguardViewManager).notifyKeyguardAuthenticated(eq(false));
|
||||||
assertThat(mBiometricUnlockController.getMode())
|
assertThat(mBiometricUnlockController.getMode())
|
||||||
.isEqualTo(BiometricUnlockController.MODE_DISMISS_BOUNCER);
|
.isEqualTo(BiometricUnlockController.MODE_DISMISS_BOUNCER);
|
||||||
|
assertThat(mBiometricUnlockController.getBiometricType())
|
||||||
|
.isEqualTo(BiometricSourceType.FACE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
Reference in New Issue
Block a user