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  | |
| Public methods | |
|---|---|
| static String! | audioRouteToString(route: Int)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 | |
| BluetoothDevice! | |
| Int | getRoute() | 
| MutableCollection<BluetoothDevice!>! | |
| Int | |
| Boolean | isMuted() | 
| String | toString() | 
| 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
static val ROUTE_BLUETOOTH: Int
Direct the audio stream through Bluetooth.
Value: 2ROUTE_EARPIECE
static val ROUTE_EARPIECE: Int
Direct the audio stream through the device's earpiece.
Value: 1ROUTE_SPEAKER
static val ROUTE_SPEAKER: Int
Direct the audio stream through the device's speakerphone.
Value: 8ROUTE_STREAMING
static val ROUTE_STREAMING: Int
Direct the audio stream through another device.
Value: 16ROUTE_WIRED_HEADSET
static val ROUTE_WIRED_HEADSET: Int
Direct the audio stream through a wired headset.
Value: 4ROUTE_WIRED_OR_EARPIECE
static val ROUTE_WIRED_OR_EARPIECE: Int
Direct the audio stream through the device's earpiece or wired headset if one is connected.
Value: 5Public constructors
CallAudioState
CallAudioState(
muted: Boolean,
route: Int,
supportedRouteMask: Int)
Constructor for a CallAudioState object.
| Parameters | |
|---|---|
| muted | Boolean: trueif the call is muted,falseotherwise. | 
| route | Int: The current audio route being used. Allowed values: ROUTE_EARPIECEROUTE_BLUETOOTHROUTE_WIRED_HEADSETROUTE_SPEAKERValue is either0or a combination ofandroid.telecom.CallAudioState#ROUTE_EARPIECE,android.telecom.CallAudioState#ROUTE_BLUETOOTH,android.telecom.CallAudioState#ROUTE_WIRED_HEADSET, andandroid.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_EARPIECEROUTE_BLUETOOTHROUTE_WIRED_HEADSETROUTE_SPEAKERValue is either0or a combination ofandroid.telecom.CallAudioState#ROUTE_EARPIECE,android.telecom.CallAudioState#ROUTE_BLUETOOTH,android.telecom.CallAudioState#ROUTE_WIRED_HEADSET, andandroid.telecom.CallAudioState#ROUTE_SPEAKER | 
Public methods
audioRouteToString
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
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 0orandroid.os.Parcelable#CONTENTS_FILE_DESCRIPTOR | 
equals
fun equals(other: Any?): Boolean
| Parameters | |
|---|---|
| obj | the reference object with which to compare. | 
| Return | |
|---|---|
| Boolean | trueif this object is the same as the obj argument;falseotherwise. | 
getActiveBluetoothDevice
fun getActiveBluetoothDevice(): BluetoothDevice!
| Return | |
|---|---|
| BluetoothDevice! | The BluetoothDevicethrough which audio is being routed. Will not benullifgetRoute()returnsROUTE_BLUETOOTH. | 
getRoute
fun getRoute(): Int
| Return | |
|---|---|
| Int | The current audio route being used. Value is either 0or a combination ofandroid.telecom.CallAudioState#ROUTE_EARPIECE,android.telecom.CallAudioState#ROUTE_BLUETOOTH,android.telecom.CallAudioState#ROUTE_WIRED_HEADSET, andandroid.telecom.CallAudioState#ROUTE_SPEAKER | 
getSupportedBluetoothDevices
fun getSupportedBluetoothDevices(): MutableCollection<BluetoothDevice!>!
| Return | |
|---|---|
| MutableCollection<BluetoothDevice!>! | ListofBluetoothDevices that can be used for this call. | 
getSupportedRouteMask
fun getSupportedRouteMask(): Int
| Return | |
|---|---|
| Int | Bit mask of all routes supported by this call. Value is either 0or a combination ofandroid.telecom.CallAudioState#ROUTE_EARPIECE,android.telecom.CallAudioState#ROUTE_BLUETOOTH,android.telecom.CallAudioState#ROUTE_WIRED_HEADSET, andandroid.telecom.CallAudioState#ROUTE_SPEAKER | 
isMuted
fun isMuted(): Boolean
| Return | |
|---|---|
| Boolean | trueif the call is muted,falseotherwise. | 
toString
fun toString(): String
| Return | |
|---|---|
| String | a string representation of the object. | 
writeToParcel
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 either0or a combination ofandroid.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES | 
Properties
CREATOR
static val CREATOR: Parcelable.Creator<CallAudioState!>
Responsible for creating AudioState objects for deserialized Parcels.
