diff options
author | Scott Mertz <scott@cyngn.com> | 2016-04-13 19:47:29 -0700 |
---|---|---|
committer | Roman Birg <roman@cyngn.com> | 2016-04-14 13:17:09 -0700 |
commit | 2ae2ee68efc22649509fc68cc525b9f67b882736 (patch) | |
tree | 6c1aa500c3abc297b240c3042f43ce89e8b72042 /core | |
parent | c694ab1c51081097089e2d546742cf6213689158 (diff) | |
download | frameworks_base-2ae2ee68efc22649509fc68cc525b9f67b882736.zip frameworks_base-2ae2ee68efc22649509fc68cc525b9f67b882736.tar.gz frameworks_base-2ae2ee68efc22649509fc68cc525b9f67b882736.tar.bz2 |
LockPatternUtils: Use the actual user id to set pattern size
Ticket: CYNGNOS-2462
Change-Id: Ia68e26ec2dfc23317135d933bc25204c1380bb02
Diffstat (limited to 'core')
-rw-r--r-- | core/java/com/android/internal/widget/LockPatternUtils.java | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/core/java/com/android/internal/widget/LockPatternUtils.java b/core/java/com/android/internal/widget/LockPatternUtils.java index d9c2a92..dc2cf1e 100644 --- a/core/java/com/android/internal/widget/LockPatternUtils.java +++ b/core/java/com/android/internal/widget/LockPatternUtils.java @@ -263,7 +263,7 @@ public class LockPatternUtils { throws RequestThrottledException { try { VerifyCredentialResponse response = - getLockSettings().verifyPattern(patternToString(pattern), challenge, userId); + getLockSettings().verifyPattern(patternToString(pattern, userId), challenge, userId); if (response == null) { // Shouldn't happen return null; @@ -291,7 +291,7 @@ public class LockPatternUtils { throws RequestThrottledException { try { VerifyCredentialResponse response = - getLockSettings().checkPattern(patternToString(pattern), userId); + getLockSettings().checkPattern(patternToString(pattern, userId), userId); if (response.getResponseCode() == VerifyCredentialResponse.RESPONSE_OK) { return true; @@ -518,7 +518,7 @@ public class LockPatternUtils { + MIN_LOCK_PATTERN_SIZE + " dots long."); } - getLockSettings().setLockPattern(patternToString(pattern), savedPattern, userId); + getLockSettings().setLockPattern(patternToString(pattern, userId), savedPattern, userId); DevicePolicyManager dpm = getDevicePolicyManager(); // Update the device encryption password. @@ -527,7 +527,7 @@ public class LockPatternUtils { if (!shouldEncryptWithCredentials(true)) { clearEncryptionPassword(); } else { - String stringPattern = patternToString(pattern); + String stringPattern = patternToString(pattern, userId); updateEncryptionPassword(StorageManager.CRYPT_TYPE_PATTERN, stringPattern); } } @@ -878,8 +878,8 @@ public class LockPatternUtils { * @param pattern The pattern. * @return The pattern in string form. */ - public String patternToString(List<LockPatternView.Cell> pattern) { - return patternToString(pattern, getLockPatternSize()); + public String patternToString(List<LockPatternView.Cell> pattern, int userId) { + return patternToString(pattern, getLockPatternSize(userId)); } /** @@ -1100,8 +1100,8 @@ public class LockPatternUtils { /** * @return the pattern lockscreen size */ - public byte getLockPatternSize() { - long size = getLong(Settings.Secure.LOCK_PATTERN_SIZE, -1, UserHandle.USER_CURRENT); + public byte getLockPatternSize(int userId) { + long size = getLong(Settings.Secure.LOCK_PATTERN_SIZE, -1, userId); if (size > 0 && size < 128) { return (byte) size; } @@ -1111,8 +1111,8 @@ public class LockPatternUtils { /** * Set the pattern lockscreen size */ - public void setLockPatternSize(long size) { - setLong(Settings.Secure.LOCK_PATTERN_SIZE, size, UserHandle.USER_CURRENT); + public void setLockPatternSize(long size, int userId) { + setLong(Settings.Secure.LOCK_PATTERN_SIZE, size, userId); } public void setVisibleDotsEnabled(boolean enabled, int userId) { |