Added in API level 37.2
Builder
class Builder
| kotlin.Any | |
| ↳ | android.companion.OutOfBandPairingRequest.Builder |
A builder for creating OutOfBandPairingRequest.
Summary
| Public constructors | |
|---|---|
Builder() |
|
| Public methods | |
|---|---|
| OutOfBandPairingRequest |
build()Builds the |
| OutOfBandPairingRequest.Builder |
setBluetoothLe(bluetoothLe: Boolean)Sets whether Bluetooth Low Energy (LE) out-of-band (OOB) pairing is requested. |
Public constructors
Public methods
build
Added in API level 37.2
fun build(): OutOfBandPairingRequest
Builds the OutOfBandPairingRequest object.
| Return | |
|---|---|
OutOfBandPairingRequest |
This value cannot be null. |
setBluetoothLe
Added in API level 37.2
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
CompanionDeviceManageroperates 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
CompanionDeviceManager.createAndSetDeviceIdbefore starting Bluetooth OOB pairing.CompanionDeviceManagerrelies on the registeredDeviceIdMAC address to target the correct underlying radio link during the cryptographic OOB pairing handshake.
| Parameters | |
|---|---|
bluetoothLe |
Boolean: true to request Bluetooth LE out-of-band pairing, false otherwise. |
| Return | |
|---|---|
OutOfBandPairingRequest.Builder |
this builder instance. This value cannot be null. |