Skip to content

Commit 3de0901

Browse files
Kenny GuyAndroid (Google) Code Review
authored andcommitted
Merge "SettingsProvider should use correct cache when redirecting to user 0." into lmp-dev
2 parents d84ce32 + a37d000 commit 3de0901

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -694,12 +694,11 @@ public Bundle call(String method, String request, Bundle args) {
694694
if (Settings.CALL_METHOD_GET_SYSTEM.equals(method)) {
695695
if (LOCAL_LOGV) Slog.v(TAG, "call(system:" + request + ") for " + callingUser);
696696
// Check if this request should be (re)directed to the primary user's db
697-
if (callingUser == UserHandle.USER_OWNER
698-
|| shouldShadowParentProfile(callingUser, sSystemCloneToManagedKeys, request)) {
699-
dbHelper = getOrEstablishDatabase(UserHandle.USER_OWNER);
700-
} else {
701-
dbHelper = getOrEstablishDatabase(callingUser);
697+
if (callingUser != UserHandle.USER_OWNER
698+
&& shouldShadowParentProfile(callingUser, sSystemCloneToManagedKeys, request)) {
699+
callingUser = UserHandle.USER_OWNER;
702700
}
701+
dbHelper = getOrEstablishDatabase(callingUser);
703702
cache = sSystemCaches.get(callingUser);
704703
return lookupValue(dbHelper, TABLE_SYSTEM, cache, request);
705704
}
@@ -713,10 +712,9 @@ public Bundle call(String method, String request, Bundle args) {
713712
UserManager.DISALLOW_SHARE_LOCATION, new UserHandle(callingUser))) {
714713
return sSecureCaches.get(callingUser).putIfAbsent(request, "");
715714
}
716-
dbHelper = getOrEstablishDatabase(UserHandle.USER_OWNER);
717-
} else {
718-
dbHelper = getOrEstablishDatabase(callingUser);
715+
callingUser = UserHandle.USER_OWNER;
719716
}
717+
dbHelper = getOrEstablishDatabase(callingUser);
720718
cache = sSecureCaches.get(callingUser);
721719
return lookupValue(dbHelper, TABLE_SECURE, cache, request);
722720
}

0 commit comments

Comments
 (0)