diff options
| author | Kenny Root <kroot@google.com> | 2012-09-25 23:35:56 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-09-25 23:35:56 -0700 |
| commit | f05d511bc95c5d0bdfa6d64c6a8a02c6a099703f (patch) | |
| tree | c3475de1dfab9f66b53cb55adf58366022d30fbb /core/java | |
| parent | ca68f4a32f7712876cad59ceff768c37c334214c (diff) | |
| parent | df8bfe0cf65b4f864eb3eb60c1371f987c79ca20 (diff) | |
Merge "LockScreen: only set keystore password for owner" into jb-mr1-dev
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/com/android/internal/widget/LockPatternUtils.java | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/core/java/com/android/internal/widget/LockPatternUtils.java b/core/java/com/android/internal/widget/LockPatternUtils.java index 09457ccfbf1b..84e1d95a9385 100644 --- a/core/java/com/android/internal/widget/LockPatternUtils.java +++ b/core/java/com/android/internal/widget/LockPatternUtils.java @@ -256,9 +256,13 @@ public class LockPatternUtils { * @return Whether the pattern matches the stored one. */ public boolean checkPattern(List<LockPatternView.Cell> pattern) { - int userId = getCurrentOrCallingUserId(); + final int userId = getCurrentOrCallingUserId(); try { - return getLockSettings().checkPattern(patternToHash(pattern), userId); + final boolean matched = getLockSettings().checkPattern(patternToHash(pattern), userId); + if (matched && (userId == UserHandle.USER_OWNER)) { + KeyStore.getInstance().password(patternToString(pattern)); + } + return matched; } catch (RemoteException re) { return true; } @@ -271,9 +275,14 @@ public class LockPatternUtils { * @return Whether the password matches the stored one. */ public boolean checkPassword(String password) { - int userId = getCurrentOrCallingUserId(); + final int userId = getCurrentOrCallingUserId(); try { - return getLockSettings().checkPassword(passwordToHash(password), userId); + final boolean matched = getLockSettings().checkPassword(passwordToHash(password), + userId); + if (matched && (userId == UserHandle.USER_OWNER)) { + KeyStore.getInstance().password(password); + } + return matched; } catch (RemoteException re) { return true; } |
