Builder


class Builder
kotlin.Any
   ↳ android.companion.OutOfBandPairingRequest.Builder

A builder for creating OutOfBandPairingRequest.

Summary

Public constructors

Public methods
OutOfBandPairingRequest

Builds the OutOfBandPairingRequest object.

OutOfBandPairingRequest.Builder
setBluetoothLe(bluetoothLe: Boolean)

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

Public constructors

Builder

Builder()

Public methods

build

fun build(): OutOfBandPairingRequest

Builds the OutOfBandPairingRequest object.

Return
OutOfBandPairingRequest This value cannot be null.

setBluetoothLe

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 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 CompanionDeviceManager.createAndSetDeviceId before starting Bluetooth OOB pairing. CompanionDeviceManager relies on the registered DeviceId MAC 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.