Skip to content

Commit

Permalink
Allow network stack UID caller to retrieve cell identity
Browse files Browse the repository at this point in the history
For backwards compatibility, we allow phone, system UID to
access cell identity through getServiceState. Cell broadcast
service, which is used to be part of telephony, now is running
under network stack UID. We should consider network stack UID as
trustable components like system/telephony.

Fix: 157618105
Test: Manual
Change-Id: I9b2dfc778752e130f5c7e44c4b2e45b63ac6f918
(cherry picked from commit 56cfdd1)
  • Loading branch information
Jack Yu authored and android-build-team Robot committed Jul 26, 2020
1 parent a1efa34 commit 35c84e1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions telephony/common/android/telephony/LocationAccessPolicy.java
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,12 @@ private static LocationPermissionResult checkAppLocationPermissionHelper(Context
/** Check if location permissions have been granted */
public static LocationPermissionResult checkLocationPermission(
Context context, LocationPermissionQuery query) {
// Always allow the phone process and system server to access location. This avoid
// breaking legacy code that rely on public-facing APIs to access cell location, and
// it doesn't create an info leak risk because the cell location is stored in the phone
// Always allow the phone process, system server, and network stack to access location.
// This avoid breaking legacy code that rely on public-facing APIs to access cell location,
// 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.
if (query.callingUid == Process.PHONE_UID || query.callingUid == Process.SYSTEM_UID
|| query.callingUid == Process.NETWORK_STACK_UID
|| query.callingUid == Process.ROOT_UID) {
return LocationPermissionResult.ALLOWED;
}
Expand Down

0 comments on commit 35c84e1

Please sign in to comment.