Loading core/java/com/android/internal/widget/LockPatternUtils.java +18 −0 Original line number Original line Diff line number Diff line Loading @@ -63,6 +63,11 @@ public class LockPatternUtils { private static final String TAG = "LockPatternUtils"; private static final String TAG = "LockPatternUtils"; private static final boolean DEBUG = false; private static final boolean DEBUG = false; /** * The key to identify when the lock pattern enabled flag is being acccessed for legacy reasons. */ public static final String LEGACY_LOCK_PATTERN_ENABLED = "legacy_lock_pattern_enabled"; /** /** * The number of incorrect attempts before which we fall back on an alternative * The number of incorrect attempts before which we fall back on an alternative * method of verifying the user, and resetting their lock pattern. * method of verifying the user, and resetting their lock pattern. Loading Loading @@ -985,6 +990,19 @@ public class LockPatternUtils { return isLockPatternEnabled(getKeyguardStoredPasswordQuality(userId), userId); return isLockPatternEnabled(getKeyguardStoredPasswordQuality(userId), userId); } } @Deprecated public boolean isLegacyLockPatternEnabled(int userId) { // Note: this value should default to {@code true} to avoid any reset that might result. // We must use a special key to read this value, since it will by default return the value // based on the new logic. return getBoolean(LEGACY_LOCK_PATTERN_ENABLED, true, userId); } @Deprecated public void setLegacyLockPatternEnabled(int userId) { setBoolean(Settings.Secure.LOCK_PATTERN_ENABLED, true, userId); } private boolean isLockPatternEnabled(int mode, int userId) { private boolean isLockPatternEnabled(int mode, int userId) { return mode == DevicePolicyManager.PASSWORD_QUALITY_SOMETHING return mode == DevicePolicyManager.PASSWORD_QUALITY_SOMETHING && savedPatternExists(userId); && savedPatternExists(userId); Loading services/core/java/com/android/server/LockSettingsService.java +4 −0 Original line number Original line Diff line number Diff line Loading @@ -350,6 +350,10 @@ public class LockSettingsService extends ILockSettings.Stub { } } } } if (LockPatternUtils.LEGACY_LOCK_PATTERN_ENABLED.equals(key)) { key = Settings.Secure.LOCK_PATTERN_ENABLED; } return mStorage.readKeyValue(key, defaultValue, userId); return mStorage.readKeyValue(key, defaultValue, userId); } } Loading Loading
core/java/com/android/internal/widget/LockPatternUtils.java +18 −0 Original line number Original line Diff line number Diff line Loading @@ -63,6 +63,11 @@ public class LockPatternUtils { private static final String TAG = "LockPatternUtils"; private static final String TAG = "LockPatternUtils"; private static final boolean DEBUG = false; private static final boolean DEBUG = false; /** * The key to identify when the lock pattern enabled flag is being acccessed for legacy reasons. */ public static final String LEGACY_LOCK_PATTERN_ENABLED = "legacy_lock_pattern_enabled"; /** /** * The number of incorrect attempts before which we fall back on an alternative * The number of incorrect attempts before which we fall back on an alternative * method of verifying the user, and resetting their lock pattern. * method of verifying the user, and resetting their lock pattern. Loading Loading @@ -985,6 +990,19 @@ public class LockPatternUtils { return isLockPatternEnabled(getKeyguardStoredPasswordQuality(userId), userId); return isLockPatternEnabled(getKeyguardStoredPasswordQuality(userId), userId); } } @Deprecated public boolean isLegacyLockPatternEnabled(int userId) { // Note: this value should default to {@code true} to avoid any reset that might result. // We must use a special key to read this value, since it will by default return the value // based on the new logic. return getBoolean(LEGACY_LOCK_PATTERN_ENABLED, true, userId); } @Deprecated public void setLegacyLockPatternEnabled(int userId) { setBoolean(Settings.Secure.LOCK_PATTERN_ENABLED, true, userId); } private boolean isLockPatternEnabled(int mode, int userId) { private boolean isLockPatternEnabled(int mode, int userId) { return mode == DevicePolicyManager.PASSWORD_QUALITY_SOMETHING return mode == DevicePolicyManager.PASSWORD_QUALITY_SOMETHING && savedPatternExists(userId); && savedPatternExists(userId); Loading
services/core/java/com/android/server/LockSettingsService.java +4 −0 Original line number Original line Diff line number Diff line Loading @@ -350,6 +350,10 @@ public class LockSettingsService extends ILockSettings.Stub { } } } } if (LockPatternUtils.LEGACY_LOCK_PATTERN_ENABLED.equals(key)) { key = Settings.Secure.LOCK_PATTERN_ENABLED; } return mStorage.readKeyValue(key, defaultValue, userId); return mStorage.readKeyValue(key, defaultValue, userId); } } Loading