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 |
Indicates whether some other object is "equal to" this one. |
| BluetoothDevice! | |
| Int |
getRoute() |
| MutableCollection<BluetoothDevice!>! | |
| Int | |
| Boolean |
isMuted() |
| String |
toString()Returns a string representation of the object. |
| 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 the following:
|
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 the following:
|
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
|
equals
fun equals(other: Any?): Boolean
Indicates whether some other object is "equal to" this one.
The equals method implements an equivalence relation on non-null object references:
- It is reflexive: for any non-null reference value
x,x.equals(x)should returntrue. - It is symmetric: for any non-null reference values
xandy,x.equals(y)should returntrueif and only ify.equals(x)returnstrue. - It is transitive: for any non-null reference values
x,y, andz, ifx.equals(y)returnstrueandy.equals(z)returnstrue, thenx.equals(z)should returntrue. - It is consistent: for any non-null reference values
xandy, multiple invocations ofx.equals(y)consistently returntrueor consistently returnfalse, provided no information used inequalscomparisons on the objects is modified. - For any non-null reference value
x,x.equals(null)should returnfalse.
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| 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 the following:
|
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 the following:
|
isMuted
fun isMuted(): Boolean
| Return | |
|---|---|
Boolean |
true if the call is muted, false otherwise. |
toString
fun toString(): String
Returns a string representation of the object.
| 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 the following:
|
Properties
CREATOR
static val CREATOR: Parcelable.Creator<CallAudioState!>
Responsible for creating AudioState objects for deserialized Parcels.