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

# BluetoothProfile.ServiceListener

*** ** * ** ***

` public static interface BluetoothProfile.ServiceListener `   
` `

|---|
| android.bluetooth.BluetoothProfile.ServiceListener |

<br />

*** ** * ** ***

An interface for notifying BluetoothProfile IPC clients when they have been connected or disconnected to the service.

## Summary

| ### Public methods ||
|---|---|
| ` abstract void` | ` https://developer.android.com/reference/android/bluetooth/BluetoothProfile.ServiceListener#onServiceConnected(int,%20android.bluetooth.BluetoothProfile)(int profile, https://developer.android.com/reference/android/bluetooth/BluetoothProfile proxy) ` Called to notify the client when the proxy object has been connected to the service. |
| ` abstract void` | ` https://developer.android.com/reference/android/bluetooth/BluetoothProfile.ServiceListener#onServiceDisconnected(int)(int profile) ` Called to notify the client that this proxy object has been disconnected from the service. |

## Public methods

### onServiceConnected

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

```
public abstract void onServiceConnected (int profile, 
                BluetoothProfile proxy)
```

Called to notify the client when the proxy object has been connected to the service.

<br />

| Parameters ||
|---|---|
| `profile` | `int`: - One of `https://developer.android.com/reference/android/bluetooth/BluetoothProfile#HEADSET` or `https://developer.android.com/reference/android/bluetooth/BluetoothProfile#A2DP` <br /> |
| `proxy` | `BluetoothProfile`: - One of `https://developer.android.com/reference/android/bluetooth/BluetoothHeadset` or `https://developer.android.com/reference/android/bluetooth/BluetoothA2dp` <br /> |

### onServiceDisconnected

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

```
public abstract void onServiceDisconnected (int profile)
```

Called to notify the client that this proxy object has been disconnected from the service.

<br />

| Parameters ||
|---|---|
| `profile` | `int`: - One of `https://developer.android.com/reference/android/bluetooth/BluetoothProfile#HEADSET` or `https://developer.android.com/reference/android/bluetooth/BluetoothProfile#A2DP` <br /> |