diff options
| author | 2019-04-26 16:31:27 +0000 | |
|---|---|---|
| committer | 2019-04-26 16:31:27 +0000 | |
| commit | ba5b5d3b95686058e736336029645cff7a54e45c (patch) | |
| tree | 1f2019b204d99ffa05c87769e269d923a4372e26 | |
| parent | fdd2a8d5e4d31c0e415fe3d311a460905e18a219 (diff) | |
| parent | 8d48fc47e4b0b982a467290dda89138d93fd4ae6 (diff) | |
Merge "Fix message not showing when face auth is enabled" into qt-dev
| -rw-r--r-- | packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java | 15 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java | 4 |
2 files changed, 15 insertions, 4 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java index 1d19fecac8c9..83b98b0f8bb1 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java @@ -1670,12 +1670,23 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { } } - 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); diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index d363622dcc89..1fa6ad6d30ca 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -639,8 +639,8 @@ public class KeyguardViewMediator extends SystemUI { 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); |