BluetoothCodecConfig.Builder


public static final class BluetoothCodecConfig.Builder
extends Object

java.lang.Object
   ↳ android.bluetooth.BluetoothCodecConfig.Builder


Builder for BluetoothCodecConfig.

By default, the codec type will be set to BluetoothCodecConfig.SOURCE_CODEC_TYPE_INVALID, the codec priority to BluetoothCodecConfig.CODEC_PRIORITY_DEFAULT, the sample rate to BluetoothCodecConfig.SAMPLE_RATE_NONE, the bits per sample to BluetoothCodecConfig.BITS_PER_SAMPLE_NONE, the channel mode to BluetoothCodecConfig.CHANNEL_MODE_NONE, and all the codec specific values to 0.

Summary

Public constructors

Builder()

Public methods

BluetoothCodecConfig build()

Build BluetoothCodecConfig.

BluetoothCodecConfig.Builder setBitsPerSample(int bitsPerSample)

Set the bits per sample for Bluetooth codec config.

BluetoothCodecConfig.Builder setChannelMode(int channelMode)

Set the channel mode for Bluetooth codec config.

BluetoothCodecConfig.Builder setCodecPriority(int codecPriority)

Set codec priority for Bluetooth codec config.

BluetoothCodecConfig.Builder setCodecSpecific1(long codecSpecific1)

Set the first codec specific values for Bluetooth codec config.

BluetoothCodecConfig.Builder setCodecSpecific2(long codecSpecific2)

Set the second codec specific values for Bluetooth codec config.

BluetoothCodecConfig.Builder setCodecSpecific3(long codecSpecific3)

Set the third codec specific values for Bluetooth codec config.

BluetoothCodecConfig.Builder setCodecSpecific4(long codecSpecific4)

Set the fourth codec specific values for Bluetooth codec config.

BluetoothCodecConfig.Builder setCodecType(int codecType)

This method was deprecated in API level 35. use BluetoothCodecType instead

BluetoothCodecConfig.Builder setExtendedCodecType(BluetoothCodecType codecType)

Set codec type for Bluetooth codec config.

BluetoothCodecConfig.Builder setSampleRate(int sampleRate)

Set sample rate for Bluetooth codec config.

Inherited methods

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait(long timeoutMillis)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

Public constructors

Builder

Added in API level 33
public Builder ()

Public methods

build

Added in API level 33
public BluetoothCodecConfig build ()

Build BluetoothCodecConfig.

Returns
BluetoothCodecConfig new BluetoothCodecConfig built This value cannot be null.

setBitsPerSample

Added in API level 33
public BluetoothCodecConfig.Builder setBitsPerSample (int bitsPerSample)

Set the bits per sample for Bluetooth codec config.

Returns
BluetoothCodecConfig.Builder the same Builder instance This value cannot be null.

setChannelMode

Added in API level 33
public BluetoothCodecConfig.Builder setChannelMode (int channelMode)

Set the channel mode for Bluetooth codec config.

Returns
BluetoothCodecConfig.Builder the same Builder instance This value cannot be null.

setCodecPriority

Added in API level 33
public BluetoothCodecConfig.Builder setCodecPriority (int codecPriority)

Set codec priority for Bluetooth codec config.

Returns
BluetoothCodecConfig.Builder the same Builder instance This value cannot be null.

setCodecSpecific1

Added in API level 33
public BluetoothCodecConfig.Builder setCodecSpecific1 (long codecSpecific1)

Set the first codec specific values for Bluetooth codec config.

Parameters
codecSpecific1 long: codec specific value or 0 if default

Returns
BluetoothCodecConfig.Builder the same Builder instance This value cannot be null.

setCodecSpecific2

Added in API level 33
public BluetoothCodecConfig.Builder setCodecSpecific2 (long codecSpecific2)

Set the second codec specific values for Bluetooth codec config.

Parameters
codecSpecific2 long: codec specific value or 0 if default

Returns
BluetoothCodecConfig.Builder the same Builder instance This value cannot be null.

setCodecSpecific3

Added in API level 33
public BluetoothCodecConfig.Builder setCodecSpecific3 (long codecSpecific3)

Set the third codec specific values for Bluetooth codec config.

Parameters
codecSpecific3 long: codec specific value or 0 if default

Returns
BluetoothCodecConfig.Builder the same Builder instance This value cannot be null.

setCodecSpecific4

Added in API level 33
public BluetoothCodecConfig.Builder setCodecSpecific4 (long codecSpecific4)

Set the fourth codec specific values for Bluetooth codec config.

Parameters
codecSpecific4 long: codec specific value or 0 if default

Returns
BluetoothCodecConfig.Builder the same Builder instance This value cannot be null.

setCodecType

Added in API level 33
Deprecated in API level 35
public BluetoothCodecConfig.Builder setCodecType (int codecType)

This method was deprecated in API level 35.
use BluetoothCodecType instead

Set codec type for Bluetooth codec config.

Returns
BluetoothCodecConfig.Builder the same Builder instance This value cannot be null.

setExtendedCodecType

Added in API level 35
public BluetoothCodecConfig.Builder setExtendedCodecType (BluetoothCodecType codecType)

Set codec type for Bluetooth codec config.

Parameters
codecType BluetoothCodecType: of this codec This value may be null.

Returns
BluetoothCodecConfig.Builder the same Builder instance This value cannot be null.

setSampleRate

Added in API level 33
public BluetoothCodecConfig.Builder setSampleRate (int sampleRate)

Set sample rate for Bluetooth codec config.

Returns
BluetoothCodecConfig.Builder the same Builder instance This value cannot be null.