diff options
author | Kenny Guy <kennyguy@google.com> | 2014-10-01 18:35:37 +0100 |
---|---|---|
committer | Kenny Guy <kennyguy@google.com> | 2014-10-01 19:18:18 +0100 |
commit | a37d000c2b4acfc72f5a5e75e5cd711fd10acaa8 (patch) | |
tree | fe52dd49898c537a9e0720f5a1b7064615489232 /packages | |
parent | 7dc7f676d699c739128dcc7855cbc0dacddaaa57 (diff) | |
download | frameworks_base-a37d000c2b4acfc72f5a5e75e5cd711fd10acaa8.zip frameworks_base-a37d000c2b4acfc72f5a5e75e5cd711fd10acaa8.tar.gz frameworks_base-a37d000c2b4acfc72f5a5e75e5cd711fd10acaa8.tar.bz2 |
SettingsProvider should use correct cache when redirecting to user 0.
SettingsProvider reads secure and system settings for managed
profiles from user 0 instead. However it still checks the cache
for the managed profile not user 0.
Bug: 17736586
Change-Id: I15d44b8a5779b01e6b9032e528dc34f5c5602449
Diffstat (limited to 'packages')
-rw-r--r-- | packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java index ba5d11d..2502088 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java @@ -691,12 +691,11 @@ public class SettingsProvider extends ContentProvider { if (Settings.CALL_METHOD_GET_SYSTEM.equals(method)) { if (LOCAL_LOGV) Slog.v(TAG, "call(system:" + request + ") for " + callingUser); // Check if this request should be (re)directed to the primary user's db - if (callingUser == UserHandle.USER_OWNER - || shouldShadowParentProfile(callingUser, sSystemCloneToManagedKeys, request)) { - dbHelper = getOrEstablishDatabase(UserHandle.USER_OWNER); - } else { - dbHelper = getOrEstablishDatabase(callingUser); + if (callingUser != UserHandle.USER_OWNER + && shouldShadowParentProfile(callingUser, sSystemCloneToManagedKeys, request)) { + callingUser = UserHandle.USER_OWNER; } + dbHelper = getOrEstablishDatabase(callingUser); cache = sSystemCaches.get(callingUser); return lookupValue(dbHelper, TABLE_SYSTEM, cache, request); } @@ -710,10 +709,9 @@ public class SettingsProvider extends ContentProvider { UserManager.DISALLOW_SHARE_LOCATION, new UserHandle(callingUser))) { return sSecureCaches.get(callingUser).putIfAbsent(request, ""); } - dbHelper = getOrEstablishDatabase(UserHandle.USER_OWNER); - } else { - dbHelper = getOrEstablishDatabase(callingUser); + callingUser = UserHandle.USER_OWNER; } + dbHelper = getOrEstablishDatabase(callingUser); cache = sSecureCaches.get(callingUser); return lookupValue(dbHelper, TABLE_SECURE, cache, request); } |