TelephonyManager.SetAllowedNetworkTypesForReason(Int32, Int64) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Set the allowed network types of the device and provide the reason triggering the allowed network change.
[Android.Runtime.Register("setAllowedNetworkTypesForReason", "(IJ)V", "GetSetAllowedNetworkTypesForReason_IJHandler", ApiSince=33)]
[Android.Runtime.RequiresPermission("android.permission.MODIFY_PHONE_STATE")]
public virtual void SetAllowedNetworkTypesForReason (int reason, long allowedNetworkTypes);
[<Android.Runtime.Register("setAllowedNetworkTypesForReason", "(IJ)V", "GetSetAllowedNetworkTypesForReason_IJHandler", ApiSince=33)>]
[<Android.Runtime.RequiresPermission("android.permission.MODIFY_PHONE_STATE")>]
abstract member SetAllowedNetworkTypesForReason : int * int64 -> unit
override this.SetAllowedNetworkTypesForReason : int * int64 -> unit
Parameters
- reason
- Int32
the reason the allowed network type change is taking place
- allowedNetworkTypes
- Int64
The bitmask of allowed network type
- Attributes
Remarks
Set the allowed network types of the device and provide the reason triggering the allowed network change.
Requires permission: android.Manifest.permission#MODIFY_PHONE_STATE
or that the calling app has carrier privileges (see #hasCarrierPrivileges
).
This can be called for following reasons: <ol> <li>Allowed network types control by USER TelephonyManager#ALLOWED_NETWORK_TYPES_REASON_USER
<li>Allowed network types control by carrier #ALLOWED_NETWORK_TYPES_REASON_CARRIER
</ol> This API will result in allowing an intersection of allowed network types for all reasons, including the configuration done through other reasons.
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.