summaryrefslogtreecommitdiffstats
path: root/packages/SettingsProvider/src/com/android/providers/settings
diff options
context:
space:
mode:
authorMaggie Benthall <mbenthall@google.com>2013-02-04 13:28:19 -0500
committerMaggie Benthall <mbenthall@google.com>2013-02-06 18:53:47 -0500
commitd2726582f135383e56661bc41d750966642dab45 (patch)
treec3a4b288963fc5acc95f7f6f1c805dc566e39076 /packages/SettingsProvider/src/com/android/providers/settings
parent484f3bdcd663d4ddc9521e788c45338b34a1691d (diff)
downloadframeworks_base-d2726582f135383e56661bc41d750966642dab45.zip
frameworks_base-d2726582f135383e56661bc41d750966642dab45.tar.gz
frameworks_base-d2726582f135383e56661bc41d750966642dab45.tar.bz2
Fix for SettingsProvider to query for correct user.
insertForUser takes a specified user and attempts to adjust that user's settings, first looking at their existing settings to determine the difference. However it was querying the settings for the calling user, rather than for the user whose settings were being changed. Also add a test that exercises the fix. Change-Id: I6ed6fd79154ac1b6e6ab880769ac9081dfff6b80
Diffstat (limited to 'packages/SettingsProvider/src/com/android/providers/settings')
-rw-r--r--packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
index f18338a..36ef6e8 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
@@ -757,7 +757,7 @@ public class SettingsProvider extends ContentProvider {
* @returns whether the database needs to be updated or not, also modifying
* 'initialValues' if needed.
*/
- private boolean parseProviderList(Uri url, ContentValues initialValues) {
+ private boolean parseProviderList(Uri url, ContentValues initialValues, int desiredUser) {
String value = initialValues.getAsString(Settings.Secure.VALUE);
String newProviders = null;
if (value != null && value.length() > 1) {
@@ -770,7 +770,7 @@ public class SettingsProvider extends ContentProvider {
String providers = "";
String[] columns = {Settings.Secure.VALUE};
String where = Settings.Secure.NAME + "=\'" + Settings.Secure.LOCATION_PROVIDERS_ALLOWED + "\'";
- Cursor cursor = query(url, columns, where, null, null);
+ Cursor cursor = queryForUser(url, columns, where, null, null, desiredUser);
if (cursor != null && cursor.getCount() == 1) {
try {
cursor.moveToFirst();
@@ -847,7 +847,7 @@ public class SettingsProvider extends ContentProvider {
// Support enabling/disabling a single provider (using "+" or "-" prefix)
String name = initialValues.getAsString(Settings.Secure.NAME);
if (Settings.Secure.LOCATION_PROVIDERS_ALLOWED.equals(name)) {
- if (!parseProviderList(url, initialValues)) return null;
+ if (!parseProviderList(url, initialValues, desiredUserHandle)) return null;
}
// If this is an insert() of a key that has been migrated to the global store,