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

# Builder

*** ** * ** ***

```
class Builder
```

|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||
| ↳ | [android.companion.OutOfBandPairingRequest.Builder](https://developer.android.com/reference/kotlin/android/companion/OutOfBandPairingRequest.Builder#) |

A builder for creating `https://developer.android.com/reference/kotlin/android/companion/OutOfBandPairingRequest`.

## Summary

| Public constructors ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/companion/OutOfBandPairingRequest.Builder#Builder()()` <br /> |

| Public methods ||
|---|---|
| [OutOfBandPairingRequest](https://developer.android.com/reference/kotlin/android/companion/OutOfBandPairingRequest) | `https://developer.android.com/reference/kotlin/android/companion/OutOfBandPairingRequest.Builder#build()()` Builds the `https://developer.android.com/reference/kotlin/android/companion/OutOfBandPairingRequest` object. |
| [OutOfBandPairingRequest.Builder](https://developer.android.com/reference/kotlin/android/companion/OutOfBandPairingRequest.Builder#) | `https://developer.android.com/reference/kotlin/android/companion/OutOfBandPairingRequest.Builder#setBluetoothLe(kotlin.Boolean)(bluetoothLe: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)` Sets whether Bluetooth Low Energy (LE) out-of-band (OOB) pairing is requested. |

## Public constructors

### Builder

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

```
Builder()
```

## Public methods

### build

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

```
fun build(): OutOfBandPairingRequest
```

Builds the `https://developer.android.com/reference/kotlin/android/companion/OutOfBandPairingRequest` object.

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/companion/OutOfBandPairingRequest` | This value cannot be `null`. |

### setBluetoothLe

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

```
fun setBluetoothLe(bluetoothLe: Boolean): OutOfBandPairingRequest.Builder
```

Sets whether Bluetooth Low Energy (LE) out-of-band (OOB) pairing is requested.

**Important requirements for Bluetooth LE OOB pairing:**

- **Transport \& Connection:** Bluetooth OOB pairing via `https://developer.android.com/reference/kotlin/android/companion/CompanionDeviceManager` operates exclusively over Bluetooth Low Energy (LE). The remote device must be an LE device, and an active LE connection (e.g., an L2CAP LE data channel) must already be established between the two devices prior to requesting OOB pairing.
- **Device Address Registration:** Because LE devices frequently rotate their air addresses (Resolvable Private Addresses), you must explicitly register the remote device's active LE MAC address using `https://developer.android.com/reference/kotlin/android/companion/CompanionDeviceManager#createAndSetDeviceId(kotlin.Int,%20android.companion.DeviceId)` before starting Bluetooth OOB pairing. `https://developer.android.com/reference/kotlin/android/companion/CompanionDeviceManager` relies on the registered `https://developer.android.com/reference/kotlin/android/companion/DeviceId` MAC address to target the correct underlying radio link during the cryptographic OOB pairing handshake.

| Parameters ||
|---|---|
| `bluetoothLe` | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html): `true` to request Bluetooth LE out-of-band pairing, `false` otherwise. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/companion/OutOfBandPairingRequest.Builder#` | this builder instance. This value cannot be `null`. |