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: 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
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 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR |
equals
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
fun getActiveBluetoothDevice(): BluetoothDevice!
| Return | |
|---|---|
BluetoothDevice! |
The BluetoothDevice through which audio is being routed. Will not be null if getRoute() returns ROUTE_BLUETOOTH. |
getRoute
fun getRoute(): Int
| Return | |
|---|---|
Int |
The current audio route being used. 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 |
getSupportedBluetoothDevices
fun getSupportedBluetoothDevices(): MutableCollection<BluetoothDevice!>!
| Return | |
|---|---|
MutableCollection<BluetoothDevice!>! |
List of BluetoothDevices 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 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
fun isMuted(): Boolean
| Return | |
|---|---|
Boolean |
true if the call is muted, false otherwise. |
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 either 0 or a combination of android.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.