Added read phone state permission for getNetworkCountryIso
The slot based version of getNetworkCountryIso is a system API.
So it needs to be gaurded by permission.
Bug: 141646066
Test: Telephony sanity tests
Merged-In: I79f67580f34bd873c1a0deed9313b8d60050391e
Change-Id: I79f67580f34bd873c1a0deed9313b8d60050391e
(cherry picked from commit 1e81ccd2409d53167cb156dc6721eaf8e4d2297e)
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 05e1fb3..7fe72ae 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -2032,7 +2032,15 @@
}
@Override
- public String getNetworkCountryIsoForPhone(int phoneId) {
+ public String getNetworkCountryIsoForPhone(int phoneId, String callingPackage) {
+ if (!TextUtils.isEmpty(callingPackage)) {
+ final int subId = mSubscriptionController.getSubIdUsingPhoneId(phoneId);
+ if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState(
+ mApp, subId, callingPackage, "getNetworkCountryIsoForPhone")) {
+ return "";
+ }
+ }
+
// Reporting the correct network country is ambiguous when IWLAN could conflict with
// registered cell info, so return a NULL country instead.
final long identity = Binder.clearCallingIdentity();