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_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 |
---|
From
interface
android.os.Parcelable
|
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. |
int
|
getRoute()
|
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 | |
---|---|
From
class
java.lang.Object
| |
From
interface
android.os.Parcelable
|
int ROUTE_BLUETOOTH
Direct the audio stream through Bluetooth.
Constant Value: 2 (0x00000002)
int ROUTE_EARPIECE
Direct the audio stream through the device's earpiece.
Constant Value: 1 (0x00000001)
int ROUTE_SPEAKER
Direct the audio stream through the device's speakerphone.
Constant Value: 8 (0x00000008)
int ROUTE_WIRED_HEADSET
Direct the audio stream through a wired headset.
Constant Value: 4 (0x00000004)
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)
Creator<CallAudioState> CREATOR
Responsible for creating AudioState objects for deserialized Parcels.
CallAudioState (boolean muted, int route, int supportedRouteMask)
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 |
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
|
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. |
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.
Returns | |
---|---|
int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. |
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
.
The equals
method for class Object
implements
the most discriminating possible equivalence relation on objects;
that is, for any non-null reference values x
and
y
, this method returns true
if and only
if x
and y
refer to the same object
(x == y
has the value true
).
Note that it is generally necessary to override the hashCode
method whenever this method is overridden, so as to maintain the
general contract for the hashCode
method, which states
that equal objects must have equal hash codes.
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. |
int getSupportedRouteMask ()
Returns | |
---|---|
int |
Bit mask of all routes supported by this call. |
boolean isMuted ()
Returns | |
---|---|
boolean |
true if the call is muted, false otherwise.
|
String toString ()
Returns a string representation of the object. In general, the
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
Returns | |
---|---|
String |
a string representation of the object. |
void writeToParcel (Parcel destination, int flags)
Writes AudioState object into a serializeable Parcel.
Parameters | |
---|---|
destination |
Parcel :
The Parcel in which the object should be written. |
flags |
int :
Additional flags about how the object should be written.
May be 0 or PARCELABLE_WRITE_RETURN_VALUE .
|