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

Commit 8d48fc47 authored by Lucas Dupin's avatar Lucas Dupin
Browse files

Fix message not showing when face auth is enabled

Old code was checking explicitly for fingerprint, we need something more
generic, that asserts any type of biometrics.

Test: manual
Fixes: 131140362
Change-Id: I5868c54b12c24696bc00a150d7bb3cb3d872015f
parent 5a9e4ba9
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);