@@ -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