Share via


TelephonyManager.SetForbiddenPlmns(IList<String>) Method

Definition

Replace the contents of the forbidden PLMN SIM file with the provided values.

[Android.Runtime.Register("setForbiddenPlmns", "(Ljava/util/List;)I", "GetSetForbiddenPlmns_Ljava_util_List_Handler", ApiSince=30)]
[Android.Runtime.RequiresPermission("android.permission.MODIFY_PHONE_STATE")]
public virtual int SetForbiddenPlmns (System.Collections.Generic.IList<string> fplmns);
[<Android.Runtime.Register("setForbiddenPlmns", "(Ljava/util/List;)I", "GetSetForbiddenPlmns_Ljava_util_List_Handler", ApiSince=30)>]
[<Android.Runtime.RequiresPermission("android.permission.MODIFY_PHONE_STATE")>]
abstract member SetForbiddenPlmns : System.Collections.Generic.IList<string> -> int
override this.SetForbiddenPlmns : System.Collections.Generic.IList<string> -> int

Parameters

fplmns
IList<String>

a list of PLMNs to be forbidden.

Returns

number of PLMNs that were successfully written to the SIM FPLMN list. This may be less than the number of PLMNs passed in where the SIM file does not have enough room for all of the values passed in. Return -1 in the event of an unexpected failure

Attributes

Remarks

Replace the contents of the forbidden PLMN SIM file with the provided values. Passing an empty list will clear the contents of the EFfplmn file. If the provided list is shorter than the size of EFfplmn, then the list will be padded up to the file size with 'FFFFFF'. (required by 3GPP TS 31.102 spec 4.2.16) If the list is longer than the size of EFfplmn, then the file will be written from the beginning of the list up to the file size.

Requires Permission: android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE or that the calling app has carrier privileges (see #hasCarrierPrivileges).

Java documentation for android.telephony.TelephonyManager.setForbiddenPlmns(java.util.List<java.lang.String>).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to