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

Commit b177b190 authored by Danielle Millett's avatar Danielle Millett Committed by Android (Google) Code Review
Browse files

Merge "Fix 5405210: DevicePolicyManager doesn't allow Face Unlock"

parents c58111b3 c8fb532d
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -346,12 +346,21 @@ public class LockPatternUtils {
     */
    public int getActivePasswordQuality() {
        int activePasswordQuality = DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED;
        switch (getKeyguardStoredPasswordQuality()) {
        // Note we don't want to use getKeyguardStoredPasswordQuality() because we want this to
        // return biometric_weak if that is being used instead of the backup
        int quality =
                (int) getLong(PASSWORD_TYPE_KEY, DevicePolicyManager.PASSWORD_QUALITY_SOMETHING);
        switch (quality) {
            case DevicePolicyManager.PASSWORD_QUALITY_SOMETHING:
                if (isLockPatternEnabled()) {
                    activePasswordQuality = DevicePolicyManager.PASSWORD_QUALITY_SOMETHING;
                }
                break;
            case DevicePolicyManager.PASSWORD_QUALITY_BIOMETRIC_WEAK:
                if (isBiometricWeakInstalled()) {
                    activePasswordQuality = DevicePolicyManager.PASSWORD_QUALITY_BIOMETRIC_WEAK;
                }
                break;
            case DevicePolicyManager.PASSWORD_QUALITY_NUMERIC:
                if (isLockPasswordEnabled()) {
                    activePasswordQuality = DevicePolicyManager.PASSWORD_QUALITY_NUMERIC;
@@ -373,6 +382,7 @@ public class LockPatternUtils {
                }
                break;
        }

        return activePasswordQuality;
    }