Merge "Allow network stack UID caller to retrieve cell identity" into rvc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
855eb749ed
@@ -260,11 +260,12 @@ public final class LocationAccessPolicy {
|
|||||||
/** Check if location permissions have been granted */
|
/** Check if location permissions have been granted */
|
||||||
public static LocationPermissionResult checkLocationPermission(
|
public static LocationPermissionResult checkLocationPermission(
|
||||||
Context context, LocationPermissionQuery query) {
|
Context context, LocationPermissionQuery query) {
|
||||||
// Always allow the phone process and system server to access location. This avoid
|
// Always allow the phone process, system server, and network stack to access location.
|
||||||
// breaking legacy code that rely on public-facing APIs to access cell location, and
|
// This avoid breaking legacy code that rely on public-facing APIs to access cell location,
|
||||||
// it doesn't create an info leak risk because the cell location is stored in the phone
|
// and it doesn't create an info leak risk because the cell location is stored in the phone
|
||||||
// process anyway, and the system server already has location access.
|
// process anyway, and the system server already has location access.
|
||||||
if (query.callingUid == Process.PHONE_UID || query.callingUid == Process.SYSTEM_UID
|
if (query.callingUid == Process.PHONE_UID || query.callingUid == Process.SYSTEM_UID
|
||||||
|
|| query.callingUid == Process.NETWORK_STACK_UID
|
||||||
|| query.callingUid == Process.ROOT_UID) {
|
|| query.callingUid == Process.ROOT_UID) {
|
||||||
return LocationPermissionResult.ALLOWED;
|
return LocationPermissionResult.ALLOWED;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user