Merge "getUicc{Card, Slot}sInfo should work with carrier privileges" am: c89612d550
Original change: https://android-review.googlesource.com/c/platform/packages/services/Telephony/+/2039344
Change-Id: Ib2906ecbc1c275684facc285114e87f158bac6e5
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 37dde95..51540b3 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -6779,6 +6779,10 @@
@Override
public int checkCarrierPrivilegesForPackageAnyPhone(String pkgName) {
enforceReadPrivilegedPermission("checkCarrierPrivilegesForPackageAnyPhone");
+ return checkCarrierPrivilegesForPackageAnyPhoneWithPermission(pkgName);
+ }
+
+ private int checkCarrierPrivilegesForPackageAnyPhoneWithPermission(String pkgName) {
if (TextUtils.isEmpty(pkgName)) {
return TelephonyManager.CARRIER_PRIVILEGE_STATUS_NO_ACCESS;
}
@@ -8674,7 +8678,7 @@
} catch (SecurityException e) {
// even without READ_PRIVILEGED_PHONE_STATE, we allow the call to continue if the caller
// has carrier privileges on an active UICC
- if (checkCarrierPrivilegesForPackageAnyPhone(callingPackage)
+ if (checkCarrierPrivilegesForPackageAnyPhoneWithPermission(callingPackage)
!= TelephonyManager.CARRIER_PRIVILEGE_STATUS_HAS_ACCESS) {
throw new SecurityException("Caller does not have permission.");
}
@@ -8792,7 +8796,7 @@
} catch (SecurityException e) {
// even without READ_PRIVILEGED_PHONE_STATE, we allow the call to continue if the caller
// has carrier privileges on an active UICC
- if (checkCarrierPrivilegesForPackageAnyPhone(callingPackage)
+ if (checkCarrierPrivilegesForPackageAnyPhoneWithPermission(callingPackage)
== TelephonyManager.CARRIER_PRIVILEGE_STATUS_HAS_ACCESS) {
hasReadPermission = true;
}