diff options
| author | 2019-05-10 16:23:04 -0700 | |
|---|---|---|
| committer | 2019-05-13 18:53:21 +0000 | |
| commit | 71f3804a75c40e34a49145cdbc5f132870b1c56f (patch) | |
| tree | 99a01430f23477ad04d0e767dcd1150ab5610dcf | |
| parent | c560293e154b188f6cb22e7f33e10281131e1edd (diff) | |
Hide lock icon while WAKE_AND_UNLOCK is happening.
The lock icon is on top of the front scrim, otherwise it wouldn't be visible on a
scrimmed bouncer (activities occluding the keyguard.)
Because of this, the black layer the covers most of the lock screen won't cover the
icon animation. We need to ensure that the icon is invisible while the biometric
unlock animation is running, and only unblock it after the keyguard has finished
fading away.
Test: manually unlock with fingerprint from AOD and LS
Test: press power while unlocking
Fixes: 132198859
Change-Id: Ied501586abe05dc333e4d76e4c045f32070595a7
4 files changed, 40 insertions, 2 deletions
diff --git a/packages/SystemUI/res/layout/super_status_bar.xml b/packages/SystemUI/res/layout/super_status_bar.xml index 4cf5f850285e..a91493003bb5 100644 --- a/packages/SystemUI/res/layout/super_status_bar.xml +++ b/packages/SystemUI/res/layout/super_status_bar.xml @@ -69,7 +69,7 @@ android:layout_height="match_parent" android:importantForAccessibility="no" sysui:ignoreRightInset="true" - /> + /> <LinearLayout android:id="@+id/lock_icon_container" 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 1074f3af6b1d..3450a8a8ebfb 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java @@ -89,6 +89,7 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange private float mDozeAmount; private int mIconRes; private boolean mWasPulsingOnThisFrame; + private boolean mWakeAndUnlockRunning; private final Runnable mDrawOffTimeout = () -> update(true /* forceUpdate */); private final DockManager.DockEventListener mDockEventListener = @@ -277,7 +278,8 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange mLastBouncerVisible = mBouncerVisible; } - boolean invisible = mDozing && (!mPulsing || mDocked); + boolean onAodNotPulsingOrDocked = mDozing && (!mPulsing || mDocked); + boolean invisible = onAodNotPulsingOrDocked || mWakeAndUnlockRunning; setVisibility(invisible ? INVISIBLE : VISIBLE); updateClickability(); } @@ -450,4 +452,23 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange public void onUnlockMethodStateChanged() { update(); } + + /** + * 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. + */ + public void onBiometricAuthModeChanged(boolean wakeAndUnlock) { + if (wakeAndUnlock) { + mWakeAndUnlockRunning = true; + } + update(); + } + + /** + * Triggered after the unlock animation is over and the user is looking at launcher. + */ + public void onKeyguardFadedAway() { + mWakeAndUnlockRunning = false; + update(); + } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java index c01367a4d213..1d217bf0f685 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java @@ -527,6 +527,7 @@ public class StatusBar extends SystemUI implements DemoMode, } if (mKeyguardMonitor.isKeyguardFadingAway()) { mStatusBarKeyguardViewManager.onKeyguardFadedAway(); + mStatusBarWindow.onKeyguardFadedAway(); } } @@ -3791,6 +3792,7 @@ public class StatusBar extends SystemUI implements DemoMode, public void notifyBiometricAuthModeChanged() { updateDozing(); updateScrimController(); + mStatusBarWindow.onBiometricAuthModeChanged(mBiometricUnlockController.isWakeAndUnlock()); } @VisibleForTesting diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java index 6185b4c5cff7..cebb8723de51 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java @@ -265,6 +265,21 @@ public class StatusBarWindowView extends FrameLayout { mLockIcon.setPulsing(pulsing); } + /** + * Called when the biometric authentication mode changes. + * @param wakeAndUnlock If the type is {@link BiometricUnlockController#isWakeAndUnlock()} + */ + public void onBiometricAuthModeChanged(boolean wakeAndUnlock) { + mLockIcon.onBiometricAuthModeChanged(wakeAndUnlock); + } + + /** + * Called after finished unlocking and the status bar window is already collapsed. + */ + public void onKeyguardFadedAway() { + mLockIcon.onKeyguardFadedAway(); + } + public void setStatusBarView(PhoneStatusBarView statusBarView) { mStatusBarView = statusBarView; } |