Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b4d546fc authored by Lucas Dupin's avatar Lucas Dupin Committed by android-build-merger
Browse files

Merge "Fix message not showing when face auth is enabled" into qt-dev

am: ba5b5d3b

Change-Id: Iff97be770c3252e4443a61a02c48bce74647439e
parents e5298681 ba5b5d3b
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -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);
+2 −2
Original line number Diff line number Diff line
@@ -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);