Allow IWLAN data service to get cell identity information
Even when location is disabled by the user, the data
service is still able to get the LAC/TAC from the
cell identity.
Fix: 169253540
Test: Manual
Change-Id: Ic5ddf78f4c105c93a0e438decf5f6f48b09956fb
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index bf0134e..ed4372e 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -7147,6 +7147,14 @@
boolean hasCoarsePermission =
coarseLocationResult == LocationAccessPolicy.LocationPermissionResult.ALLOWED;
+ final Phone phone = getPhone(subId);
+ if (phone == null) {
+ return null;
+ }
+
+ boolean isCallingPackageDataService = phone.getDataServicePackages()
+ .contains(callingPackage);
+
final long identity = Binder.clearCallingIdentity();
try {
// isActiveSubId requires READ_PHONE_STATE, which we already check for above
@@ -7156,16 +7164,11 @@
return null;
}
- final Phone phone = getPhone(subId);
- if (phone == null) {
- return null;
- }
-
ServiceState ss = phone.getServiceState();
// Scrub out the location info in ServiceState depending on what level of access
// the caller has.
- if (hasFinePermission) return ss;
+ if (hasFinePermission || isCallingPackageDataService) return ss;
if (hasCoarsePermission) return ss.createLocationInfoSanitizedCopy(false);
return ss.createLocationInfoSanitizedCopy(true);
} finally {