Added in API level 23

CallAudioState

class CallAudioState : Parcelable
kotlin.Any
   ↳ android.telecom.CallAudioState

Encapsulates the telecom audio state, including the current audio routing, supported audio routing and mute.

Summary

Constants
static Int

Direct the audio stream through Bluetooth.

static Int

Direct the audio stream through the device's earpiece.

static Int

Direct the audio stream through the device's speakerphone.

static Int

Direct the audio stream through another device.

static Int

Direct the audio stream through a wired headset.

static Int

Direct the audio stream through the device's earpiece or wired headset if one is connected.

Inherited constants
Public constructors
CallAudioState(muted: Boolean, route: Int, supportedRouteMask: Int)

Constructor for a CallAudioState object.

Public methods
static String!

Converts the provided audio route into a human readable string representation.

Int

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

Boolean
equals(other: Any?)

BluetoothDevice!

Int

MutableCollection<BluetoothDevice!>!

Int

Boolean

String

Unit
writeToParcel(destination: Parcel, flags: Int)

Writes AudioState object into a serializeable Parcel.

Properties
static Parcelable.Creator<CallAudioState!>

Responsible for creating AudioState objects for deserialized Parcels.

Constants

ROUTE_BLUETOOTH

Added in API level 23
static val ROUTE_BLUETOOTH: Int

Direct the audio stream through Bluetooth.

Value: 2

ROUTE_EARPIECE

Added in API level 23
static val ROUTE_EARPIECE: Int

Direct the audio stream through the device's earpiece.

Value: 1

ROUTE_SPEAKER

Added in API level 23
static val ROUTE_SPEAKER: Int

Direct the audio stream through the device's speakerphone.

Value: 8

ROUTE_STREAMING

Added in API level 34
static val ROUTE_STREAMING: Int

Direct the audio stream through another device.

Value: 16

ROUTE_WIRED_HEADSET

Added in API level 23
static val ROUTE_WIRED_HEADSET: Int

Direct the audio stream through a wired headset.

Value: 4

ROUTE_WIRED_OR_EARPIECE

Added in API level 23
static val ROUTE_WIRED_OR_EARPIECE: Int

Direct the audio stream through the device's earpiece or wired headset if one is connected.

Value: 5

Public constructors

CallAudioState

Added in API level 23
CallAudioState(
    muted: Boolean,
    route: Int,
    supportedRouteMask: Int)

Constructor for a CallAudioState object.

Parameters
muted Boolean: true if the call is muted, false otherwise.
route Int: The current audio route being used. Allowed values: ROUTE_EARPIECE ROUTE_BLUETOOTH ROUTE_WIRED_HEADSET ROUTE_SPEAKER Value is either 0 or a combination of android.telecom.CallAudioState#ROUTE_EARPIECE, android.telecom.CallAudioState#ROUTE_BLUETOOTH, android.telecom.CallAudioState#ROUTE_WIRED_HEADSET, and android.telecom.CallAudioState#ROUTE_SPEAKER
supportedRouteMask Int: Bit mask of all routes supported by this call. This should be a bitwise combination of the following values: ROUTE_EARPIECE ROUTE_BLUETOOTH ROUTE_WIRED_HEADSET ROUTE_SPEAKER Value is either 0 or a combination of android.telecom.CallAudioState#ROUTE_EARPIECE, android.telecom.CallAudioState#ROUTE_BLUETOOTH, android.telecom.CallAudioState#ROUTE_WIRED_HEADSET, and android.telecom.CallAudioState#ROUTE_SPEAKER

Public methods

audioRouteToString

Added in API level 23
static fun audioRouteToString(route: Int): String!

Converts the provided audio route into a human readable string representation.

Parameters
route Int: to convert into a string.
Return
String! String representation of the provided audio route.

describeContents

Added in API level 23
fun describeContents(): Int

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(android.os.Parcel,int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR

equals

Added in API level 23
fun equals(other: Any?): Boolean
Parameters
obj the reference object with which to compare.
Return
Boolean true if this object is the same as the obj argument; false otherwise.

getActiveBluetoothDevice

Added in API level 28
fun getActiveBluetoothDevice(): BluetoothDevice!
Return
BluetoothDevice! The BluetoothDevice through which audio is being routed. Will not be null if getRoute() returns ROUTE_BLUETOOTH.

getSupportedBluetoothDevices

Added in API level 28
fun getSupportedBluetoothDevices(): MutableCollection<BluetoothDevice!>!
Return
MutableCollection<BluetoothDevice!>! List of BluetoothDevices that can be used for this call.

getSupportedRouteMask

Added in API level 23
fun getSupportedRouteMask(): Int
Return
Int Bit mask of all routes supported by this call. Value is either 0 or a combination of android.telecom.CallAudioState#ROUTE_EARPIECE, android.telecom.CallAudioState#ROUTE_BLUETOOTH, android.telecom.CallAudioState#ROUTE_WIRED_HEADSET, and android.telecom.CallAudioState#ROUTE_SPEAKER

isMuted

Added in API level 23
fun isMuted(): Boolean
Return
Boolean true if the call is muted, false otherwise.

toString

Added in API level 23
fun toString(): String
Return
String a string representation of the object.

writeToParcel

Added in API level 23
fun writeToParcel(
    destination: Parcel,
    flags: Int
): Unit

Writes AudioState object into a serializeable Parcel.

Parameters
dest The Parcel in which the object should be written. This value cannot be null.
flags Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES

Properties

CREATOR

Added in API level 23
static val CREATOR: Parcelable.Creator<CallAudioState!>

Responsible for creating AudioState objects for deserialized Parcels.