# ServiceDiscoveryInfo

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Methods](https://developer.android.com/reference/android/net/wifi/aware/ServiceDiscoveryInfo#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/net/wifi/aware/ServiceDiscoveryInfo#inhmethods)  

# ServiceDiscoveryInfo

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/net/wifi/aware/ServiceDiscoveryInfo "View this page in Kotlin")\|Java

`
public

final

class
ServiceDiscoveryInfo
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


`

|---|---------------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.net.wifi.aware.ServiceDiscoveryInfo |

<br />

*** ** * ** ***

An object providing information about a Wi-Fi Aware discovery session with a specific peer.  
**See also:**

- [DiscoverySessionCallback.onServiceDiscovered(ServiceDiscoveryInfo)](https://developer.android.com/reference/android/net/wifi/aware/DiscoverySessionCallback#onServiceDiscovered(android.net.wifi.aware.ServiceDiscoveryInfo))
- [DiscoverySessionCallback.onServiceDiscoveredWithinRange(ServiceDiscoveryInfo, int)](https://developer.android.com/reference/android/net/wifi/aware/DiscoverySessionCallback#onServiceDiscoveredWithinRange(android.net.wifi.aware.ServiceDiscoveryInfo,%20int))

## Summary

|                                                                                                                                                                               ### Public methods                                                                                                                                                                                ||
|------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` `[List](https://developer.android.com/reference/java/util/List)`<byte[]>`                                | ` `[getMatchFilters](https://developer.android.com/reference/android/net/wifi/aware/ServiceDiscoveryInfo#getMatchFilters())`() ` Get the filter which resulted in this service discovery.                                                                           |
| ` `[String](https://developer.android.com/reference/java/lang/String)                                      | ` `[getPairedAlias](https://developer.android.com/reference/android/net/wifi/aware/ServiceDiscoveryInfo#getPairedAlias())`() ` Get the paired device alias if the discovered device has already paired.                                                             |
| ` `[AwarePairingConfig](https://developer.android.com/reference/android/net/wifi/aware/AwarePairingConfig) | ` `[getPairingConfig](https://developer.android.com/reference/android/net/wifi/aware/ServiceDiscoveryInfo#getPairingConfig())`() ` Get the discovered device's pairing config.                                                                                      |
| ` int`                                                                                                     | ` `[getPeerCipherSuite](https://developer.android.com/reference/android/net/wifi/aware/ServiceDiscoveryInfo#getPeerCipherSuite())`() ` Get the cipher suite type specified by the publish session to be used for data-path setup.                                   |
| ` `[PeerHandle](https://developer.android.com/reference/android/net/wifi/aware/PeerHandle)                 | ` `[getPeerHandle](https://developer.android.com/reference/android/net/wifi/aware/ServiceDiscoveryInfo#getPeerHandle())`() ` Get the peer handle for the peer matching our discovery operation                                                                      |
| ` byte[]`                                                                                                  | ` `[getScid](https://developer.android.com/reference/android/net/wifi/aware/ServiceDiscoveryInfo#getScid())`() ` Get the Security context identifier is associate with PMK for data path security config.                                                           |
| ` byte[]`                                                                                                  | ` `[getServiceSpecificInfo](https://developer.android.com/reference/android/net/wifi/aware/ServiceDiscoveryInfo#getServiceSpecificInfo())`() ` The service specific information (arbitrary byte array) provided by the peer as part of its discovery configuration. |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||

## Public methods

### getMatchFilters

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public List<byte[]> getMatchFilters ()
```

Get the filter which resulted in this service discovery. For[PublishConfig.PUBLISH_TYPE_UNSOLICITED](https://developer.android.com/reference/android/net/wifi/aware/PublishConfig#PUBLISH_TYPE_UNSOLICITED),[SubscribeConfig.SUBSCRIBE_TYPE_PASSIVE](https://developer.android.com/reference/android/net/wifi/aware/SubscribeConfig#SUBSCRIBE_TYPE_PASSIVE)discovery sessions this is the publisher's match filter. For[PublishConfig.PUBLISH_TYPE_SOLICITED](https://developer.android.com/reference/android/net/wifi/aware/PublishConfig#PUBLISH_TYPE_SOLICITED),[SubscribeConfig.SUBSCRIBE_TYPE_ACTIVE](https://developer.android.com/reference/android/net/wifi/aware/SubscribeConfig#SUBSCRIBE_TYPE_ACTIVE)discovery sessions this is the subscriber's match filter.

<br />

|                                                                                                   Returns                                                                                                   ||
|--------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|
| [List](https://developer.android.com/reference/java/util/List)`<byte[]>` | A list of byte arrays representing the match filter. An empty list if match filter is not set. This value cannot be`null`. <br /> |

### getPairedAlias

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public String getPairedAlias ()
```

Get the paired device alias if the discovered device has already paired. If not null device will automatically start the NAN pairing verification,[DiscoverySessionCallback.onPairingVerificationSucceed(PeerHandle, String)](https://developer.android.com/reference/android/net/wifi/aware/DiscoverySessionCallback#onPairingVerificationSucceed(android.net.wifi.aware.PeerHandle,%20java.lang.String))will trigger when verification is finished

<br />

|                                  Returns                                   ||
|--------------------------------------------------------------------|--------|
| [String](https://developer.android.com/reference/java/lang/String) | <br /> |

### getPairingConfig

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public AwarePairingConfig getPairingConfig ()
```

Get the discovered device's pairing config. Can be used for the following pairing setup or bootstrapping request.

<br />

|                                                                 Returns                                                                  ||
|---------------------------------------------------------------------------------------------------------|---------------------------------|
| [AwarePairingConfig](https://developer.android.com/reference/android/net/wifi/aware/AwarePairingConfig) | This value may be`null`. <br /> |

**See also:**

- [AwarePairingConfig](https://developer.android.com/reference/android/net/wifi/aware/AwarePairingConfig)  

### getPeerCipherSuite

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public int getPeerCipherSuite ()
```

Get the cipher suite type specified by the publish session to be used for data-path setup.

<br />

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 Returns                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 ||
|-------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | peerCipherSuite An integer represent the cipher suite used to encrypt the data-path. Value is either`0`or a combination of[Characteristics.WIFI_AWARE_CIPHER_SUITE_NONE](https://developer.android.com/reference/android/net/wifi/aware/Characteristics#WIFI_AWARE_CIPHER_SUITE_NONE),[Characteristics.WIFI_AWARE_CIPHER_SUITE_NCS_SK_128](https://developer.android.com/reference/android/net/wifi/aware/Characteristics#WIFI_AWARE_CIPHER_SUITE_NCS_SK_128),[Characteristics.WIFI_AWARE_CIPHER_SUITE_NCS_SK_256](https://developer.android.com/reference/android/net/wifi/aware/Characteristics#WIFI_AWARE_CIPHER_SUITE_NCS_SK_256),[Characteristics.WIFI_AWARE_CIPHER_SUITE_NCS_PK_128](https://developer.android.com/reference/android/net/wifi/aware/Characteristics#WIFI_AWARE_CIPHER_SUITE_NCS_PK_128), and[Characteristics.WIFI_AWARE_CIPHER_SUITE_NCS_PK_256](https://developer.android.com/reference/android/net/wifi/aware/Characteristics#WIFI_AWARE_CIPHER_SUITE_NCS_PK_256) <br /> |

### getPeerHandle

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public PeerHandle getPeerHandle ()
```

Get the peer handle for the peer matching our discovery operation

<br />

|                                                                                    Returns                                                                                     ||
|-----------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------|
| [PeerHandle](https://developer.android.com/reference/android/net/wifi/aware/PeerHandle) | An opaque handle representing the discovered peer. This value cannot be`null`. <br /> |

### getScid

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public byte[] getScid ()
```

Get the Security context identifier is associate with PMK for data path security config. Only use for[Characteristics.WIFI_AWARE_CIPHER_SUITE_NCS_PK_128](https://developer.android.com/reference/android/net/wifi/aware/Characteristics#WIFI_AWARE_CIPHER_SUITE_NCS_PK_128)and[Characteristics.WIFI_AWARE_CIPHER_SUITE_NCS_PK_256](https://developer.android.com/reference/android/net/wifi/aware/Characteristics#WIFI_AWARE_CIPHER_SUITE_NCS_PK_256)to get the PMKID set by[WifiAwareDataPathSecurityConfig.Builder.setPmkId(byte[])](https://developer.android.com/reference/android/net/wifi/aware/WifiAwareDataPathSecurityConfig.Builder#setPmkId(byte[]))from publish session. This can help the Wi-Fi Aware data-path setup to select the correct PMK/PMKID

<br />

|                                                               Returns                                                               ||
|----------|---------------------------------------------------------------------------------------------------------------------------|
| `byte[]` | An arbitrary byte array represent the security context identifier.`null`if Security context identifier is not set. <br /> |

### getServiceSpecificInfo

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public byte[] getServiceSpecificInfo ()
```

The service specific information (arbitrary byte array) provided by the peer as part of its discovery configuration.

<br />

|                                                                Returns                                                                ||
|----------|-----------------------------------------------------------------------------------------------------------------------------|
| `byte[]` | An arbitrary byte array represent the service specific information.`null`if service specific information is not set. <br /> |

**See also:**

- [PublishConfig.Builder.setServiceSpecificInfo(byte[])](https://developer.android.com/reference/android/net/wifi/aware/PublishConfig.Builder#setServiceSpecificInfo(byte[]))
- [SubscribeConfig.Builder.setServiceSpecificInfo(byte[])](https://developer.android.com/reference/android/net/wifi/aware/SubscribeConfig.Builder#setServiceSpecificInfo(byte[]))