# BluetoothConfigManager

Summary:[Constants](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConfigManager#constants)\|[Methods](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConfigManager#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConfigManager#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConfigManager#)  

# BluetoothConfigManager

`
public


class
BluetoothConfigManager
`  
`

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


``


`

|---|------------------------------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | com.google.android.things.bluetooth.BluetoothConfigManager |

<br />

*** ** * ** ***

This class is used to control various configuration options for the Bluetooth stack.

For eg., it can be used to fetch or control the Bluetooth Class of Device

## Summary

|                                                                                                 ### Constants                                                                                                  ||
|-------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | [IO_CAPABILITY_IN](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConfigManager#IO_CAPABILITY_IN) Device only has a keyboard for entry but no display.            |
| `int` | [IO_CAPABILITY_IO](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConfigManager#IO_CAPABILITY_IO) Device has a display and the ability to input Yes/No.           |
| `int` | [IO_CAPABILITY_KBDISP](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConfigManager#IO_CAPABILITY_KBDISP) Device has a display and a full keyboard.               |
| `int` | [IO_CAPABILITY_NONE](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConfigManager#IO_CAPABILITY_NONE) Device has no Input or Output capability.                   |
| `int` | [IO_CAPABILITY_OUT](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConfigManager#IO_CAPABILITY_OUT) Device only has a display.                                    |
| `int` | [IO_CAPABILITY_UNKNOWN](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConfigManager#IO_CAPABILITY_UNKNOWN) The Input/Output capability of the device is unknown. |

|                                                                                                                                                                                                                                                  ### Public methods                                                                                                                                                                                                                                                   ||
|----------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` `[BluetoothClass](https://developer.android.com/reference/android/bluetooth/BluetoothClass.html)                                     | ` `[getBluetoothClass](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConfigManager#getBluetoothClass())`() ` Get current BluetoothClass (CoD) value of local Bluetooth adapter.                                                                                                                                                        |
| ` static `[BluetoothConfigManager](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConfigManager) | ` `[getInstance](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConfigManager#getInstance())`() ` Fetch an instance of[BluetoothConfigManager](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConfigManager)                                                                                      |
| ` int`                                                                                                                                 | ` `[getIoCapability](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConfigManager#getIoCapability())`() ` Returns the Input/Output capability of the device for classic Bluetooth.                                                                                                                                                      |
| ` int`                                                                                                                                 | ` `[getLeIoCapability](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConfigManager#getLeIoCapability())`() ` Returns the Input/Output capability of the device for BLE operations.                                                                                                                                                     |
| ` boolean`                                                                                                                             | ` `[setBluetoothClass](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConfigManager#setBluetoothClass(android.bluetooth.BluetoothClass))`(`[BluetoothClass](https://developer.android.com/reference/android/bluetooth/BluetoothClass.html)` bluetoothClass) ` Set the Bluetooth Class of Device (CoD) value of local Bluetooth adapter. |
| ` boolean`                                                                                                                             | ` `[setIoCapability](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConfigManager#setIoCapability(int))`(int capability) ` Sets the Input/Output capability of the device for classic Bluetooth.                                                                                                                                        |
| ` boolean`                                                                                                                             | ` `[setLeIoCapability](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConfigManager#setLeIoCapability(int))`(int capability) ` Sets the Input/Output capability of the device for BLE operations.                                                                                                                                       |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConfigManager#)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, int))`(long millis, int nanos) ` Causes the current thread to wait until another thread invokes the[notify()](https://developer.android.com/reference/java/lang/Object.html#notify())method or the[notifyAll()](https://developer.android.com/reference/java/lang/Object.html#notifyAll())method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long millis) ` Causes the current thread to wait until either another thread invokes the[notify()](https://developer.android.com/reference/java/lang/Object.html#notify())method or the[notifyAll()](https://developer.android.com/reference/java/lang/Object.html#notifyAll())method for this object, or a specified amount of time has elapsed.                                                                 | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until another thread invokes the[notify()](https://developer.android.com/reference/java/lang/Object.html#notify())method or the[notifyAll()](https://developer.android.com/reference/java/lang/Object.html#notifyAll())method for this object.                                                                                                                                  | ||

## Constants

### IO_CAPABILITY_IN

```
int IO_CAPABILITY_IN
```

Device only has a keyboard for entry but no display.

<br />

Constant Value: 2 (0x00000002)  

### IO_CAPABILITY_IO

```
int IO_CAPABILITY_IO
```

Device has a display and the ability to input Yes/No.

<br />

Constant Value: 1 (0x00000001)  

### IO_CAPABILITY_KBDISP

```
int IO_CAPABILITY_KBDISP
```

Device has a display and a full keyboard.

<br />

Constant Value: 4 (0x00000004)  

### IO_CAPABILITY_NONE

```
int IO_CAPABILITY_NONE
```

Device has no Input or Output capability.

<br />

Constant Value: 3 (0x00000003)  

### IO_CAPABILITY_OUT

```
int IO_CAPABILITY_OUT
```

Device only has a display.

<br />

Constant Value: 0 (0x00000000)  

### IO_CAPABILITY_UNKNOWN

```
int IO_CAPABILITY_UNKNOWN
```

The Input/Output capability of the device is unknown.

<br />

Constant Value: 255 (0x000000ff)

## Public methods

### getBluetoothClass

```
BluetoothClass getBluetoothClass ()
```

Get current BluetoothClass (CoD) value of local Bluetooth adapter.

<br />

|                                                                      Returns                                                                       ||
|-------------------------------------------------------------------------------------------------|---------------------------------------------------|
| [BluetoothClass](https://developer.android.com/reference/android/bluetooth/BluetoothClass.html) | BluetoothClass of local Bluetooth adapter. <br /> |

|                                                                    Throws                                                                     ||
|--------------------------------------------------------------------------------------------------|---------------------------------------------|
| [IllegalStateException](https://developer.android.com/reference/java/lang/IllegalStateException) | when the connection to the server has died. |

**See also:**

- [Bluetooth CoD](https://www.bluetooth.com/specifications/assigned-numbers/baseband)  

### getInstance

```
BluetoothConfigManager getInstance ()
```

Fetch an instance of[BluetoothConfigManager](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConfigManager)

<br />

|                                                               Returns                                                                ||
|------------------------------------------------------------------------------------------------------------------------------|--------|
| [BluetoothConfigManager](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConfigManager) | <br /> |

|                                                                              Throws                                                                              ||
|--------------------------------------------------------------------------------------------------|----------------------------------------------------------------|
| [IllegalStateException](https://developer.android.com/reference/java/lang/IllegalStateException) | if a connection cannot be established to the back-end service. |

### getIoCapability

```
int getIoCapability ()
```

Returns the Input/Output capability of the device for classic Bluetooth.

<br />

|                                                                                                                                                                                                                                                                                                                                                                                                                                                               Returns                                                                                                                                                                                                                                                                                                                                                                                                                                                                ||
|-------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | Input/Output capability of the device. One of[IO_CAPABILITY_OUT](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConfigManager#IO_CAPABILITY_OUT),[IO_CAPABILITY_IO](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConfigManager#IO_CAPABILITY_IO),[IO_CAPABILITY_IN](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConfigManager#IO_CAPABILITY_IN),[IO_CAPABILITY_NONE](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConfigManager#IO_CAPABILITY_NONE),[IO_CAPABILITY_KBDISP](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConfigManager#IO_CAPABILITY_KBDISP)or[IO_CAPABILITY_UNKNOWN](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConfigManager#IO_CAPABILITY_UNKNOWN). <br /> |

### getLeIoCapability

```
int getLeIoCapability ()
```

Returns the Input/Output capability of the device for BLE operations.

<br />

|                                                                                                                                                                                                                                                                                                                                                                                                                                                               Returns                                                                                                                                                                                                                                                                                                                                                                                                                                                                ||
|-------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | Input/Output capability of the device. One of[IO_CAPABILITY_OUT](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConfigManager#IO_CAPABILITY_OUT),[IO_CAPABILITY_IO](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConfigManager#IO_CAPABILITY_IO),[IO_CAPABILITY_IN](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConfigManager#IO_CAPABILITY_IN),[IO_CAPABILITY_NONE](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConfigManager#IO_CAPABILITY_NONE),[IO_CAPABILITY_KBDISP](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConfigManager#IO_CAPABILITY_KBDISP)or[IO_CAPABILITY_UNKNOWN](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConfigManager#IO_CAPABILITY_UNKNOWN). <br /> |

### setBluetoothClass

```
boolean setBluetoothClass (BluetoothClass bluetoothClass)
```

Set the Bluetooth Class of Device (CoD) value of local Bluetooth adapter.

<br />

|                                                                              Parameters                                                                               ||
|------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|
| `bluetoothClass` | `BluetoothClass`:[BluetoothClass](https://developer.android.com/reference/android/bluetooth/BluetoothClass.html)to set the local adapter to. <br /> |

|                Returns                ||
|-----------|----------------------------|
| `boolean` | result of operation <br /> |

|                                                                       Throws                                                                        ||
|--------------------------------------------------------------------------------------------------------|---------------------------------------------|
| [IllegalArgumentException](https://developer.android.com/reference/java/lang/IllegalArgumentException) | when BluetoothClass is null.                |
| [IllegalStateException](https://developer.android.com/reference/java/lang/IllegalStateException)       | when the connection to the server has died. |

**See also:**

- [Bluetooth CoD](https://www.bluetooth.com/specifications/assigned-numbers/baseband)
- [BluetoothClassFactory](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothClassFactory)  

### setIoCapability

```
boolean setIoCapability (int capability)
```

Sets the Input/Output capability of the device for classic Bluetooth.

Changing the Input/Output capability of a device only takes effect on restarting the Bluetooth stack. You would need to restart the stack using[disable()](https://developer.android.com/reference/android/bluetooth/BluetoothAdapter.html#disable())and[enable()](https://developer.android.com/reference/android/bluetooth/BluetoothAdapter.html#enable())to see the changes.

<br />

|                                                                                                                                                                                                                                                                                                                                                                                            Parameters                                                                                                                                                                                                                                                                                                                                                                                            ||
|--------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `capability` | `int`: Input/Output capability of the device. One of[IO_CAPABILITY_OUT](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConfigManager#IO_CAPABILITY_OUT),[IO_CAPABILITY_IO](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConfigManager#IO_CAPABILITY_IO),[IO_CAPABILITY_IN](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConfigManager#IO_CAPABILITY_IN),[IO_CAPABILITY_NONE](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConfigManager#IO_CAPABILITY_NONE)or[IO_CAPABILITY_KBDISP](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConfigManager#IO_CAPABILITY_KBDISP). <br /> |

|                Returns                ||
|-----------|----------------------------|
| `boolean` | result of operation <br /> |

|                                                               Throws                                                                ||
|--------------------------------------------------------------------------------------------------------|-----------------------------|
| [IllegalArgumentException](https://developer.android.com/reference/java/lang/IllegalArgumentException) | when capability is invalid. |

### setLeIoCapability

```
boolean setLeIoCapability (int capability)
```

Sets the Input/Output capability of the device for BLE operations.

Changing the Input/Output capability of a device only takes effect on restarting the Bluetooth stack. You would need to restart the stack using[disable()](https://developer.android.com/reference/android/bluetooth/BluetoothAdapter.html#disable())and[enable()](https://developer.android.com/reference/android/bluetooth/BluetoothAdapter.html#enable())to see the changes.

<br />

|                                                                                                                                                                                                                                                                                                                                                                                            Parameters                                                                                                                                                                                                                                                                                                                                                                                            ||
|--------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `capability` | `int`: Input/Output capability of the device. One of[IO_CAPABILITY_OUT](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConfigManager#IO_CAPABILITY_OUT),[IO_CAPABILITY_IO](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConfigManager#IO_CAPABILITY_IO),[IO_CAPABILITY_IN](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConfigManager#IO_CAPABILITY_IN),[IO_CAPABILITY_NONE](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConfigManager#IO_CAPABILITY_NONE)or[IO_CAPABILITY_KBDISP](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConfigManager#IO_CAPABILITY_KBDISP). <br /> |

|                Returns                ||
|-----------|----------------------------|
| `boolean` | result of operation <br /> |

|                                                               Throws                                                                ||
|--------------------------------------------------------------------------------------------------------|-----------------------------|
| [IllegalArgumentException](https://developer.android.com/reference/java/lang/IllegalArgumentException) | when capability is invalid. |

-

  ## Interfaces

  - [BluetoothConnectionCallback](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConnectionCallback)
  - [BluetoothPairingCallback](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothPairingCallback)
-

  ## Classes

  - [BluetoothClassFactory](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothClassFactory)
  - [BluetoothConfigManager](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConfigManager)
  - [BluetoothConnectionManager](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothConnectionManager)
  - [BluetoothPairingCallback.PairingError](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothPairingCallback.PairingError)
  - [BluetoothProfile](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothProfile)
  - [BluetoothProfileManager](https://developer.android.com/reference/com/google/android/things/bluetooth/BluetoothProfileManager)
  - [ConnectionParams](https://developer.android.com/reference/com/google/android/things/bluetooth/ConnectionParams)
  - [PairingParams](https://developer.android.com/reference/com/google/android/things/bluetooth/PairingParams)