Partager via


WifiAwareManager.SetOpportunisticModeEnabled(Boolean) Method

Definition

Set all Wi-Fi Aware sessions created by the calling app to be opportunistic.

[Android.Runtime.Register("setOpportunisticModeEnabled", "(Z)V", "GetSetOpportunisticModeEnabled_ZHandler", ApiSince=34)]
[Android.Runtime.RequiresPermission("android.permission.CHANGE_WIFI_STATE")]
public virtual void SetOpportunisticModeEnabled (bool enabled);
[<Android.Runtime.Register("setOpportunisticModeEnabled", "(Z)V", "GetSetOpportunisticModeEnabled_ZHandler", ApiSince=34)>]
[<Android.Runtime.RequiresPermission("android.permission.CHANGE_WIFI_STATE")>]
abstract member SetOpportunisticModeEnabled : bool -> unit
override this.SetOpportunisticModeEnabled : bool -> unit

Parameters

enabled
Boolean

True to configure all Wi-Fi Aware sessions by the calling app as Opportunistic. False by default.

Attributes

Remarks

Set all Wi-Fi Aware sessions created by the calling app to be opportunistic. Opportunistic Wi-Fi Aware sessions are considered low priority and may be torn down (the sessions or the Aware interface) if there are resource conflicts.

Java documentation for android.net.wifi.aware.WifiAwareManager.setOpportunisticModeEnabled(boolean).

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