Throw on revoked location permission - telephony
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: I9b275ce502d1a2bcd42405c5c713d28795086a7a
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index a13cd11..d25f282 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -1675,7 +1675,7 @@
mPhone.getContext().getSystemService(AppOpsManager.class)
.checkPackage(Binder.getCallingUid(), callingPackage);
if (!LocationAccessPolicy.canAccessCellLocation(mPhone.getContext(),
- callingPackage, Binder.getCallingUid(),Binder.getCallingPid())) {
+ callingPackage, Binder.getCallingUid(), Binder.getCallingPid(), true)) {
return null;
}
@@ -1745,7 +1745,7 @@
mPhone.getContext().getSystemService(AppOpsManager.class)
.checkPackage(Binder.getCallingUid(), callingPackage);
if (!LocationAccessPolicy.canAccessCellLocation(mPhone.getContext(),
- callingPackage, Binder.getCallingUid(), Binder.getCallingPid())) {
+ callingPackage, Binder.getCallingUid(), Binder.getCallingPid(), true)) {
return null;
}
@@ -1775,7 +1775,7 @@
mPhone.getContext().getSystemService(AppOpsManager.class)
.checkPackage(Binder.getCallingUid(), callingPackage);
if (!LocationAccessPolicy.canAccessCellLocation(mPhone.getContext(),
- callingPackage, Binder.getCallingUid(), Binder.getCallingPid())) {
+ callingPackage, Binder.getCallingUid(), Binder.getCallingPid(), true)) {
return null;
}