public
final
class
CallAudioState
extends Object
implements
Parcelable
| java.lang.Object | |
| ↳ | android.telecom.CallAudioState |
Encapsulates the telecom audio state, including the current audio routing, supported audio routing and mute.
Constants | |
|---|---|
int |
ROUTE_BLUETOOTH
Direct the audio stream through Bluetooth. |
int |
ROUTE_EARPIECE
Direct the audio stream through the device's earpiece. |
int |
ROUTE_SPEAKER
Direct the audio stream through the device's speakerphone. |
int |
ROUTE_STREAMING
Direct the audio stream through another device. |
int |
ROUTE_WIRED_HEADSET
Direct the audio stream through a wired headset. |
int |
ROUTE_WIRED_OR_EARPIECE
Direct the audio stream through the device's earpiece or wired headset if one is connected. |
Inherited constants |
|---|
Fields | |
|---|---|
public
static
final
Creator<CallAudioState> |
CREATOR
Responsible for creating AudioState objects for deserialized Parcels. |
Public constructors | |
|---|---|
CallAudioState(boolean muted, int route, int supportedRouteMask)
Constructor for a |
|
Public methods | |
|---|---|
static
String
|
audioRouteToString(int route)
Converts the provided audio route into a human readable string representation. |
int
|
describeContents()
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one. |
BluetoothDevice
|
getActiveBluetoothDevice()
|
int
|
getRoute()
|
Collection<BluetoothDevice>
|
getSupportedBluetoothDevices()
|
int
|
getSupportedRouteMask()
|
boolean
|
isMuted()
|
String
|
toString()
Returns a string representation of the object. |
void
|
writeToParcel(Parcel destination, int flags)
Writes AudioState object into a serializeable Parcel. |
Inherited methods | |
|---|---|
public static final int ROUTE_BLUETOOTH
Direct the audio stream through Bluetooth.
Constant Value: 2 (0x00000002)
public static final int ROUTE_EARPIECE
Direct the audio stream through the device's earpiece.
Constant Value: 1 (0x00000001)
public static final int ROUTE_SPEAKER
Direct the audio stream through the device's speakerphone.
Constant Value: 8 (0x00000008)
public static final int ROUTE_STREAMING
Direct the audio stream through another device.
Constant Value: 16 (0x00000010)
public static final int ROUTE_WIRED_HEADSET
Direct the audio stream through a wired headset.
Constant Value: 4 (0x00000004)
public static final int ROUTE_WIRED_OR_EARPIECE
Direct the audio stream through the device's earpiece or wired headset if one is connected.
Constant Value: 5 (0x00000005)
public static final Creator<CallAudioState> CREATOR
Responsible for creating AudioState objects for deserialized Parcels.
public CallAudioState (boolean muted,
int route,
int supportedRouteMask)Constructor for a CallAudioState object.
mutedboolean: true if the call is muted, false otherwise.routeint: The current audio route being used.
Allowed values:
ROUTE_EARPIECE
ROUTE_BLUETOOTH
ROUTE_WIRED_HEADSET
ROUTE_SPEAKER
0 or a combination of the following:
supportedRouteMaskint: 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
0 or a combination of the following:
public static String audioRouteToString (int route)
Converts the provided audio route into a human readable string representation.
| Parameters | |
|---|---|
route |
int: to convert into a string. |
| Returns | |
|---|---|
String |
String representation of the provided audio route. |
public int describeContents ()
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(Parcel,int),
the return value of this method must include the
CONTENTS_FILE_DESCRIPTOR bit.
int0 or
public boolean equals (Object obj)
Indicates whether some other object is "equal to" this one.
The equals method implements an equivalence relation
on non-null object references:
x, x.equals(x) should return
true.
x and y, x.equals(y)
should return true if and only if
y.equals(x) returns true.
x, y, and z, if
x.equals(y) returns true and
y.equals(z) returns true, then
x.equals(z) should return true.
x and y, multiple invocations of
x.equals(y) consistently return true
or consistently return false, provided no
information used in equals comparisons on the
objects is modified.
x,
x.equals(null) should return false.
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 |
Object: the reference object with which to compare. |
| Returns | |
|---|---|
boolean |
true if this object is the same as the obj
argument; false otherwise. |
public BluetoothDevice getActiveBluetoothDevice ()
| Returns | |
|---|---|
BluetoothDevice |
The BluetoothDevice through which audio is being routed.
Will not be null if getRoute() returns ROUTE_BLUETOOTH. |
public int getRoute ()
int0 or a combination of the following:
public Collection<BluetoothDevice> getSupportedBluetoothDevices ()
| Returns | |
|---|---|
Collection<BluetoothDevice> |
List of BluetoothDevices that can be used for this call. |
public int getSupportedRouteMask ()
int0 or a combination of the following:
public boolean isMuted ()
| Returns | |
|---|---|
boolean |
true if the call is muted, false otherwise. |
public String toString ()
Returns a string representation of the object.
| Returns | |
|---|---|
String |
a string representation of the object. |
public void writeToParcel (Parcel destination,
int flags)Writes AudioState object into a serializeable Parcel.
destinationParcel: The Parcel in which the object should be written.
null.flagsint: Additional flags about how the object should be written.
May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE.
0 or a combination of the following:
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2026-02-26 UTC.