Channel

open class Channel : AutoCloseable
kotlin.Any
   ↳ android.net.wifi.p2p.WifiP2pManager.Channel

A channel that connects the application to the Wifi p2p framework. Most p2p operations require a Channel as an argument. An instance of Channel is obtained by doing a call on #initialize
Requires API level 14 (Android 4.0, IceCreamSandwich)

Summary

Public methods
open Unit

Close the current P2P connection and indicate to the P2P service that connections created by the app can be removed.

Public methods

close

added in API level 27
open fun close(): Unit

Close the current P2P connection and indicate to the P2P service that connections created by the app can be removed.
Requires API level 27 (Android 8.1, Oreo)

Exceptions
Exception if this resource cannot be closed