Language

WifiNetworkSuggestion.Builder.SetRestricted(Boolean) Method

Definition

Specifies whether the system will bring up the network (if selected) as restricted.

[Android.Runtime.Register("setRestricted", "(Z)Landroid/net/wifi/WifiNetworkSuggestion$Builder;", "", ApiSince=33)]
public Android.Net.Wifi.WifiNetworkSuggestion.Builder SetRestricted(bool isRestricted);
[<Android.Runtime.Register("setRestricted", "(Z)Landroid/net/wifi/WifiNetworkSuggestion$Builder;", "", ApiSince=33)>]
member this.SetRestricted : bool -> Android.Net.Wifi.WifiNetworkSuggestion.Builder

Parameters

isRestricted
Boolean

Boolean indicating whether the network should be brought up restricted (if true) or unrestricted (if false).

Returns

Instance of Builder to enable chaining of the builder method. This value cannot be null.

Attributes

Remarks

Specifies whether the system will bring up the network (if selected) as restricted. A restricted network has its NetworkCapabilities.NET_CAPABILITY_NOT_RESTRICTED capability removed. The Wi-Fi network selection process may use this information to influence priority of the suggested network for Wi-Fi network selection (most likely to reduce it). The connectivity service may use this information to influence the overall network configuration of the device.

These suggestions are only considered for network selection if a NetworkRequest without NetworkCapabilities.NET_CAPABILITY_NOT_RESTRICTED capability is filed; A restricted network's credentials may not be shared with the user using setCredentialSharedWithUser(boolean); If not set, defaults to false (i.e. network is unrestricted).

Android reference for android.net.wifi.WifiNetworkSuggestion.Builder.setRestricted.

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