Added in API level 26

PublishConfig


class PublishConfig : Parcelable
kotlin.Any
   ↳ android.net.wifi.aware.PublishConfig

Defines the configuration of an Aware publish session. Built using PublishConfig.Builder. A publish session is created using WifiAwareSession.publish(PublishConfig, DiscoverySessionCallback, or updated using PublishDiscoverySession.updatePublish(PublishConfig).

Summary

Nested classes

Builder used to build PublishConfig objects.

Constants
static Int

Defines a solicited publish session - a publish session which is silent, waiting for a matching active subscribe session - and responding to it in unicast.

static Int

Defines an unsolicited publish session - a publish session where the publisher is advertising itself by broadcasting on-the-air.

Inherited constants
Public methods
Int

Boolean
equals(other: Any?)

Int

Get the Wi-Fi band for instant communication mode for this publish session

AwarePairingConfig?

Get the Aware Pairing config for this publish session

WifiAwareDataPathSecurityConfig?

Get the data-path security config for this publish session

Int

Boolean

Check if instant communication mode is enabled for this publish session.

String

Unit
writeToParcel(dest: Parcel, flags: Int)

Properties
static Parcelable.Creator<PublishConfig!>

Constants

PUBLISH_TYPE_SOLICITED

Added in API level 26
static val PUBLISH_TYPE_SOLICITED: Int

Defines a solicited publish session - a publish session which is silent, waiting for a matching active subscribe session - and responding to it in unicast. A solicited publish session is paired with an active subscribe session SubscribeConfig.SUBSCRIBE_TYPE_ACTIVE. Configuration is done using PublishConfig.Builder.setPublishType(int).

Value: 1

PUBLISH_TYPE_UNSOLICITED

Added in API level 26
static val PUBLISH_TYPE_UNSOLICITED: Int

Defines an unsolicited publish session - a publish session where the publisher is advertising itself by broadcasting on-the-air. An unsolicited publish session is paired with a passive subscribe session SubscribeConfig.SUBSCRIBE_TYPE_PASSIVE. Configuration is done using PublishConfig.Builder.setPublishType(int).

Value: 0

Public methods

describeContents

Added in API level 26
fun describeContents(): Int
Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR

equals

Added in API level 26
fun equals(other: Any?): Boolean
Parameters
obj the reference object with which to compare.
Return
Boolean true if this object is the same as the obj argument; false otherwise.

getInstantCommunicationBand

Added in API level 33
fun getInstantCommunicationBand(): Int

Get the Wi-Fi band for instant communication mode for this publish session

Return
Int The Wi-Fi band. If instant communication mode is not enabled will return android.net.wifi.ScanResult#WIFI_BAND_24_GHZ as default. Value is android.net.wifi.ScanResult#WIFI_BAND_24_GHZ, or android.net.wifi.ScanResult#WIFI_BAND_5_GHZ

getPairingConfig

Added in API level 34
fun getPairingConfig(): AwarePairingConfig?

Get the Aware Pairing config for this publish session

Return
AwarePairingConfig? A AwarePairingConfig specified in this config. This value may be null.

getSecurityConfig

Added in API level 33
fun getSecurityConfig(): WifiAwareDataPathSecurityConfig?

Get the data-path security config for this publish session

Return
WifiAwareDataPathSecurityConfig? A WifiAwareDataPathSecurityConfig specified in this config. This value may be null.

hashCode

Added in API level 26
fun hashCode(): Int
Return
Int a hash code value for this object.

isInstantCommunicationModeEnabled

Added in API level 33
fun isInstantCommunicationModeEnabled(): Boolean

Check if instant communication mode is enabled for this publish session.

Return
Boolean true for enabled, false otherwise.

toString

Added in API level 26
fun toString(): String
Return
String a string representation of the object.

writeToParcel

Added in API level 26
fun writeToParcel(
    dest: Parcel,
    flags: Int
): Unit
Parameters
dest Parcel: The Parcel in which the object should be written. This value cannot be null.
flags Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES

Properties

CREATOR

Added in API level 26
static val CREATOR: Parcelable.Creator<PublishConfig!>