From 2ae2ee68efc22649509fc68cc525b9f67b882736 Mon Sep 17 00:00:00 2001 From: Scott Mertz Date: Wed, 13 Apr 2016 19:47:29 -0700 Subject: LockPatternUtils: Use the actual user id to set pattern size Ticket: CYNGNOS-2462 Change-Id: Ia68e26ec2dfc23317135d933bc25204c1380bb02 --- .../android/internal/widget/LockPatternUtils.java | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'core') 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 pattern) { - return patternToString(pattern, getLockPatternSize()); + public String patternToString(List 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) { -- cgit v1.1