From 5dcdec7eb24997d2b6a09fc11c779167b458a071 Mon Sep 17 00:00:00 2001 From: Dave Mankoff Date: Fri, 24 Apr 2020 15:58:17 -0400 Subject: [PATCH] Fix lock icon animation for bio-auth. 1) Ensure lock icon animates when using biometric authentication to unlock a device. 2) Don't animate the lock twice. Accomplished by waiting to clear the biometric authentication credentials until after we've started the keyguard dismiss animation. When we cleared them before the animation, the keyguard would be left in an inconsistent state where it would be non-dismissable but also not-yet animating away, meaning the keyguard appeared locked to the rest of the codebase. Fixes: 153117689 Test: atest SystemUITests && manual Change-Id: I8c2390e5f3ca2d366d377f6da5822f24ca311c2f Merged-In: I8c2390e5f3ca2d366d377f6da5822f24ca311c2f --- .../com/android/systemui/keyguard/KeyguardViewMediator.java | 3 ++- .../src/com/android/systemui/statusbar/phone/LockIcon.java | 2 +- .../statusbar/phone/LockscreenLockIconController.java | 6 ++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index 1012a5213a58b..b26dc5f912454 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -1717,9 +1717,9 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable { resetKeyguardDonePendingLocked(); } - mUpdateMonitor.clearBiometricRecognized(); if (mGoingToSleep) { + mUpdateMonitor.clearBiometricRecognized(); Log.i(TAG, "Device is going to sleep, aborting keyguardDone"); return; } @@ -1740,6 +1740,7 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable { } handleHide(); + mUpdateMonitor.clearBiometricRecognized(); Trace.endSection(); } 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 a19d35ac4e819..ec54b302b055f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java @@ -65,7 +65,6 @@ public class LockIcon extends KeyguardAffordanceView { mPredrawRegistered = false; int newState = mState; - mOldState = mState; Drawable icon = getIcon(newState); setImageDrawable(icon, false); @@ -135,6 +134,7 @@ public class LockIcon extends KeyguardAffordanceView { } void update(int newState, boolean pulsing, boolean dozing, boolean keyguardJustShown) { + mOldState = mState; mState = newState; mPulsing = pulsing; mDozing = dozing; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockscreenLockIconController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockscreenLockIconController.java index a633e1979bad0..a2e7306d49315 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockscreenLockIconController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockscreenLockIconController.java @@ -470,8 +470,10 @@ public class LockscreenLockIconController { } private int getState() { - if ((mKeyguardStateController.canDismissLockScreen() || !mKeyguardShowing - || mKeyguardStateController.isKeyguardGoingAway()) && !mSimLocked) { + if ((mKeyguardStateController.canDismissLockScreen() + || !mKeyguardStateController.isShowing() + || mKeyguardStateController.isKeyguardGoingAway() + || mKeyguardStateController.isKeyguardFadingAway()) && !mSimLocked) { return STATE_LOCK_OPEN; } else if (mTransientBiometricsError) { return STATE_BIOMETRICS_ERROR;