}
}
- public boolean isUnlockWithFingerprintPossible(int userId) {
+ /**
+ * If biometrics hardware is available, not disabled, and user has enrolled templates.
+ * This does NOT check if the device is encrypted or in lockdown.
+ *
+ * @param userId User that's trying to unlock.
+ * @return {@code true} if possible.
+ */
+ public boolean isUnlockingWithBiometricsPossible(int userId) {
+ return isUnlockWithFacePossible(userId) || isUnlockWithFingerprintPossible(userId);
+ }
+
+ private boolean isUnlockWithFingerprintPossible(int userId) {
return mFpm != null && mFpm.isHardwareDetected() && !isFingerprintDisabled(userId)
&& mFpm.getEnrolledFingerprints(userId).size() > 0;
}
- public boolean isUnlockWithFacePossible(int userId) {
+ private boolean isUnlockWithFacePossible(int userId) {
return mFaceManager != null && mFaceManager.isHardwareDetected()
&& !isFaceDisabled(userId)
&& mFaceManager.hasEnrolledTemplates(userId);
public int getBouncerPromptReason() {
int currentUser = ActivityManager.getCurrentUser();
boolean trust = mTrustManager.isTrustUsuallyManaged(currentUser);
- boolean fingerprint = mUpdateMonitor.isUnlockWithFingerprintPossible(currentUser);
- boolean any = trust || fingerprint;
+ boolean biometrics = mUpdateMonitor.isUnlockingWithBiometricsPossible(currentUser);
+ boolean any = trust || biometrics;
KeyguardUpdateMonitor.StrongAuthTracker strongAuthTracker =
mUpdateMonitor.getStrongAuthTracker();
int strongAuth = strongAuthTracker.getStrongAuthForUser(currentUser);