diff options
author | Andres Morales <anmorales@google.com> | 2015-04-09 19:14:42 -0700 |
---|---|---|
committer | Andres Morales <anmorales@google.com> | 2015-04-13 18:38:45 -0700 |
commit | d9fc85ac27742adbe89e54fd35f3cb2469e94b91 (patch) | |
tree | 730af15f0d98b06e957c608bdf5667299e9d3508 /core/java/com/android/internal/widget/LockPatternUtils.java | |
parent | 8fa5665f0e757cec0063fb4cf1354f1596f93a91 (diff) | |
download | frameworks_base-d9fc85ac27742adbe89e54fd35f3cb2469e94b91.zip frameworks_base-d9fc85ac27742adbe89e54fd35f3cb2469e94b91.tar.gz frameworks_base-d9fc85ac27742adbe89e54fd35f3cb2469e94b91.tar.bz2 |
Add challenge to IGateKeeperService
required for enrolling secondary auth form-factors
Change-Id: Id5a1eb1ed22f01fbaabe8e4ebddfc42d58322625
Diffstat (limited to 'core/java/com/android/internal/widget/LockPatternUtils.java')
-rw-r--r-- | core/java/com/android/internal/widget/LockPatternUtils.java | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/core/java/com/android/internal/widget/LockPatternUtils.java b/core/java/com/android/internal/widget/LockPatternUtils.java index fce57bd..123d1ac 100644 --- a/core/java/com/android/internal/widget/LockPatternUtils.java +++ b/core/java/com/android/internal/widget/LockPatternUtils.java @@ -280,6 +280,24 @@ public class LockPatternUtils { } /** + * Check to see if a pattern matches the saved pattern. + * If pattern matches, return an opaque attestation that the challenge + * was verified. + * + * @param pattern The pattern to check. + * @param challenge The challenge to verify against the pattern + * @return the attestation that the challenge was verified, or null. + */ + public byte[] verifyPattern(List<LockPatternView.Cell> pattern, long challenge) { + final int userId = getCurrentOrCallingUserId(); + try { + return getLockSettings().verifyPattern(patternToString(pattern), challenge, userId); + } catch (RemoteException re) { + return null; + } + } + + /** * Check to see if a pattern matches the saved pattern. If no pattern exists, * always returns true. * @param pattern The pattern to check. @@ -295,6 +313,24 @@ public class LockPatternUtils { } /** + * Check to see if a password matches the saved password. + * If password matches, return an opaque attestation that the challenge + * was verified. + * + * @param password The password to check. + * @param challenge The challenge to verify against the password + * @return the attestation that the challenge was verified, or null. + */ + public byte[] verifyPassword(String password, long challenge) { + final int userId = getCurrentOrCallingUserId(); + try { + return getLockSettings().verifyPassword(password, challenge, userId); + } catch (RemoteException re) { + return null; + } + } + + /** * Check to see if a password matches the saved password. If no password exists, * always returns true. * @param password The password to check. |