Check AppOps bit for TelephonyManager#getForbiddenPlmns
Bug: 73884967
Test: Telephony Sanity, Compile
Merged-In: Ifdce4187fb2d81a62d8e434c0fe924eb7a0ffe1c
(cherry picked from commit a2870fdb5c157ba103ffcbce4e4b23af8ff1570e)
Change-Id: Ib208b817873c3abcc8eb9ddd7ce085a7c9bd4e1c
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 16996c0..df21799 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -2520,10 +2520,11 @@
* Get the forbidden PLMN List from the given app type (ex APPTYPE_USIM)
* on a particular subscription
*/
- public String[] getForbiddenPlmns(int subId, int appType) {
- // TODO(b/73884967): Migrate to TelephonyPermissions check.
- mApp.enforceCallingOrSelfPermission(android.Manifest.permission.READ_PHONE_STATE,
- "Requires READ_PHONE_STATE");
+ public String[] getForbiddenPlmns(int subId, int appType, String callingPackage) {
+ if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
+ mApp, subId, callingPackage, "getForbiddenPlmns")) {
+ return null;
+ }
if (appType != TelephonyManager.APPTYPE_USIM && appType != TelephonyManager.APPTYPE_SIM) {
loge("getForbiddenPlmnList(): App Type must be USIM or SIM");
return null;