Characteristics


public final class Characteristics
extends Object implements Parcelable

java.lang.Object
   ↳ android.net.wifi.aware.Characteristics


The characteristics of the Wi-Fi Aware implementation.

Summary

Constants

int WIFI_AWARE_CIPHER_SUITE_NCS_PK_128

Wi-Fi Aware supported cipher suite representing NCS PK 2WDH 128: 128 bit public-key.

int WIFI_AWARE_CIPHER_SUITE_NCS_PK_256

Wi-Fi Aware supported cipher suite representing NCS 2WDH 256: 256 bit public-key.

int WIFI_AWARE_CIPHER_SUITE_NCS_PK_PASN_128

Wi-Fi Aware supported cipher suite representing NCS PASN 128: 128 bit public-key.

int WIFI_AWARE_CIPHER_SUITE_NCS_PK_PASN_256

Wi-Fi Aware supported cipher suite representing NCS PASN 256: 256 bit public-key.

int WIFI_AWARE_CIPHER_SUITE_NCS_SK_128

Wi-Fi Aware supported cipher suite representing NCS SK 128: 128 bit shared-key.

int WIFI_AWARE_CIPHER_SUITE_NCS_SK_256

Wi-Fi Aware supported cipher suite representing NCS SK 256: 256 bit shared-key.

int WIFI_AWARE_CIPHER_SUITE_NONE

Wi-Fi Aware supported open (unencrypted) data-path.

Inherited constants

Fields

public static final Creator<Characteristics> CREATOR

Public methods

int describeContents()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

int getMaxMatchFilterLength()

Returns the maximum length of byte array that can be used to specify a Aware match filter.

int getMaxServiceNameLength()

Returns the maximum string length that can be used to specify a Aware service name.

int getMaxServiceSpecificInfoLength()

Returns the maximum length of byte array that can be used to specify a Aware service specific information field: the arbitrary load used in discovery or the message length of Aware message exchange.

int getNumberOfSupportedDataInterfaces()

Returns the maximum number of Aware data interfaces supported by the device.

int getNumberOfSupportedDataPaths()

Returns the maximum number of Aware data paths(also known as NDPs - NAN Data Paths) supported by the device.

int getNumberOfSupportedPublishSessions()

Returns the maximum number of Aware publish sessions supported by the device.

int getNumberOfSupportedSubscribeSessions()

Returns the maximum number of Aware subscribe session supported by the device.

int getSupportedCipherSuites()

Returns the set of cipher suites supported by the device for use in Wi-Fi Aware data-paths.

int getSupportedPairingCipherSuites()

Returns the set of cipher suites supported by the device for use in Wi-Fi Aware pairing.

boolean isAwarePairingSupported()

Check if the Aware Pairing is supported.

boolean isInstantCommunicationModeSupported()

Check if instant communication mode is supported by device.

boolean isSuspensionSupported()

Check if Aware Suspension is supported.

void writeToParcel(Parcel dest, int flags)

Flatten this object in to a Parcel.

Inherited methods

Constants

WIFI_AWARE_CIPHER_SUITE_NCS_PK_128

Added in API level 33
public static final int WIFI_AWARE_CIPHER_SUITE_NCS_PK_128

Wi-Fi Aware supported cipher suite representing NCS PK 2WDH 128: 128 bit public-key.

Constant Value: 4 (0x00000004)

WIFI_AWARE_CIPHER_SUITE_NCS_PK_256

Added in API level 33
public static final int WIFI_AWARE_CIPHER_SUITE_NCS_PK_256

Wi-Fi Aware supported cipher suite representing NCS 2WDH 256: 256 bit public-key.

Constant Value: 8 (0x00000008)

WIFI_AWARE_CIPHER_SUITE_NCS_PK_PASN_128

Added in API level 34
public static final int WIFI_AWARE_CIPHER_SUITE_NCS_PK_PASN_128

Wi-Fi Aware supported cipher suite representing NCS PASN 128: 128 bit public-key.

Constant Value: 16 (0x00000010)

WIFI_AWARE_CIPHER_SUITE_NCS_PK_PASN_256

Added in API level 34
public static final int WIFI_AWARE_CIPHER_SUITE_NCS_PK_PASN_256

Wi-Fi Aware supported cipher suite representing NCS PASN 256: 256 bit public-key.

Constant Value: 32 (0x00000020)

WIFI_AWARE_CIPHER_SUITE_NCS_SK_128

Added in API level 30
public static final int WIFI_AWARE_CIPHER_SUITE_NCS_SK_128

Wi-Fi Aware supported cipher suite representing NCS SK 128: 128 bit shared-key.

Constant Value: 1 (0x00000001)

WIFI_AWARE_CIPHER_SUITE_NCS_SK_256

Added in API level 30
public static final int WIFI_AWARE_CIPHER_SUITE_NCS_SK_256

Wi-Fi Aware supported cipher suite representing NCS SK 256: 256 bit shared-key.

Constant Value: 2 (0x00000002)

WIFI_AWARE_CIPHER_SUITE_NONE

Added in API level 33
public static final int WIFI_AWARE_CIPHER_SUITE_NONE

Wi-Fi Aware supported open (unencrypted) data-path.

Constant Value: 0 (0x00000000)

Fields

CREATOR

Added in API level 26
public static final Creator<Characteristics> CREATOR

Public methods

describeContents

