Merge "Log FP & face enrollment state only if it changes." into tm-qpr-dev

This commit is contained in:
TreeHugger Robot
2023-03-09 02:01:22 +00:00
committed by Android (Google) Code Review

View File

@@ -2439,8 +2439,10 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
() -> mFaceManager != null && mFaceManager.isHardwareDetected() () -> mFaceManager != null && mFaceManager.isHardwareDetected()
&& mFaceManager.hasEnrolledTemplates(userId) && mFaceManager.hasEnrolledTemplates(userId)
&& mBiometricEnabledForUser.get(userId)); && mBiometricEnabledForUser.get(userId));
if (mIsFaceEnrolled != isFaceEnrolled) {
mLogger.logFaceEnrolledUpdated(mIsFaceEnrolled, isFaceEnrolled);
}
mIsFaceEnrolled = isFaceEnrolled; mIsFaceEnrolled = isFaceEnrolled;
mLogger.logFaceEnrolledUpdated(mIsFaceEnrolled, isFaceEnrolled);
} }
public boolean isFaceSupported() { public boolean isFaceSupported() {
@@ -3100,12 +3102,13 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
@VisibleForTesting @VisibleForTesting
boolean isUnlockWithFingerprintPossible(int userId) { boolean isUnlockWithFingerprintPossible(int userId) {
// TODO (b/242022358), make this rely on onEnrollmentChanged event and update it only once. // TODO (b/242022358), make this rely on onEnrollmentChanged event and update it only once.
boolean fpEnrolled = mFpm != null && mFpm.isHardwareDetected() boolean newFpEnrolled = mFpm != null && mFpm.isHardwareDetected()
&& !isFingerprintDisabled(userId) && mFpm.hasEnrolledTemplates(userId); && !isFingerprintDisabled(userId) && mFpm.hasEnrolledTemplates(userId);
mLogger.logFpEnrolledUpdated(userId, Boolean oldFpEnrolled = mIsUnlockWithFingerprintPossible.getOrDefault(userId, false);
mIsUnlockWithFingerprintPossible.getOrDefault(userId, false), if (oldFpEnrolled != newFpEnrolled) {
fpEnrolled); mLogger.logFpEnrolledUpdated(userId, oldFpEnrolled, newFpEnrolled);
mIsUnlockWithFingerprintPossible.put(userId, fpEnrolled); }
mIsUnlockWithFingerprintPossible.put(userId, newFpEnrolled);
return mIsUnlockWithFingerprintPossible.get(userId); return mIsUnlockWithFingerprintPossible.get(userId);
} }