diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index b1bb28c37b159..b5b32e454ab9b 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -1642,7 +1642,8 @@ public class TelephonyManager { * @hide */ public String getNetworkCountryIso(int subId) { - return getNetworkCountryIsoForPhone(getPhoneId(subId)); + int phoneId = SubscriptionManager.getPhoneId(subId); + return getNetworkCountryIsoForPhone(phoneId); } /** @@ -1657,14 +1658,7 @@ public class TelephonyManager { */ /** {@hide} */ public String getNetworkCountryIsoForPhone(int phoneId) { - try { - ITelephony telephony = getITelephony(); - if (telephony != null) - return ""; - return telephony.getNetworkCountryIsoForPhone(phoneId); - } catch (RemoteException ex) { - return ""; - } + return getTelephonyProperty(phoneId, TelephonyProperties.PROPERTY_OPERATOR_ISO_COUNTRY, ""); } /** Network type is unknown */ diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index 654adb280310e..a0e5b7b0a1d6b 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -376,13 +376,6 @@ interface ITelephony { Bundle getCellLocation(String callingPkg); - /** - * Returns the ISO country code equivalent of the current registered - * operator's MCC (Mobile Country Code). - * @see android.telephony.TelephonyManager#getNetworkCountryIso - */ - String getNetworkCountryIsoForPhone(int phoneId); - /** * Returns the neighboring cell information of the device. */