Merge "Added read phone state permission for getNetworkCountryIso"
am: 5c58ad3e6f
Change-Id: I1e7e68bc2fad307b1ff89f8df57eb1a766e79952
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();