diff options
author | Julia Reynolds <juliacr@google.com> | 2014-08-22 11:42:43 -0400 |
---|---|---|
committer | Julia Reynolds <juliacr@google.com> | 2014-08-27 16:25:00 -0400 |
commit | b53453fae037d67e421011936c8fdffe7ba43922 (patch) | |
tree | fc6bc2a6580496a82b5391f360d53604c586cc0b /packages/SettingsProvider | |
parent | c0dce273a8af0263b660b57c1a05395a0bd2d2e5 (diff) | |
download | frameworks_base-b53453fae037d67e421011936c8fdffe7ba43922.zip frameworks_base-b53453fae037d67e421011936c8fdffe7ba43922.tar.gz frameworks_base-b53453fae037d67e421011936c8fdffe7ba43922.tar.bz2 |
Audio/Micrphone user restriction/multiuser updates.
1. Persist microphone mute state.
2. Set mute state for correct user.
3. Check for settings restrictions as the correct user.
Bug: 17177502
Bug: 16701642
Change-Id: Id8b6cd90c5caceb67fbec862f90aac7ec7a00b3c
Diffstat (limited to 'packages/SettingsProvider')
-rw-r--r-- | packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java index 87c015c..4ef2189 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java @@ -318,10 +318,10 @@ public class SettingsProvider extends ContentProvider { } } - private void checkUserRestrictions(String setting) { + private void checkUserRestrictions(String setting, int userId) { String userRestriction = sRestrictedKeys.get(setting); if (!TextUtils.isEmpty(userRestriction) - && mUserManager.hasUserRestriction(userRestriction)) { + && mUserManager.hasUserRestriction(userRestriction, new UserHandle(userId))) { throw new SecurityException( "Permission denial: user is restricted from changing this setting."); } @@ -936,7 +936,7 @@ public class SettingsProvider extends ContentProvider { try { int numValues = values.length; for (int i = 0; i < numValues; i++) { - checkUserRestrictions(values[i].getAsString(Settings.Secure.NAME)); + checkUserRestrictions(values[i].getAsString(Settings.Secure.NAME), callingUser); if (db.insert(args.table, null, values[i]) < 0) return 0; SettingsCache.populate(cache, values[i]); if (LOCAL_LOGV) Log.v(TAG, args.table + " <- " + values[i]); @@ -1067,7 +1067,7 @@ public class SettingsProvider extends ContentProvider { // Check write permissions only after determining which table the insert will touch checkWritePermissions(args); - checkUserRestrictions(name); + checkUserRestrictions(name, desiredUserHandle); // The global table is stored under the owner, always if (TABLE_GLOBAL.equals(args.table)) { @@ -1143,7 +1143,7 @@ public class SettingsProvider extends ContentProvider { callingUser = UserHandle.USER_OWNER; } checkWritePermissions(args); - checkUserRestrictions(initialValues.getAsString(Settings.Secure.NAME)); + checkUserRestrictions(initialValues.getAsString(Settings.Secure.NAME), callingUser); final AtomicInteger mutationCount = sKnownMutationsInFlight.get(callingUser); mutationCount.incrementAndGet(); |