Fix missing permission check when saving pattern/password
Fixes bug 28163930
Change-Id: Ic98ef20933b352159b88fdef331e83e9ef6e1f20
diff --git a/services/core/java/com/android/server/LockSettingsService.java b/services/core/java/com/android/server/LockSettingsService.java
index f2b4e52..ad313cd 100644
--- a/services/core/java/com/android/server/LockSettingsService.java
+++ b/services/core/java/com/android/server/LockSettingsService.java
@@ -805,6 +805,7 @@
@Override
public void setLockPattern(String pattern, String savedCredential, int userId)
throws RemoteException {
+ checkWritePermission(userId);
synchronized (mSeparateChallengeLock) {
setLockPatternInternal(pattern, savedCredential, userId);
setSeparateProfileChallengeEnabled(userId, true, null);
@@ -862,6 +863,7 @@
@Override
public void setLockPassword(String password, String savedCredential, int userId)
throws RemoteException {
+ checkWritePermission(userId);
synchronized (mSeparateChallengeLock) {
setLockPasswordInternal(password, savedCredential, userId);
setSeparateProfileChallengeEnabled(userId, true, null);