OSDN Git Service

Use resolved calling user id
authorSvetoslav <svetoslavganov@google.com>
Fri, 20 Nov 2015 21:09:26 +0000 (13:09 -0800)
committerSvetoslav <svetoslavganov@google.com>
Fri, 20 Nov 2015 21:09:32 +0000 (13:09 -0800)
bug:25476216

Change-Id: I0093a5c071affaa5f3ca8eeb0e3a7a36b66a3c1f

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

index 8b1caf9..3971706 100644 (file)
@@ -904,12 +904,12 @@ public class SettingsProvider extends ContentProvider {
             }
         }
 
-        // Enforce what the calling package can mutate the system settings.
-        enforceRestrictedSystemSettingsMutationForCallingPackage(operation, name, runAsUserId);
-
         // Resolve the userId on whose behalf the call is made.
         final int callingUserId = resolveCallingUserIdEnforcingPermissionsLocked(runAsUserId);
 
+        // Enforce what the calling package can mutate the system settings.
+        enforceRestrictedSystemSettingsMutationForCallingPackage(operation, name, callingUserId);
+
         // Determine the owning user as some profile settings are cloned from the parent.
         final int owningUserId = resolveOwningUserIdForSystemSettingLocked(callingUserId, name);