Loading telephony/java/android/telephony/TelephonyManager.java +6 −0 Original line number Diff line number Diff line Loading @@ -2606,6 +2606,8 @@ public class TelephonyManager { * * @return the lowercase 2 character ISO-3166 country code, or empty string if not available. * * @throws IllegalArgumentException when the slotIndex is invalid. * * {@hide} */ @SystemApi Loading @@ -2614,6 +2616,10 @@ public class TelephonyManager { @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getNetworkCountryIso(int slotIndex) { try { if (!SubscriptionManager.isValidSlotIndex(slotIndex)) { throw new IllegalArgumentException("invalid slot index " + slotIndex); } ITelephony telephony = getITelephony(); if (telephony == null) return ""; return telephony.getNetworkCountryIsoForPhone(slotIndex, getOpPackageName()); Loading Loading
telephony/java/android/telephony/TelephonyManager.java +6 −0 Original line number Diff line number Diff line Loading @@ -2606,6 +2606,8 @@ public class TelephonyManager { * * @return the lowercase 2 character ISO-3166 country code, or empty string if not available. * * @throws IllegalArgumentException when the slotIndex is invalid. * * {@hide} */ @SystemApi Loading @@ -2614,6 +2616,10 @@ public class TelephonyManager { @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getNetworkCountryIso(int slotIndex) { try { if (!SubscriptionManager.isValidSlotIndex(slotIndex)) { throw new IllegalArgumentException("invalid slot index " + slotIndex); } ITelephony telephony = getITelephony(); if (telephony == null) return ""; return telephony.getNetworkCountryIsoForPhone(slotIndex, getOpPackageName()); Loading