summaryrefslogtreecommitdiffstats
path: root/core/java/com
diff options
context:
space:
mode:
authorBryce Lee <brycelee@google.com>2015-12-14 14:39:10 -0800
committerBryce Lee <brycelee@google.com>2015-12-14 14:39:10 -0800
commit4614596a395b6c86fff3f35a07edda2e848d743c (patch)
treead430b0f95f5eb0ad517071090def35f6b3ef65a /core/java/com
parent3c67873f0a20a958f6cf1ccccb472fa050bf55b7 (diff)
downloadframeworks_base-4614596a395b6c86fff3f35a07edda2e848d743c.zip
frameworks_base-4614596a395b6c86fff3f35a07edda2e848d743c.tar.gz
frameworks_base-4614596a395b6c86fff3f35a07edda2e848d743c.tar.bz2
Allow access to deprecated LOCK_PATTERN_ENABLED flag.
It is possible that older platforms may have not cleared the lock pattern, but instead only checked this flag to determine the lock pattern enabled state. In such cases, upgrading to a platform with that only checks the lock pattern can lead to the lock screen being re-enabled by accident. These new methods allow this condition to be identified and resolved. Bug: 26029690 Change-Id: I8f7ebc0e1915049afe49c219c87010aa38a16244
Diffstat (limited to 'core/java/com')
-rw-r--r--core/java/com/android/internal/widget/LockPatternUtils.java18
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);