summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Lucas Dupin <dupin@google.com> 2019-04-26 16:31:27 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2019-04-26 16:31:27 +0000
commitba5b5d3b95686058e736336029645cff7a54e45c (patch)
tree1f2019b204d99ffa05c87769e269d923a4372e26
parentfdd2a8d5e4d31c0e415fe3d311a460905e18a219 (diff)
parent8d48fc47e4b0b982a467290dda89138d93fd4ae6 (diff)
Merge "Fix message not showing when face auth is enabled" into qt-dev
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java15
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java4
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);