Loading packages/SystemUI/src/com/android/keyguard/ActiveUnlockConfig.kt +4 −6 Original line number Diff line number Diff line Loading @@ -318,8 +318,7 @@ class ActiveUnlockConfig @Inject constructor( keyguardUpdateMonitor?.let { val anyFaceEnrolled = it.isFaceEnrolled val anyFingerprintEnrolled = it.getCachedIsUnlockWithFingerprintPossible( val anyFingerprintEnrolled = it.isUnlockWithFingerprintPossible( selectedUserInteractor.getSelectedUserId()) val udfpsEnrolled = it.isUdfpsEnrolled Loading Loading @@ -374,9 +373,8 @@ class ActiveUnlockConfig @Inject constructor( pw.println(" shouldRequestActiveUnlockOnUnlockIntentFromBiometricEnrollment=" + "${shouldRequestActiveUnlockOnUnlockIntentFromBiometricEnrollment()}") pw.println(" faceEnrolled=${it.isFaceEnrolled}") pw.println(" fpEnrolled=${ it.getCachedIsUnlockWithFingerprintPossible( selectedUserInteractor.getSelectedUserId())}") pw.println(" fpUnlockPossible=${ it.isUnlockWithFingerprintPossible(selectedUserInteractor.getSelectedUserId())}") pw.println(" udfpsEnrolled=${it.isUdfpsEnrolled}") } ?: pw.println(" keyguardUpdateMonitor is uninitialized") } Loading packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java +1 −1 Original line number Diff line number Diff line Loading @@ -755,7 +755,7 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard } mView.onResume( mSecurityModel.getSecurityMode(mSelectedUserInteractor.getSelectedUserId()), mKeyguardStateController.isFaceAuthEnabled()); mKeyguardStateController.isFaceEnrolled()); } /** Sets an initial message that would override the default message */ Loading packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +14 −46 Original line number Diff line number Diff line Loading @@ -441,7 +441,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab private int mFaceRunningState = BIOMETRIC_STATE_STOPPED; private boolean mIsDreaming; private boolean mLogoutEnabled; private boolean mIsFaceEnrolled; private int mActiveMobileDataSubscription = SubscriptionManager.INVALID_SUBSCRIPTION_ID; private int mPostureState = DEVICE_POSTURE_UNKNOWN; private FingerprintInteractiveToAuthProvider mFingerprintInteractiveToAuthProvider; Loading Loading @@ -2083,7 +2082,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab private boolean mFingerprintLockedOut; private boolean mFingerprintLockedOutPermanent; private boolean mFaceLockedOutPermanent; private final HashMap<Integer, Boolean> mIsUnlockWithFingerprintPossible = new HashMap<>(); /** * When we receive a {@link android.content.Intent#ACTION_SIM_STATE_CHANGED} broadcast, Loading Loading @@ -2701,16 +2699,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab } } private void updateFaceEnrolled(int userId) { final Boolean isFaceEnrolled = isFaceSupported() && mBiometricEnabledForUser.get(userId) && mAuthController.isFaceAuthEnrolled(userId); if (mIsFaceEnrolled != isFaceEnrolled) { mLogger.logFaceEnrolledUpdated(mIsFaceEnrolled, isFaceEnrolled); } mIsFaceEnrolled = isFaceEnrolled; } private boolean isFaceSupported() { return mFaceManager != null && !mFaceSensorProperties.isEmpty(); } Loading Loading @@ -2749,11 +2737,18 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab return mAuthController.isSfpsSupported(); } /** * @return true if there's at least one face enrolled for the given user. */ public boolean isFaceEnrolled(int userId) { return mAuthController.isFaceAuthEnrolled(userId); } /** * @return true if there's at least one face enrolled */ public boolean isFaceEnrolled() { return mIsFaceEnrolled; return isFaceEnrolled(mSelectedUserInteractor.getSelectedUserId()); } private final UserTracker.Callback mUserChangedCallback = new UserTracker.Callback() { Loading Loading @@ -3442,49 +3437,22 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab } @SuppressLint("MissingPermission") @VisibleForTesting boolean isUnlockWithFingerprintPossible(int userId) { // TODO (b/242022358), make this rely on onEnrollmentChanged event and update it only once. boolean newFpEnrolled = isFingerprintSupported() && !isFingerprintDisabled(userId) && mFpm.hasEnrolledTemplates(userId); Boolean oldFpEnrolled = mIsUnlockWithFingerprintPossible.getOrDefault(userId, false); if (oldFpEnrolled != newFpEnrolled) { mLogger.logFpEnrolledUpdated(userId, oldFpEnrolled, newFpEnrolled); } mIsUnlockWithFingerprintPossible.put(userId, newFpEnrolled); return mIsUnlockWithFingerprintPossible.get(userId); } /** * Cached value for whether fingerprint is enrolled and possible to use for authentication. * Note: checking fingerprint enrollment directly with the AuthController requires an IPC. */ public boolean getCachedIsUnlockWithFingerprintPossible(int userId) { return mIsUnlockWithFingerprintPossible.getOrDefault(userId, false); public boolean isUnlockWithFingerprintPossible(int userId) { return isFingerprintSupported() && !isFingerprintDisabled(userId) && mAuthController.isFingerprintEnrolled(userId); } /** * @deprecated This is being migrated to use modern architecture. */ @VisibleForTesting @Deprecated private boolean isUnlockWithFacePossible(int userId) { public boolean isUnlockWithFacePossible(int userId) { if (isFaceAuthInteractorEnabled()) { return getFaceAuthInteractor() != null && getFaceAuthInteractor().isFaceAuthEnabledAndEnrolled(); } return isFaceAuthEnabledForUser(userId) && !isFaceDisabled(userId); } /** * If face hardware is available, user has enrolled and enabled auth via setting. * * @deprecated This is being migrated to use modern architecture. */ @Deprecated public boolean isFaceAuthEnabledForUser(int userId) { // TODO (b/242022358), make this rely on onEnrollmentChanged event and update it only once. updateFaceEnrolled(userId); return mIsFaceEnrolled; return isFaceSupported() && isFaceEnrolled(userId) && !isFaceDisabled(userId); } private void notifyAboutEnrollmentChange(@BiometricAuthenticator.Modality int modality) { Loading packages/SystemUI/src/com/android/keyguard/logging/KeyguardUpdateMonitorLogger.kt +0 −13 Original line number Diff line number Diff line Loading @@ -660,19 +660,6 @@ constructor(@KeyguardUpdateMonitorLog private val logBuffer: LogBuffer) { ) } fun logFpEnrolledUpdated(userId: Int, oldValue: Boolean, newValue: Boolean) { logBuffer.log( TAG, DEBUG, { int1 = userId bool1 = oldValue bool2 = newValue }, { "Fp enrolled state changed for userId: $int1 old: $bool1, new: $bool2" } ) } fun logTrustUsuallyManagedUpdated( userId: Int, oldValue: Boolean, Loading packages/SystemUI/src/com/android/systemui/bouncer/domain/interactor/PrimaryBouncerInteractor.kt +1 −1 Original line number Diff line number Diff line Loading @@ -415,7 +415,7 @@ constructor( /** Whether we want to wait to show the bouncer in case passive auth succeeds. */ private fun usePrimaryBouncerPassiveAuthDelay(): Boolean { val canRunFaceAuth = keyguardStateController.isFaceAuthEnabled && keyguardStateController.isFaceEnrolled && keyguardUpdateMonitor.isUnlockingWithBiometricAllowed(BiometricSourceType.FACE) && keyguardUpdateMonitor.doesCurrentPostureAllowFaceAuth() val canRunActiveUnlock = Loading Loading
packages/SystemUI/src/com/android/keyguard/ActiveUnlockConfig.kt +4 −6 Original line number Diff line number Diff line Loading @@ -318,8 +318,7 @@ class ActiveUnlockConfig @Inject constructor( keyguardUpdateMonitor?.let { val anyFaceEnrolled = it.isFaceEnrolled val anyFingerprintEnrolled = it.getCachedIsUnlockWithFingerprintPossible( val anyFingerprintEnrolled = it.isUnlockWithFingerprintPossible( selectedUserInteractor.getSelectedUserId()) val udfpsEnrolled = it.isUdfpsEnrolled Loading Loading @@ -374,9 +373,8 @@ class ActiveUnlockConfig @Inject constructor( pw.println(" shouldRequestActiveUnlockOnUnlockIntentFromBiometricEnrollment=" + "${shouldRequestActiveUnlockOnUnlockIntentFromBiometricEnrollment()}") pw.println(" faceEnrolled=${it.isFaceEnrolled}") pw.println(" fpEnrolled=${ it.getCachedIsUnlockWithFingerprintPossible( selectedUserInteractor.getSelectedUserId())}") pw.println(" fpUnlockPossible=${ it.isUnlockWithFingerprintPossible(selectedUserInteractor.getSelectedUserId())}") pw.println(" udfpsEnrolled=${it.isUdfpsEnrolled}") } ?: pw.println(" keyguardUpdateMonitor is uninitialized") } Loading
packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java +1 −1 Original line number Diff line number Diff line Loading @@ -755,7 +755,7 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard } mView.onResume( mSecurityModel.getSecurityMode(mSelectedUserInteractor.getSelectedUserId()), mKeyguardStateController.isFaceAuthEnabled()); mKeyguardStateController.isFaceEnrolled()); } /** Sets an initial message that would override the default message */ Loading
packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +14 −46 Original line number Diff line number Diff line Loading @@ -441,7 +441,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab private int mFaceRunningState = BIOMETRIC_STATE_STOPPED; private boolean mIsDreaming; private boolean mLogoutEnabled; private boolean mIsFaceEnrolled; private int mActiveMobileDataSubscription = SubscriptionManager.INVALID_SUBSCRIPTION_ID; private int mPostureState = DEVICE_POSTURE_UNKNOWN; private FingerprintInteractiveToAuthProvider mFingerprintInteractiveToAuthProvider; Loading Loading @@ -2083,7 +2082,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab private boolean mFingerprintLockedOut; private boolean mFingerprintLockedOutPermanent; private boolean mFaceLockedOutPermanent; private final HashMap<Integer, Boolean> mIsUnlockWithFingerprintPossible = new HashMap<>(); /** * When we receive a {@link android.content.Intent#ACTION_SIM_STATE_CHANGED} broadcast, Loading Loading @@ -2701,16 +2699,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab } } private void updateFaceEnrolled(int userId) { final Boolean isFaceEnrolled = isFaceSupported() && mBiometricEnabledForUser.get(userId) && mAuthController.isFaceAuthEnrolled(userId); if (mIsFaceEnrolled != isFaceEnrolled) { mLogger.logFaceEnrolledUpdated(mIsFaceEnrolled, isFaceEnrolled); } mIsFaceEnrolled = isFaceEnrolled; } private boolean isFaceSupported() { return mFaceManager != null && !mFaceSensorProperties.isEmpty(); } Loading Loading @@ -2749,11 +2737,18 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab return mAuthController.isSfpsSupported(); } /** * @return true if there's at least one face enrolled for the given user. */ public boolean isFaceEnrolled(int userId) { return mAuthController.isFaceAuthEnrolled(userId); } /** * @return true if there's at least one face enrolled */ public boolean isFaceEnrolled() { return mIsFaceEnrolled; return isFaceEnrolled(mSelectedUserInteractor.getSelectedUserId()); } private final UserTracker.Callback mUserChangedCallback = new UserTracker.Callback() { Loading Loading @@ -3442,49 +3437,22 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab } @SuppressLint("MissingPermission") @VisibleForTesting boolean isUnlockWithFingerprintPossible(int userId) { // TODO (b/242022358), make this rely on onEnrollmentChanged event and update it only once. boolean newFpEnrolled = isFingerprintSupported() && !isFingerprintDisabled(userId) && mFpm.hasEnrolledTemplates(userId); Boolean oldFpEnrolled = mIsUnlockWithFingerprintPossible.getOrDefault(userId, false); if (oldFpEnrolled != newFpEnrolled) { mLogger.logFpEnrolledUpdated(userId, oldFpEnrolled, newFpEnrolled); } mIsUnlockWithFingerprintPossible.put(userId, newFpEnrolled); return mIsUnlockWithFingerprintPossible.get(userId); } /** * Cached value for whether fingerprint is enrolled and possible to use for authentication. * Note: checking fingerprint enrollment directly with the AuthController requires an IPC. */ public boolean getCachedIsUnlockWithFingerprintPossible(int userId) { return mIsUnlockWithFingerprintPossible.getOrDefault(userId, false); public boolean isUnlockWithFingerprintPossible(int userId) { return isFingerprintSupported() && !isFingerprintDisabled(userId) && mAuthController.isFingerprintEnrolled(userId); } /** * @deprecated This is being migrated to use modern architecture. */ @VisibleForTesting @Deprecated private boolean isUnlockWithFacePossible(int userId) { public boolean isUnlockWithFacePossible(int userId) { if (isFaceAuthInteractorEnabled()) { return getFaceAuthInteractor() != null && getFaceAuthInteractor().isFaceAuthEnabledAndEnrolled(); } return isFaceAuthEnabledForUser(userId) && !isFaceDisabled(userId); } /** * If face hardware is available, user has enrolled and enabled auth via setting. * * @deprecated This is being migrated to use modern architecture. */ @Deprecated public boolean isFaceAuthEnabledForUser(int userId) { // TODO (b/242022358), make this rely on onEnrollmentChanged event and update it only once. updateFaceEnrolled(userId); return mIsFaceEnrolled; return isFaceSupported() && isFaceEnrolled(userId) && !isFaceDisabled(userId); } private void notifyAboutEnrollmentChange(@BiometricAuthenticator.Modality int modality) { Loading
packages/SystemUI/src/com/android/keyguard/logging/KeyguardUpdateMonitorLogger.kt +0 −13 Original line number Diff line number Diff line Loading @@ -660,19 +660,6 @@ constructor(@KeyguardUpdateMonitorLog private val logBuffer: LogBuffer) { ) } fun logFpEnrolledUpdated(userId: Int, oldValue: Boolean, newValue: Boolean) { logBuffer.log( TAG, DEBUG, { int1 = userId bool1 = oldValue bool2 = newValue }, { "Fp enrolled state changed for userId: $int1 old: $bool1, new: $bool2" } ) } fun logTrustUsuallyManagedUpdated( userId: Int, oldValue: Boolean, Loading
packages/SystemUI/src/com/android/systemui/bouncer/domain/interactor/PrimaryBouncerInteractor.kt +1 −1 Original line number Diff line number Diff line Loading @@ -415,7 +415,7 @@ constructor( /** Whether we want to wait to show the bouncer in case passive auth succeeds. */ private fun usePrimaryBouncerPassiveAuthDelay(): Boolean { val canRunFaceAuth = keyguardStateController.isFaceAuthEnabled && keyguardStateController.isFaceEnrolled && keyguardUpdateMonitor.isUnlockingWithBiometricAllowed(BiometricSourceType.FACE) && keyguardUpdateMonitor.doesCurrentPostureAllowFaceAuth() val canRunActiveUnlock = Loading