Fix order of uid/pid in LocationAccessPolicy

Fix the order in which uid and pid are passed into the permission check.

Test: atest LocationAccessPolicyTest
Fixes: 151330809
Change-Id: I479c8fc123d5a994e8cbe6489aa00bea4abca1c7
(cherry picked from commit 0cd4dbc0b3)
This commit is contained in:
Hall Liu
2020-04-01 18:00:09 -07:00
parent 645fdff012
commit 7e826f9531

View File

@@ -311,7 +311,7 @@ public final class LocationAccessPolicy {
} }
// If the user or profile is current, permission is granted. // If the user or profile is current, permission is granted.
// Otherwise, uid must have INTERACT_ACROSS_USERS_FULL permission. // Otherwise, uid must have INTERACT_ACROSS_USERS_FULL permission.
return isCurrentProfile(context, uid) || checkInteractAcrossUsersFull(context, uid, pid); return isCurrentProfile(context, uid) || checkInteractAcrossUsersFull(context, pid, uid);
} }
private static boolean isLocationModeEnabled(@NonNull Context context, @UserIdInt int userId) { private static boolean isLocationModeEnabled(@NonNull Context context, @UserIdInt int userId) {