Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fb690e6e authored by Kenny Root's avatar Kenny Root Committed by Android Git Automerger
Browse files

am ab34aba1: am f05d511b: Merge "LockScreen: only set keystore password for owner" into jb-mr1-dev

* commit 'ab34aba1':
  LockScreen: only set keystore password for owner
parents 51a28cdb ab34aba1
Loading
Loading
Loading
Loading
+13 −4
Original line number Diff line number Diff line
@@ -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;
        }