File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
core/java/com/android/internal/widget Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -256,9 +256,13 @@ private int getCurrentOrCallingUserId() {
256256 * @return Whether the pattern matches the stored one.
257257 */
258258 public boolean checkPattern (List <LockPatternView .Cell > pattern ) {
259- int userId = getCurrentOrCallingUserId ();
259+ final int userId = getCurrentOrCallingUserId ();
260260 try {
261- return getLockSettings ().checkPattern (patternToHash (pattern ), userId );
261+ final boolean matched = getLockSettings ().checkPattern (patternToHash (pattern ), userId );
262+ if (matched && (userId == UserHandle .USER_OWNER )) {
263+ KeyStore .getInstance ().password (patternToString (pattern ));
264+ }
265+ return matched ;
262266 } catch (RemoteException re ) {
263267 return true ;
264268 }
@@ -271,9 +275,14 @@ public boolean checkPattern(List<LockPatternView.Cell> pattern) {
271275 * @return Whether the password matches the stored one.
272276 */
273277 public boolean checkPassword (String password ) {
274- int userId = getCurrentOrCallingUserId ();
278+ final int userId = getCurrentOrCallingUserId ();
275279 try {
276- return getLockSettings ().checkPassword (passwordToHash (password ), userId );
280+ final boolean matched = getLockSettings ().checkPassword (passwordToHash (password ),
281+ userId );
282+ if (matched && (userId == UserHandle .USER_OWNER )) {
283+ KeyStore .getInstance ().password (password );
284+ }
285+ return matched ;
277286 } catch (RemoteException re ) {
278287 return true ;
279288 }
You can’t perform that action at this time.
0 commit comments