diff options
| author | 2021-05-13 15:42:03 -0400 | |
|---|---|---|
| committer | 2021-05-13 15:46:39 -0400 | |
| commit | 8bfe50aa801b854168239c6c86d4e47880c4314c (patch) | |
| tree | d096c903446c45a5bd8645a622e81f8418ed7a1b | |
| parent | c9a8383c2204a21ee5d9bb7b4a2d6f2462b23322 (diff) | |
Immediately trigger face-auth on udfps bouncer
Test: manual
Fixes: 186594021
Change-Id: Idff7de4e40c9d133a1aad4b01935580a614f4859
4 files changed, 23 insertions, 6 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java index 64bc77f3f03f..4523fee045f6 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java @@ -2199,7 +2199,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab && !mSwitchingUser && !isFaceDisabled(user) && becauseCannotSkipBouncer && !mKeyguardGoingAway && mBiometricEnabledForUser.get(user) && !mLockIconPressed && strongAuthAllowsScanning && mIsPrimaryUser - && !mSecureCameraLaunched; + && (!mSecureCameraLaunched || mOccludingAppRequestingFace); // Aggregate relevant fields for debug logging. if (DEBUG_FACE || DEBUG_SPEW) { diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardView.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardView.java index 52576a7cd4e3..804e2ab00bde 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardView.java +++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardView.java @@ -148,7 +148,7 @@ public class UdfpsKeyguardView extends UdfpsAnimationView { /** * Animates in the bg protection circle behind the fp icon to highlight the icon. */ - void animateUdfpsBouncer() { + void animateUdfpsBouncer(Runnable onEndAnimation) { if (mBgProtection.getVisibility() == View.VISIBLE && mBgProtection.getAlpha() == 1f) { // already fully highlighted, don't re-animate return; @@ -186,6 +186,14 @@ public class UdfpsKeyguardView extends UdfpsAnimationView { ObjectAnimator.ofFloat(mBgProtection, View.SCALE_X, 0f, 1f), ObjectAnimator.ofFloat(mBgProtection, View.SCALE_Y, 0f, 1f), fpIconAnim); + mAnimatorSet.addListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationEnd(Animator animation) { + if (onEndAnimation != null) { + onEndAnimation.run(); + } + } + }); mAnimatorSet.start(); } diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardViewController.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardViewController.java index a0ac2dc7289e..2f9f6bc39c54 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardViewController.java +++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardViewController.java @@ -129,6 +129,7 @@ public class UdfpsKeyguardViewController extends UdfpsAnimationViewController<Ud mStatusBarStateController.removeCallback(mStateListener); mKeyguardViewManager.setAlternateAuthInterceptor(null); mTransitioningFromHome = false; + mKeyguardUpdateMonitor.requestFaceAuthOnOccludingApp(false); if (mCancelRunnable != null) { mCancelRunnable.run(); @@ -165,11 +166,13 @@ public class UdfpsKeyguardViewController extends UdfpsAnimationViewController<Ud mShowingUdfpsBouncer = show; updatePauseAuth(); if (mShowingUdfpsBouncer) { - mView.animateUdfpsBouncer(); + mView.animateUdfpsBouncer(() -> + mKeyguardUpdateMonitor.requestFaceAuthOnOccludingApp(true)); mView.announceForAccessibility(mView.getContext().getString( R.string.accessibility_fingerprint_bouncer)); } else { mView.animateAwayUdfpsBouncer(null); + mKeyguardUpdateMonitor.requestFaceAuthOnOccludingApp(false); } return true; } 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 16863f60c6a3..20e6f60c9b17 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/BiometricUnlockController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/BiometricUnlockController.java @@ -114,7 +114,8 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback imp public static final int MODE_ONLY_WAKE = 4; /** - * Mode in which fingerprint unlocks the device. + * Mode in which fingerprint unlocks the device or passive auth (ie face auth) unlocks the + * device while being requested when keyguard is occluded. */ public static final int MODE_UNLOCK_COLLAPSING = 5; @@ -355,8 +356,10 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback imp Optional.ofNullable(BiometricUiEvent.SUCCESS_EVENT_BY_SOURCE_TYPE.get(biometricSourceType)) .ifPresent(UI_EVENT_LOGGER::log); - boolean unlockAllowed = mKeyguardBypassController.onBiometricAuthenticated( - biometricSourceType, isStrongBiometric); + boolean unlockAllowed = + mKeyguardStateController.isOccluded() + || mKeyguardBypassController.onBiometricAuthenticated( + biometricSourceType, isStrongBiometric); if (unlockAllowed) { mKeyguardViewMediator.userActivity(); startWakeAndUnlock(biometricSourceType, isStrongBiometric); @@ -581,6 +584,9 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback imp if (unlockingAllowed && deviceDreaming) { return bypass ? MODE_WAKE_AND_UNLOCK_FROM_DREAM : MODE_ONLY_WAKE; } + if (unlockingAllowed && mKeyguardStateController.isOccluded()) { + return MODE_UNLOCK_COLLAPSING; + } if (mKeyguardViewController.isShowing()) { if (mKeyguardViewController.bouncerIsOrWillBeShowing() && unlockingAllowed) { if (bypass && mKeyguardBypassController.canPlaySubtleWindowAnimations()) { |