Merge "Add permission checks to unified challenge cache APIs"

This commit is contained in:
Eric Biggers
2022-09-30 18:11:19 +00:00
committed by Android (Google) Code Review

View File

@@ -2940,6 +2940,7 @@ public class LockSettingsService extends ILockSettings.Stub {
@Override
public boolean tryUnlockWithCachedUnifiedChallenge(int userId) {
checkPasswordReadPermission();
try (LockscreenCredential cred = mManagedProfilePasswordCache.retrievePassword(userId)) {
if (cred == null) {
return false;
@@ -2951,6 +2952,7 @@ public class LockSettingsService extends ILockSettings.Stub {
@Override
public void removeCachedUnifiedChallenge(int userId) {
checkWritePermission();
mManagedProfilePasswordCache.removePassword(userId);
}