From 929c8cdc71e061acbff298bcf542ef577f91e594 Mon Sep 17 00:00:00 2001 From: Beverly Date: Wed, 9 Feb 2022 21:37:39 +0000 Subject: [PATCH] Don't cache mIsUdfpsEnrolled AuthController.isUdfpsEnrolled no longer makes any IPC calls, so we don't need to cache the value in KeyguardUpdateMonitor which can cause the state to be stale. Test: manually check dumpsys on reboot, udfps enrollment state is correct Test: atest SystemUITests Fixes: 218718078 Change-Id: I4f81465743cdea9e8f01b6bfd5637d0ee450c29a --- .../src/com/android/keyguard/KeyguardUpdateMonitor.java | 9 +-------- .../src/com/android/keyguard/LockIconViewController.java | 2 -- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java index 2ef8d6d4d2344..57e8932ba3735 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java @@ -325,8 +325,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab private final InteractionJankMonitor mInteractionJankMonitor; private final LatencyTracker mLatencyTracker; private boolean mLogoutEnabled; - // cached value to avoid IPCs - private boolean mIsUdfpsEnrolled; private boolean mIsFaceEnrolled; // If the user long pressed the lock icon, disabling face auth for the current session. private boolean mLockIconPressed; @@ -2117,10 +2115,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab false, mTimeFormatChangeObserver, UserHandle.USER_ALL); } - private void updateUdfpsEnrolled(int userId) { - mIsUdfpsEnrolled = mAuthController.isUdfpsEnrolled(userId); - } - private void updateFaceEnrolled(int userId) { mIsFaceEnrolled = whitelistIpcs( () -> mFaceManager != null && mFaceManager.isHardwareDetected() @@ -2132,7 +2126,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab * @return true if there's at least one udfps enrolled for the current user. */ public boolean isUdfpsEnrolled() { - return mIsUdfpsEnrolled; + return mAuthController.isUdfpsEnrolled(getCurrentUser()); } /** @@ -2186,7 +2180,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab return; } - updateUdfpsEnrolled(getCurrentUser()); final boolean shouldListenForFingerprint = shouldListenForFingerprint(isUdfpsSupported()); final boolean runningOrRestarting = mFingerprintRunningState == BIOMETRIC_STATE_RUNNING || mFingerprintRunningState == BIOMETRIC_STATE_CANCELLING_RESTARTING; diff --git a/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java b/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java index 80a3a0ebb2503..4ad51835687ff 100644 --- a/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java +++ b/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java @@ -433,7 +433,6 @@ public class LockIconViewController extends ViewController impleme public void onDozingChanged(boolean isDozing) { mIsDozing = isDozing; updateBurnInOffsets(); - updateIsUdfpsEnrolled(); updateVisibility(); } @@ -513,7 +512,6 @@ public class LockIconViewController extends ViewController impleme mKeyguardUpdateMonitor.getUserUnlockedWithBiometric( KeyguardUpdateMonitor.getCurrentUser()); } - updateIsUdfpsEnrolled(); updateVisibility(); }