Enforce MODIFY_PHONE_STATE or CarrierPrivilege permission for TelephonyManager#setForbiddenPlmns() API am: 5b0d75adc4 am: 1a5df1aec3
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/services/Telephony/+/16106037
Change-Id: Ibbd5c7c65947cc8d38bef2e9ee272f7e00fbf16f
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 274b301..a06f6b7 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -5524,11 +5524,9 @@
*/
public int setForbiddenPlmns(int subId, int appType, List<String> fplmns, String callingPackage,
String callingFeatureId) {
- if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(mApp, subId, callingPackage,
- callingFeatureId, "setForbiddenPlmns")) {
- if (DBG) logv("no permissions for setForbiddenplmns");
- throw new IllegalStateException("No Permissions for setForbiddenPlmns");
- }
+ TelephonyPermissions.enforceCallingOrSelfModifyPermissionOrCarrierPrivilege(
+ mApp, subId, "setForbiddenPlmns");
+
if (appType != TelephonyManager.APPTYPE_USIM && appType != TelephonyManager.APPTYPE_SIM) {
loge("setForbiddenPlmnList(): App Type must be USIM or SIM");
throw new IllegalArgumentException("Invalid appType: App Type must be USIM or SIM");