diff options
author | Bryce Lee <brycelee@google.com> | 2015-12-14 23:43:54 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2015-12-14 23:43:54 +0000 |
commit | 36393a5674bf50b351b5961a194ce2814ca00140 (patch) | |
tree | 7946c89bb82c1d0f8316b96a6c4f6de3091a99d0 /core | |
parent | cf07154e7102de304f1d887c8c2a2ef61b4880d7 (diff) | |
parent | 4614596a395b6c86fff3f35a07edda2e848d743c (diff) | |
download | frameworks_base-36393a5674bf50b351b5961a194ce2814ca00140.zip frameworks_base-36393a5674bf50b351b5961a194ce2814ca00140.tar.gz frameworks_base-36393a5674bf50b351b5961a194ce2814ca00140.tar.bz2 |
Allow access to deprecated LOCK_PATTERN_ENABLED flag.
am: 4614596a39
* commit '4614596a395b6c86fff3f35a07edda2e848d743c':
Allow access to deprecated LOCK_PATTERN_ENABLED flag.
Diffstat (limited to 'core')
-rw-r--r-- | core/java/com/android/internal/widget/LockPatternUtils.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/core/java/com/android/internal/widget/LockPatternUtils.java b/core/java/com/android/internal/widget/LockPatternUtils.java index 60380fb..2e9f4f6 100644 --- a/core/java/com/android/internal/widget/LockPatternUtils.java +++ b/core/java/com/android/internal/widget/LockPatternUtils.java @@ -64,6 +64,11 @@ public class LockPatternUtils { 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 * method of verifying the user, and resetting their lock pattern. */ @@ -985,6 +990,19 @@ public class LockPatternUtils { 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) { return mode == DevicePolicyManager.PASSWORD_QUALITY_SOMETHING && savedPatternExists(userId); |