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

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

Merge "Added a setting for whether biometric weak liveliness is enabled."

parents 222dfc78 925a7d8f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -17614,6 +17614,7 @@ package android.provider {
    field public static final java.lang.String INPUT_METHOD_SELECTOR_VISIBILITY = "input_method_selector_visibility";
    field public static final java.lang.String INSTALL_NON_MARKET_APPS = "install_non_market_apps";
    field public static final java.lang.String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed";
    field public static final java.lang.String LOCK_BIOMETRIC_WEAK_FLAGS = "lock_biometric_weak_flags";
    field public static final java.lang.String LOCK_PATTERN_ENABLED = "lock_pattern_autolock";
    field public static final java.lang.String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED = "lock_pattern_tactile_feedback_enabled";
    field public static final java.lang.String LOCK_PATTERN_VISIBLE = "lock_pattern_visible_pattern";
+8 −0
Original line number Diff line number Diff line
@@ -793,6 +793,7 @@ public final class Settings {
            MOVED_TO_SECURE.add(Secure.HTTP_PROXY);
            MOVED_TO_SECURE.add(Secure.INSTALL_NON_MARKET_APPS);
            MOVED_TO_SECURE.add(Secure.LOCATION_PROVIDERS_ALLOWED);
            MOVED_TO_SECURE.add(Secure.LOCK_BIOMETRIC_WEAK_FLAGS);
            MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_ENABLED);
            MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_VISIBLE);
            MOVED_TO_SECURE.add(Secure.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED);
@@ -2656,6 +2657,13 @@ public final class Settings {
         */
        public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed";

        /**
         * A flag containing settings used for biometric weak
         * @hide
         */
        public static final String LOCK_BIOMETRIC_WEAK_FLAGS =
                "lock_biometric_weak_flags";

        /**
         * Whether autolock is enabled (0 = false, 1 = true)
         */
+28 −0
Original line number Diff line number Diff line
@@ -105,6 +105,12 @@ public class LockPatternUtils {
     */
    public static final int MIN_PATTERN_REGISTER_FAIL = MIN_LOCK_PATTERN_SIZE;

    /**
     * The bit in LOCK_BIOMETRIC_WEAK_FLAGS to be used to indicate whether liveliness should
     * be used
     */
    public static final int FLAG_BIOMETRIC_WEAK_LIVELINESS = 0x1;

    private final static String LOCKOUT_PERMANENT_KEY = "lockscreen.lockedoutpermanently";
    private final static String LOCKOUT_ATTEMPT_DEADLINE = "lockscreen.lockoutattemptdeadline";
    private final static String PATTERN_EVER_CHOSEN_KEY = "lockscreen.patterneverchosen";
@@ -877,6 +883,28 @@ public class LockPatternUtils {
        return true;
    }

    /**
     * Set whether biometric weak liveliness is enabled.
     */
    public void setBiometricWeakLivelinessEnabled(boolean enabled) {
        long currentFlag = getLong(Settings.Secure.LOCK_BIOMETRIC_WEAK_FLAGS, 0L);
        long newFlag;
        if (enabled) {
            newFlag = currentFlag | FLAG_BIOMETRIC_WEAK_LIVELINESS;
        } else {
            newFlag = currentFlag & ~FLAG_BIOMETRIC_WEAK_LIVELINESS;
        }
        setLong(Settings.Secure.LOCK_BIOMETRIC_WEAK_FLAGS, newFlag);
    }

    /**
     * @return Whether the biometric weak liveliness is enabled.
     */
    public boolean isBiometricWeakLivelinessEnabled() {
        long currentFlag = getLong(Settings.Secure.LOCK_BIOMETRIC_WEAK_FLAGS, 0L);
        return ((currentFlag & FLAG_BIOMETRIC_WEAK_LIVELINESS) != 0);
    }

    /**
     * Set whether the lock pattern is enabled.
     */