Added in API level 26

LocalOnlyHotspotReservation


open class LocalOnlyHotspotReservation : AutoCloseable
kotlin.Any
   ↳ android.net.wifi.WifiManager.LocalOnlyHotspotReservation

LocalOnlyHotspotReservation that contains the SoftApConfiguration for the active LocalOnlyHotspot request.

Applications requesting LocalOnlyHotspot for sharing will receive an instance of the LocalOnlyHotspotReservation in the LocalOnlyHotspotCallback.onStarted(LocalOnlyHotspotReservation) call. This reservation contains the relevant SoftApConfiguration. When an application is done with the LocalOnlyHotspot, they should call android.net.wifi.WifiManager.LocalOnlyHotspotReservation#close(). Once this happens, the application will not receive any further callbacks. If the LocalOnlyHotspot is stopped due to a user triggered mode change, applications will be notified via the android.net.wifi.WifiManager.LocalOnlyHotspotCallback#onStopped() callback.

Summary

Public methods
open Unit

open SoftApConfiguration

Returns the SoftApConfiguration of the current Local Only Hotspot (LOHS).

open WifiConfiguration?

Returns the WifiConfiguration of the current Local Only Hotspot (LOHS).

Protected methods
open Unit

Public methods

close

Added in API level 26
open fun close(): Unit
Exceptions
java.lang.Exception if this resource cannot be closed

getSoftApConfiguration

Added in API level 30
open fun getSoftApConfiguration(): SoftApConfiguration

Returns the SoftApConfiguration of the current Local Only Hotspot (LOHS).

Return
SoftApConfiguration This value cannot be null.

getWifiConfiguration

Added in API level 26
Deprecated in API level 30
open fun getWifiConfiguration(): WifiConfiguration?

Deprecated: Use WifiManager#getSoftApConfiguration() to get the LOHS configuration.

Returns the WifiConfiguration of the current Local Only Hotspot (LOHS). May be null if hotspot enabled and security type is not WifiConfiguration.KeyMgmt.None or WifiConfiguration.KeyMgmt.WPA2_PSK.

Protected methods

finalize

Added in API level 26
protected open fun finalize(): Unit
Exceptions
java.lang.Throwable the Exception raised by this method