Throw on revoked location permission - framework
When we fixed proper handling of location permisison gating
sensitive telephony calls we stopped throwing a security
exception when the permission is not held by the caller.
While this is not a security issue there is no reason to
change this behavior which is checked by CTS. This CL starts
throwing a security exception if the permission is not held.
Test: atest android.permission.cts.NoLocationPermissionTest
bug: 74074103
Change-Id: Ic891d62b408c692f84a345f24503f7f25d583e35
diff --git a/services/core/java/com/android/server/TelephonyRegistry.java b/services/core/java/com/android/server/TelephonyRegistry.java
index 539c001..83fe976 100644
--- a/services/core/java/com/android/server/TelephonyRegistry.java
+++ b/services/core/java/com/android/server/TelephonyRegistry.java
@@ -1753,7 +1753,8 @@
long token = Binder.clearCallingIdentity();
try {
return LocationAccessPolicy.canAccessCellLocation(mContext,
- r.callingPackage, r.callerUid, r.callerPid);
+ r.callingPackage, r.callerUid, r.callerPid,
+ /*throwOnDeniedPermission*/ false);
} finally {
Binder.restoreCallingIdentity(token);
}