enableWifi method

void enableWifi(
  1. int duration
)

Initialises the underlying Wi-Fi data structures.

Note: It is not possible to enable/disable Wi-Fi starting with Build.VERSION_CODES#Q. https://developer.android.com/reference/android/net/wifi/WifiManager#setWifiEnabled(boolean)

The device is set into discovery mode for duration ms.

Throws an BadDurationException if the given duration exceeds 3600 seconds or is negative.

Implementation

void enableWifi(int duration) {
  _datalinkManager.enable(duration, WIFI);
}