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 3f6144eb6f815..fdf18e0c79121 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/BiometricUnlockController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/BiometricUnlockController.java @@ -83,16 +83,10 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback { */ public static final int MODE_UNLOCK = 5; - /** - * Mode in which fingerprint brings up the bouncer because fingerprint unlocking is currently - * not allowed. - */ - public static final int MODE_DISMISS_BOUNCER = 6; - /** * Mode in which fingerprint wakes and unlocks the device from a dream. */ - public static final int MODE_WAKE_AND_UNLOCK_FROM_DREAM = 7; + public static final int MODE_WAKE_AND_UNLOCK_FROM_DREAM = 6; /** * How much faster we collapse the lockscreen when authenticating with biometric. @@ -283,15 +277,18 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback { wakeUp.run(); } switch (mMode) { - case MODE_DISMISS_BOUNCER: - Trace.beginSection("MODE_DISMISS"); - mStatusBarKeyguardViewManager.notifyKeyguardAuthenticated( - false /* strongAuth */); + case MODE_UNLOCK: + Trace.beginSection("MODE_UNLOCK"); + if (!wasDeviceInteractive) { + mPendingShowBouncer = true; + } else { + mStatusBarKeyguardViewManager.notifyKeyguardAuthenticated( + false /* strongAuth */); + } Trace.endSection(); break; - case MODE_UNLOCK: case MODE_SHOW_BOUNCER: - Trace.beginSection("MODE_UNLOCK or MODE_SHOW_BOUNCER"); + Trace.beginSection("MODE_SHOW_BOUNCER"); if (!wasDeviceInteractive) { mPendingShowBouncer = true; } else { @@ -381,6 +378,8 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback { if (!mStatusBarKeyguardViewManager.isShowing()) { return MODE_ONLY_WAKE; } else if (mDozeScrimController.isPulsing() && unlockingAllowed) { + // Let's not wake-up to lock screen when not bypassing, otherwise the notification + // would move as the user tried to tap it. return faceStayingOnKeyguard ? MODE_NONE : MODE_WAKE_AND_UNLOCK_PULSING; } else if (!face && (unlockingAllowed || !mUnlockMethodCache.isMethodSecure())) { return MODE_WAKE_AND_UNLOCK; @@ -388,9 +387,15 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback { if (!(mDozeScrimController.isPulsing() && !unlockingAllowed)) { Log.wtf(TAG, "Face somehow arrived when the device was not interactive"); } - // We could theoretically return MODE_NONE, but this means that the device - // would be not interactive, unlocked, and the user would not see the device state. - return MODE_ONLY_WAKE; + if (faceStayingOnKeyguard) { + // We could theoretically return MODE_NONE, but this means that the device + // would be not interactive, unlocked, and the user would not see the device + // state. + return MODE_ONLY_WAKE; + } else { + // Wake-up fading out nicely + return MODE_WAKE_AND_UNLOCK_PULSING; + } } else { return MODE_SHOW_BOUNCER; } @@ -399,10 +404,9 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback { return MODE_WAKE_AND_UNLOCK_FROM_DREAM; } if (mStatusBarKeyguardViewManager.isShowing()) { - if ((mStatusBarKeyguardViewManager.isBouncerShowing() - || mStatusBarKeyguardViewManager.isBouncerPartiallyVisible()) + if ((mStatusBarKeyguardViewManager.isBouncerShowing()) && unlockingAllowed) { - return MODE_DISMISS_BOUNCER; + return MODE_UNLOCK; } else if (unlockingAllowed) { return faceStayingOnKeyguard ? MODE_ONLY_WAKE : MODE_UNLOCK; } else if (face) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java index f5d058c32f0ba..4b198dac8145a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java @@ -345,11 +345,6 @@ public class KeyguardBouncer { && mExpansion == EXPANSION_VISIBLE && !isAnimatingAway(); } - public boolean isPartiallyVisible() { - return (mShowingSoon || (mRoot != null && mRoot.getVisibility() == View.VISIBLE)) - && mExpansion != EXPANSION_HIDDEN && !isAnimatingAway(); - } - /** * @return {@code true} when bouncer's pre-hide animation already started but isn't completely * hidden yet, {@code false} otherwise. diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java index 103a7c0dbd6d3..c0882ab17188f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java @@ -452,7 +452,8 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange private int getState() { KeyguardUpdateMonitor updateMonitor = KeyguardUpdateMonitor.getInstance(mContext); - if ((mUnlockMethodCache.canSkipBouncer() || !mKeyguardShowing) && !mSimLocked) { + if ((mUnlockMethodCache.canSkipBouncer() || !mKeyguardShowing + || mKeyguardMonitor.isKeyguardGoingAway()) && !mSimLocked) { return STATE_LOCK_OPEN; } else if (mTransientBiometricsError) { return STATE_BIOMETRICS_ERROR; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java index 93168db861be3..834d1fc24f90d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java @@ -677,10 +677,6 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb return mBouncer.isShowing(); } - public boolean isBouncerPartiallyVisible() { - return mBouncer.isPartiallyVisible(); - } - public boolean isFullscreenBouncer() { return mBouncer.isFullscreenBouncer(); } 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 3d49d58b4202b..4e86f194c0cf3 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 @@ -120,7 +120,7 @@ public class BiometricsUnlockControllerTest extends SysuiTestCase { BiometricSourceType.FINGERPRINT); verify(mStatusBarKeyguardViewManager, never()).showBouncer(anyBoolean()); - verify(mStatusBarKeyguardViewManager).animateCollapsePanels(anyFloat()); + verify(mStatusBarKeyguardViewManager).notifyKeyguardAuthenticated(eq(false)); } @Test @@ -151,7 +151,7 @@ public class BiometricsUnlockControllerTest extends SysuiTestCase { mBiometricUnlockController.onBiometricAuthenticated(UserHandle.USER_CURRENT, BiometricSourceType.FACE); - verify(mStatusBarKeyguardViewManager).animateCollapsePanels(anyFloat()); + verify(mStatusBarKeyguardViewManager).notifyKeyguardAuthenticated(eq(false)); } @Test