diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 8479f88a82170..c457b7d0fb703 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -4173,6 +4173,32 @@ public class TelephonyManager { } } + /** + * Returns an array of Forbidden PLMNs from the specified SIM App + * Returns null if the query fails. + * + * + *

Requires that the calling app has READ_PRIVILEGED_PHONE_STATE + * + * @param subId subscription ID used for authentication + * @param appType the icc application type, like {@link #APPTYPE_USIM} + * @return fplmns an array of forbidden PLMNs + * @hide + */ + public String[] getForbiddenPlmns(int subId, int appType) { + try { + ITelephony telephony = getITelephony(); + if (telephony == null) + return null; + return telephony.getForbiddenPlmns(subId, appType); + } catch (RemoteException ex) { + return null; + } catch (NullPointerException ex) { + // This could happen before phone starts + return null; + } + } + /** * Get P-CSCF address from PCO after data connection is established or modified. * @param apnType the apnType, "ims" for IMS APN, "emergency" for EMERGENCY APN diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index 42a80b77f9078..0515168837688 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -1235,4 +1235,15 @@ interface ITelephony { * @hide * */ void setSimPowerStateForSlot(int slotId, boolean powerUp); + + * Returns a list of Forbidden PLMNs from the specified SIM App + * Returns null if the query fails. + * + * + *

Requires that the calling app has READ_PRIVILEGED_PHONE_STATE + * + * @param subId subscription ID used for authentication + * @param appType the icc application type, like {@link #APPTYPE_USIM} + */ + String[] getForbiddenPlmns(int subId, int appType); }