Added in API level 26
public int describeContents ()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(android.os.Parcel, int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Returns
int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or CONTENTS_FILE_DESCRIPTOR

getMaxMatchFilterLength

Added in API level 26
public int getMaxMatchFilterLength ()

Returns the maximum length of byte array that can be used to specify a Aware match filter. Restricts the parameters of the PublishConfig.Builder#setMatchFilter(java.util.List) and SubscribeConfig.Builder#setMatchFilter(java.util.List).

Returns
int A positive integer, maximum length of byte array for Aware discovery match filter.

getMaxServiceNameLength

Added in API level 26
public int getMaxServiceNameLength ()

Returns the maximum string length that can be used to specify a Aware service name. Restricts the parameters of the PublishConfig.Builder#setServiceName(String) and SubscribeConfig.Builder#setServiceName(String).

Returns
int A positive integer, maximum string length of Aware service name.

getMaxServiceSpecificInfoLength

Added in API level 26
public int getMaxServiceSpecificInfoLength ()

Returns the maximum length of byte array that can be used to specify a Aware service specific information field: the arbitrary load used in discovery or the message length of Aware message exchange. Restricts the parameters of the PublishConfig.Builder#setServiceSpecificInfo(byte[]), SubscribeConfig.Builder#setServiceSpecificInfo(byte[]), and DiscoverySession#sendMessage(PeerHandle, int, byte[]) variants.

Returns
int A positive integer, maximum length of byte array for Aware messaging.

getNumberOfSupportedDataInterfaces

Added in API level 33
public int getNumberOfSupportedDataInterfaces ()

Returns the maximum number of Aware data interfaces supported by the device.

Returns
int A positive integer, maximum number of Aware data interfaces supported by the device. Value is 1 or greater

getNumberOfSupportedDataPaths

Added in API level 33
public int getNumberOfSupportedDataPaths ()

Returns the maximum number of Aware data paths(also known as NDPs - NAN Data Paths) supported by the device. Use AwareResources#getAvailableDataPathsCount() to get the number of available Aware data paths which are not currently used by any app.

Returns
int A positive integer, maximum number of Aware data paths supported by the device. Value is 1 or greater

getNumberOfSupportedPublishSessions

Added in API level 33
public int getNumberOfSupportedPublishSessions ()

Returns the maximum number of Aware publish sessions supported by the device. Use AwareResources#getAvailablePublishSessionsCount() to get the number of available publish sessions which are not currently used by any app.

Returns
int A positive integer, maximum number of publish sessions supported by the device. Value is 1 or greater

getNumberOfSupportedSubscribeSessions

Added in API level 33
public int getNumberOfSupportedSubscribeSessions ()

Returns the maximum number of Aware subscribe session supported by the device. Use AwareResources#getAvailableSubscribeSessionsCount() to get the number of available subscribe sessions which are not currently used by any app.

Returns
int A positive integer, maximum number of subscribe sessions supported by the device. Value is 1 or greater

getSupportedCipherSuites

Added in API level 30
public int getSupportedCipherSuites ()

Returns the set of cipher suites supported by the device for use in Wi-Fi Aware data-paths. The device automatically picks the strongest cipher suite when initiating a data-path setup.

Returns
int A set of flags from WIFI_AWARE_CIPHER_SUITE_NCS_SK_128, WIFI_AWARE_CIPHER_SUITE_NCS_SK_256, WIFI_AWARE_CIPHER_SUITE_NCS_PK_128, or WIFI_AWARE_CIPHER_SUITE_NCS_PK_256 Value is either 0 or a combination of WIFI_AWARE_CIPHER_SUITE_NONE, WIFI_AWARE_CIPHER_SUITE_NCS_SK_128, WIFI_AWARE_CIPHER_SUITE_NCS_SK_256, WIFI_AWARE_CIPHER_SUITE_NCS_PK_128, and WIFI_AWARE_CIPHER_SUITE_NCS_PK_256

getSupportedPairingCipherSuites

Added in API level 34
public int getSupportedPairingCipherSuites ()

Returns the set of cipher suites supported by the device for use in Wi-Fi Aware pairing.

Returns
int A set of flags from WIFI_AWARE_CIPHER_SUITE_NCS_PK_PASN_256, or WIFI_AWARE_CIPHER_SUITE_NCS_PK_PASN_256 Value is either 0 or a combination of WIFI_AWARE_CIPHER_SUITE_NCS_PK_PASN_128, and WIFI_AWARE_CIPHER_SUITE_NCS_PK_PASN_256

isAwarePairingSupported

Added in API level 34
public boolean isAwarePairingSupported ()

Check if the Aware Pairing is supported. The Aware Pairing is defined as per Wi-Fi Alliance (WFA) Wi-Fi Aware specifications version 4.0 Section 7.6.

Returns
boolean True if supported, false otherwise.

isInstantCommunicationModeSupported

Added in API level 31
public boolean isInstantCommunicationModeSupported ()

Check if instant communication mode is supported by device. The instant communication mode is defined as per Wi-Fi Alliance (WFA) Wi-Fi Aware specifications version 3.1 Section 12.3.

Returns
boolean True if supported, false otherwise.

isSuspensionSupported

Added in API level 34
public boolean isSuspensionSupported ()

Check if Aware Suspension is supported. Aware Suspension is a mechanism of putting an Aware connection in and out of a low-power mode while preserving the discovery sessions and data paths.

Returns
boolean True if supported, false otherwise.

writeToParcel

Added in API level 26
public void writeToParcel (Parcel dest, 
                int flags)

Flatten this object in to a Parcel.

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.PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of Parcelable.PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES