Freigeben über


WifiManager.ReportCreateInterfaceImpact Method

Definition

Queries the framework to determine whether the specified interface can be created, and if so - what other interfaces would be torn down by the framework to allow this creation if it were requested.

[Android.Runtime.Register("reportCreateInterfaceImpact", "(IZLjava/util/concurrent/Executor;Ljava/util/function/BiConsumer;)V", "GetReportCreateInterfaceImpact_IZLjava_util_concurrent_Executor_Ljava_util_function_BiConsumer_Handler", ApiSince=33)]
public virtual void ReportCreateInterfaceImpact (int interfaceType, bool requireNewInterface, Java.Util.Concurrent.IExecutor executor, Java.Util.Functions.IBiConsumer resultCallback);
[<Android.Runtime.Register("reportCreateInterfaceImpact", "(IZLjava/util/concurrent/Executor;Ljava/util/function/BiConsumer;)V", "GetReportCreateInterfaceImpact_IZLjava_util_concurrent_Executor_Ljava_util_function_BiConsumer_Handler", ApiSince=33)>]
abstract member ReportCreateInterfaceImpact : int * bool * Java.Util.Concurrent.IExecutor * Java.Util.Functions.IBiConsumer -> unit
override this.ReportCreateInterfaceImpact : int * bool * Java.Util.Concurrent.IExecutor * Java.Util.Functions.IBiConsumer -> unit

Parameters

interfaceType
Int32

The interface type whose possible creation is being queried.

requireNewInterface
Boolean

Indicates that the query is for a new interface of the specified type - an existing interface won't meet the query. Some operations (such as Wi-Fi Direct and Wi-Fi Aware are a shared resource and so may not need a new interface).

executor
IExecutor

An Executor on which to return the result.

resultCallback
IBiConsumer

The asynchronous callback which will return two argument: a boolean (whether the interface can be created), and a Set<InterfaceCreationImpact> (a set of InterfaceCreationImpact: interfaces which will be destroyed when the interface is created and the packages which requested them and thus may be impacted).

Attributes

Remarks

Queries the framework to determine whether the specified interface can be created, and if so - what other interfaces would be torn down by the framework to allow this creation if it were requested. The result is returned via the specified BiConsumer callback which returns two arguments: <li>First argument: a boolean - indicating whether or not the interface can be created.</li> <li>Second argument: a Set<InterfaceCreationImpact> - if the interface can be created (first argument is true then this is the set of interface types which will be removed and the packages which requested them. Possibly an empty set. If the first argument is false, then an empty set will be returned here.</li>

Interfaces, input and output, are specified using the WIFI_INTERFACE_* constants: #WIFI_INTERFACE_TYPE_STA, #WIFI_INTERFACE_TYPE_AP, #WIFI_INTERFACE_TYPE_AWARE, or #WIFI_INTERFACE_TYPE_DIRECT.

This method does not actually create the interface. That operation is handled by the framework when a particular service method is called. E.g. a Wi-Fi Direct interface may be created when various methods of android.net.wifi.p2p.WifiP2pManager are called, similarly for Wi-Fi Aware and android.net.wifi.aware.WifiAwareManager.

Note: the information returned via this method is the current snapshot of the system. It may change due to actions of the framework or other apps.

Java documentation for android.net.wifi.WifiManager.reportCreateInterfaceImpact(int, boolean, java.util.concurrent.Executor, java.util.function.BiConsumer<java.lang.Boolean, java.util.Set<android.net.wifi.WifiManager.InterfaceCreationImpact>>).

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