summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ricky Wai <rickywai@google.com> 2016-06-16 10:33:22 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2016-06-16 10:33:23 +0000
commit43f6a45e7e111af8a843e001b555082cb356a529 (patch)
treea3cc3d66aa47c755f0f248be5b5238817db60c9b
parentd58da1be76b0d847ecd6ce734d1f4dcf5a7bd9a0 (diff)
parent7f405f170f66d201f893a2f29866f528f0ec7fc8 (diff)
Merge "Add permission checking on service calls in LockSettingsService" into nyc-dev
-rw-r--r--services/core/java/com/android/server/LockSettingsService.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/LockSettingsService.java b/services/core/java/com/android/server/LockSettingsService.java
index 1e715f93d041..ef7b78789b2e 100644
--- a/services/core/java/com/android/server/LockSettingsService.java
+++ b/services/core/java/com/android/server/LockSettingsService.java
@@ -617,6 +617,7 @@ public class LockSettingsService extends ILockSettings.Stub {
@Override
public boolean getSeparateProfileChallengeEnabled(int userId) throws RemoteException {
+ checkReadPermission(SEPARATE_PROFILE_CHALLENGE_KEY, userId);
synchronized (mSeparateChallengeLock) {
return getBoolean(SEPARATE_PROFILE_CHALLENGE_KEY, false, userId);
}
@@ -625,6 +626,7 @@ public class LockSettingsService extends ILockSettings.Stub {
@Override
public void setSeparateProfileChallengeEnabled(int userId, boolean enabled,
String managedUserPassword) throws RemoteException {
+ checkWritePermission(userId);
synchronized (mSeparateChallengeLock) {
setBoolean(SEPARATE_PROFILE_CHALLENGE_KEY, enabled, userId);
if (enabled) {
@@ -672,7 +674,6 @@ public class LockSettingsService extends ILockSettings.Stub {
@Override
public long getLong(String key, long defaultValue, int userId) throws RemoteException {
checkReadPermission(key, userId);
-
String value = getStringUnchecked(key, null, userId);
return TextUtils.isEmpty(value) ? defaultValue : Long.parseLong(value);
}
@@ -680,7 +681,6 @@ public class LockSettingsService extends ILockSettings.Stub {
@Override
public String getString(String key, String defaultValue, int userId) throws RemoteException {
checkReadPermission(key, userId);
-
return getStringUnchecked(key, defaultValue, userId);
}
@@ -899,7 +899,7 @@ public class LockSettingsService extends ILockSettings.Stub {
}
}
- public void setLockPatternInternal(String pattern, String savedCredential, int userId)
+ private void setLockPatternInternal(String pattern, String savedCredential, int userId)
throws RemoteException {
byte[] currentHandle = getCurrentHandle(userId);
@@ -962,7 +962,7 @@ public class LockSettingsService extends ILockSettings.Stub {
}
}
- public void setLockPasswordInternal(String password, String savedCredential, int userId)
+ private void setLockPasswordInternal(String password, String savedCredential, int userId)
throws RemoteException {
byte[] currentHandle = getCurrentHandle(userId);
if (password == null) {
@@ -1156,6 +1156,7 @@ public class LockSettingsService extends ILockSettings.Stub {
@Override
public void resetKeyStore(int userId) throws RemoteException {
+ checkWritePermission(userId);
if (DEBUG) Slog.v(TAG, "Reset keystore for user: " + userId);
int managedUserId = -1;
String managedUserDecryptedPassword = null;
@@ -1558,6 +1559,7 @@ public class LockSettingsService extends ILockSettings.Stub {
LockPatternUtils.LOCK_PASSWORD_SALT_KEY,
LockPatternUtils.PASSWORD_HISTORY_KEY,
LockPatternUtils.PASSWORD_TYPE_KEY,
+ SEPARATE_PROFILE_CHALLENGE_KEY
};
private static final String[] SETTINGS_TO_BACKUP = new String[] {