MediaRoute2Info
class MediaRoute2Info : Parcelable
| kotlin.Any | |
| ↳ | android.media.MediaRoute2Info |
Describes the properties of a route.
Summary
| Nested classes | |
|---|---|
|
Builder for |
|
| Constants | |
|---|---|
| static Int |
A connection state indicating the route is connected. |
| static Int |
A connection state indicating the route is in the process of connecting and is not yet ready for use. |
| static Int |
The default connection state indicating the route is disconnected. |
| static String |
Route feature: Live audio. |
| static String |
Route feature: Live video. |
| static String |
Route feature: Remote audio playback. |
| static String |
Route feature: Remote playback. |
| static String |
Route feature: Remote video playback. |
| static Int |
Playback information indicating the playback volume is fixed, i. |
| static Int |
Playback information indicating the playback volume is variable and can be controlled from this object. |
| static Int |
Indicates that the route is never suitable for media playback. |
| static Int |
Indicates the route is always suitable for media playback. |
| static Int |
Indicates that the route is suitable for media playback only after explicit user selection. |
| static Int |
Indicates the route is using the auxiliary line-level connectors. |
| static Int |
Indicates the route is a Bluetooth Low Energy (BLE) HEADSET. |
| static Int |
Indicates the route is a bluetooth device, such as a bluetooth speaker or headphones. |
| static Int |
Indicates the route is the speaker system (i.e. a mono speaker or stereo speakers) built into the device. |
| static Int |
Indicates the route is the audio device associated with a dock. |
| static Int |
Indicates the route is a group of devices. |
| static Int |
Indicates the route is an HDMI connection. |
| static Int |
Indicates the route is an Audio Return Channel of an HDMI connection. |
| static Int |
Indicates the route is an Enhanced Audio Return Channel of an HDMI connection. |
| static Int |
Indicates the route is a hearing aid. |
| static Int |
Indicates the route is an analog line-level connection. |
| static Int |
Indicates the route is a digital line connection (for example S/PDIF). |
| static Int |
Indicates the route is a speaker group supporting multichannel contents. |
| static Int |
Indicates the route is a remote Audio/Video Receiver (AVR). |
| static Int |
Indicates the route is a remote car. |
| static Int |
Indicates the route is a remote computer. |
| static Int |
Indicates the route is a remote gaming console. |
| static Int |
Indicates the route is a remote smartphone. |
| static Int |
Indicates the route is a remote smartwatch. |
| static Int |
Indicates the route is a remote speaker. |
| static Int |
Indicates the route is a remote tablet. |
| static Int |
Indicates the route is a remote docked tablet. |
| static Int |
Indicates the route is a remote TV. |
| static Int |
Indicates the route's type is unknown or undefined. |
| static Int |
Indicates the route is a USB audio device in accessory mode. |
| static Int |
Indicates the route is a USB audio device. |
| static Int |
Indicates the route is a USB audio headset. |
| static Int |
Indicates the route is a pair of wired headphones. |
| static Int |
Indicates the route is a headset, which is the combination of a headphones and a microphone. |
| Inherited constants | |
|---|---|
| Public methods | |
|---|---|
| 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. |
| String? |
Gets the package name of the app using the route. |
| Int |
Gets the connection state of the route. |
| MutableSet<String!> |
Gets the deduplication IDs associated to the route. |
| CharSequence? |
Gets the user-visible description of the route. |
| Bundle? |
Gets an optional bundle with extra data. |
| MutableList<String!> |
Gets the supported features of the route. |
| Uri? |
Gets the URI of the icon representing this route. |
| String |
getId()Gets the unique id of the route, if available. |
| CharSequence |
getName()Gets the user-visible name of the route. |
| MutableList<MutableSet<String!>!> | |
| Int |
Returns the route suitability status. |
| Int |
getType()Returns the type of this route. |
| Int |
Gets the current volume of the route. |
| Int |
Gets information about how volume is handled on the route. |
| Int |
Gets the maximum volume of the route. |
| Int |
hashCode()Returns a hash code value for the object. |
| Boolean |
Returns whether the route is a system route or not. |
| String |
toString()Returns a string representation of the object. |
| Unit |
writeToParcel(dest: Parcel, flags: Int)Flatten this object in to a Parcel. |
| Properties | |
|---|---|
| static Parcelable.Creator<MediaRoute2Info!> | |
Constants
CONNECTION_STATE_CONNECTED
static val CONNECTION_STATE_CONNECTED: Int
A connection state indicating the route is connected.
Value: 2See Also
CONNECTION_STATE_CONNECTING
static val CONNECTION_STATE_CONNECTING: Int
A connection state indicating the route is in the process of connecting and is not yet ready for use.
Value: 1See Also
CONNECTION_STATE_DISCONNECTED
static val CONNECTION_STATE_DISCONNECTED: Int
The default connection state indicating the route is disconnected.
Value: 0See Also
FEATURE_LIVE_AUDIO
static val FEATURE_LIVE_AUDIO: String
Route feature: Live audio.
A route that supports live audio routing will allow the media audio stream to be sent to supported destinations. This can include internal speakers or audio jacks on the device itself, A2DP devices, and more.
When a live audio route is selected, audio routing is transparent to the application. All audio played on the media stream will be routed to the selected destination.
Refer to the class documentation for details about live audio routes.
Value: "android.media.route.feature.LIVE_AUDIO"FEATURE_LIVE_VIDEO
static val FEATURE_LIVE_VIDEO: String
Route feature: Live video.
A route that supports live video routing will allow a mirrored version of the device's primary display or a customized Presentation to be sent to supported destinations.
When a live video route is selected, audio and video routing is transparent to the application. By default, audio and video is routed to the selected destination. For certain live video routes, the application may also use a Presentation to replace the mirrored view on the external display with different content.
Refer to the class documentation for details about live video routes.
Value: "android.media.route.feature.LIVE_VIDEO"See Also
FEATURE_REMOTE_AUDIO_PLAYBACK
static val FEATURE_REMOTE_AUDIO_PLAYBACK: String
Route feature: Remote audio playback.
A route that supports remote audio playback routing will allow an application to send requests to play audio content remotely to supported destinations.
Value: "android.media.route.feature.REMOTE_AUDIO_PLAYBACK"FEATURE_REMOTE_PLAYBACK
static val FEATURE_REMOTE_PLAYBACK: String
Route feature: Remote playback.
A route that supports remote playback routing will allow an application to send requests to play content remotely to supported destinations. A route may only support audio playback or video playback.
Remote playback routes destinations operate independently of the local device. When a remote playback route is selected, the application can control the content playing on the destination using MediaRouter2.RoutingController.getControlHints(). The application may also receive status updates from the route regarding remote playback.
Refer to the class documentation for details about remote playback routes.
Value: "android.media.route.feature.REMOTE_PLAYBACK"FEATURE_REMOTE_VIDEO_PLAYBACK
static val FEATURE_REMOTE_VIDEO_PLAYBACK: String
Route feature: Remote video playback.
A route that supports remote video playback routing will allow an application to send requests to play video content remotely to supported destinations.
Value: "android.media.route.feature.REMOTE_VIDEO_PLAYBACK"PLAYBACK_VOLUME_FIXED
static val PLAYBACK_VOLUME_FIXED: Int
Playback information indicating the playback volume is fixed, i.e. it cannot be controlled from this object. An example of fixed playback volume is a remote player, playing over HDMI where the user prefers to control the volume on the HDMI sink, rather than attenuate at the source.
Value: 0See Also
PLAYBACK_VOLUME_VARIABLE
static val PLAYBACK_VOLUME_VARIABLE: Int
Playback information indicating the playback volume is variable and can be controlled from this object.
Value: 1See Also
SUITABILITY_STATUS_NOT_SUITABLE_FOR_TRANSFER
static val SUITABILITY_STATUS_NOT_SUITABLE_FOR_TRANSFER: Int
Indicates that the route is never suitable for media playback.
Value: 2SUITABILITY_STATUS_SUITABLE_FOR_DEFAULT_TRANSFER
static val SUITABILITY_STATUS_SUITABLE_FOR_DEFAULT_TRANSFER: Int
Indicates the route is always suitable for media playback.
Value: 0SUITABILITY_STATUS_SUITABLE_FOR_MANUAL_TRANSFER
static val SUITABILITY_STATUS_SUITABLE_FOR_MANUAL_TRANSFER: Int
Indicates that the route is suitable for media playback only after explicit user selection.
Value: 1TYPE_AUX_LINE
static val TYPE_AUX_LINE: Int
Indicates the route is using the auxiliary line-level connectors.
Value: 19TYPE_BLE_HEADSET
static val TYPE_BLE_HEADSET: Int
Indicates the route is a Bluetooth Low Energy (BLE) HEADSET.
Value: 26TYPE_BLUETOOTH_A2DP
static val TYPE_BLUETOOTH_A2DP: Int
Indicates the route is a bluetooth device, such as a bluetooth speaker or headphones.
Value: 8TYPE_BUILTIN_SPEAKER
static val TYPE_BUILTIN_SPEAKER: Int
Indicates the route is the speaker system (i.e. a mono speaker or stereo speakers) built into the device.
Value: 2TYPE_DOCK
static val TYPE_DOCK: Int
Indicates the route is the audio device associated with a dock.
Value: 13TYPE_GROUP
static val TYPE_GROUP: Int
Indicates the route is a group of devices.
Value: 2000See Also
TYPE_HDMI
static val TYPE_HDMI: Int
Indicates the route is an HDMI connection.
Value: 9TYPE_HDMI_ARC
static val TYPE_HDMI_ARC: Int
Indicates the route is an Audio Return Channel of an HDMI connection.
Value: 10TYPE_HDMI_EARC
static val TYPE_HDMI_EARC: Int
Indicates the route is an Enhanced Audio Return Channel of an HDMI connection.
Value: 29TYPE_HEARING_AID
static val TYPE_HEARING_AID: Int
Indicates the route is a hearing aid.
Value: 23TYPE_LINE_ANALOG
static val TYPE_LINE_ANALOG: Int
Indicates the route is an analog line-level connection.
Value: 5TYPE_LINE_DIGITAL
static val TYPE_LINE_DIGITAL: Int
Indicates the route is a digital line connection (for example S/PDIF).
Value: 6TYPE_MULTICHANNEL_SPEAKER_GROUP
static val TYPE_MULTICHANNEL_SPEAKER_GROUP: Int
Indicates the route is a speaker group supporting multichannel contents.
The speakers in the group are connected together using local network based protocols. The speaker group requires additional input of the physical positions of each individual speaker to provide a better experience on multichannel contents.
Value: 32TYPE_REMOTE_AUDIO_VIDEO_RECEIVER
static val TYPE_REMOTE_AUDIO_VIDEO_RECEIVER: Int
Indicates the route is a remote Audio/Video Receiver (AVR).
A remote device uses a routing protocol managed by the application, as opposed to the routing being done by the system.
Value: 1003See Also
TYPE_REMOTE_CAR
static val TYPE_REMOTE_CAR: Int
Indicates the route is a remote car.
A remote device uses a routing protocol managed by the application, as opposed to the routing being done by the system.
Value: 1008See Also
TYPE_REMOTE_COMPUTER
static val TYPE_REMOTE_COMPUTER: Int
Indicates the route is a remote computer.
A remote device uses a routing protocol managed by the application, as opposed to the routing being done by the system.
Value: 1006See Also
TYPE_REMOTE_GAME_CONSOLE
static val TYPE_REMOTE_GAME_CONSOLE: Int
Indicates the route is a remote gaming console.
A remote device uses a routing protocol managed by the application, as opposed to the routing being done by the system.
Value: 1007See Also
TYPE_REMOTE_SMARTPHONE
static val TYPE_REMOTE_SMARTPHONE: Int
Indicates the route is a remote smartphone.
A remote device uses a routing protocol managed by the application, as opposed to the routing being done by the system.
Value: 1010See Also
TYPE_REMOTE_SMARTWATCH
static val TYPE_REMOTE_SMARTWATCH: Int
Indicates the route is a remote smartwatch.
A remote device uses a routing protocol managed by the application, as opposed to the routing being done by the system.
Value: 1009See Also
TYPE_REMOTE_SPEAKER
static val TYPE_REMOTE_SPEAKER: Int
Indicates the route is a remote speaker.
A remote device uses a routing protocol managed by the application, as opposed to the routing being done by the system.
Value: 1002See Also
TYPE_REMOTE_TABLET
static val TYPE_REMOTE_TABLET: Int
Indicates the route is a remote tablet.
A remote device uses a routing protocol managed by the application, as opposed to the routing being done by the system.
Value: 1004See Also
TYPE_REMOTE_TABLET_DOCKED
static val TYPE_REMOTE_TABLET_DOCKED: Int
Indicates the route is a remote docked tablet.
A remote device uses a routing protocol managed by the application, as opposed to the routing being done by the system.
Value: 1005See Also
TYPE_REMOTE_TV
static val TYPE_REMOTE_TV: Int
Indicates the route is a remote TV.
A remote device uses a routing protocol managed by the application, as opposed to the routing being done by the system.
Value: 1001See Also
TYPE_UNKNOWN
static val TYPE_UNKNOWN: Int
Indicates the route's type is unknown or undefined.
Value: 0See Also
TYPE_USB_ACCESSORY
static val TYPE_USB_ACCESSORY: Int
Indicates the route is a USB audio device in accessory mode.
Value: 12TYPE_USB_DEVICE
static val TYPE_USB_DEVICE: Int
Indicates the route is a USB audio device.
Value: 11TYPE_USB_HEADSET
static val TYPE_USB_HEADSET: Int
Indicates the route is a USB audio headset.
Value: 22TYPE_WIRED_HEADPHONES
static val TYPE_WIRED_HEADPHONES: Int
Indicates the route is a pair of wired headphones.
Value: 4TYPE_WIRED_HEADSET
static val TYPE_WIRED_HEADSET: Int
Indicates the route is a headset, which is the combination of a headphones and a microphone.
Value: 3Public methods
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. |
getClientPackageName
fun getClientPackageName(): String?
Gets the package name of the app using the route. Returns null if no apps are using this route.
getConnectionState
fun getConnectionState(): Int
Gets the connection state of the route.
| Return | |
|---|---|
Int |
The connection state of this route: CONNECTION_STATE_DISCONNECTED, CONNECTION_STATE_CONNECTING, or CONNECTION_STATE_CONNECTED. Value is one of the following: |
getDeduplicationIds
fun getDeduplicationIds(): MutableSet<String!>
Gets the deduplication IDs associated to the route.
Two routes with a matching deduplication ID originate from the same receiver device.
| Return | |
|---|---|
MutableSet<String!> |
This value cannot be null. |
getDescription
fun getDescription(): CharSequence?
Gets the user-visible description of the route.
| Return | |
|---|---|
CharSequence? |
This value may be null. |
getExtras
fun getExtras(): Bundle?
Gets an optional bundle with extra data.
| Return | |
|---|---|
Bundle? |
This value may be null. |
getFeatures
fun getFeatures(): MutableList<String!>
Gets the supported features of the route.
| Return | |
|---|---|
MutableList<String!> |
This value cannot be null. |
getIconUri
fun getIconUri(): Uri?
Gets the URI of the icon representing this route.
This icon will be used in picker UIs if available.
| Return | |
|---|---|
Uri? |
The URI of the icon representing this route, or null if none. |
getId
fun getId(): String
Gets the unique id of the route, if available. Otherwise, returns the original id set by Builder.Builder(String, CharSequence).
The original id of a route is the id set by the Builder when the route is built.
The unique id of a route is based on the original id, and assigned by the system once a route is published by calling MediaRoute2ProviderService.notifyRoutes(Collection). This ensures id uniqueness across routes from different providers, who assign original ids which are only unique within the scope of a single provider. As a result, calling this method on a route freshly created (which has not yet been published through MediaRoute2ProviderService.notifyRoutes(Collection)) will return the original id, and will differ from the unique id obtained from calling this method on a route obtained through MediaRouter2.
Routes obtained from MediaRouter2 will have unique IDs. For example, routes obtained through MediaRouter2.getRoutes(), MediaRouter2.RouteCallback.onRoutesUpdated(List), or MediaRouter2.RoutingController.getSelectedRoutes().
| Return | |
|---|---|
String |
This value cannot be null. |
getName
fun getName(): CharSequence
Gets the user-visible name of the route.
| Return | |
|---|---|
CharSequence |
This value cannot be null. |
getRequiredPermissions
fun getRequiredPermissions(): MutableList<MutableSet<String!>!>
| Return | |
|---|---|
MutableList<MutableSet<String!>!> |
a list of permission sets - all the permissions in at least one of these sets must be held to see this route. This value cannot be null. |
getSuitabilityStatus
fun getSuitabilityStatus(): Int
Returns the route suitability status.
| Return | |
|---|---|
Int |
Value is one of the following: |
getType
fun getType(): Int
Returns the type of this route.
getVolume
fun getVolume(): Int
Gets the current volume of the route. This may be invalid if the route is not selected.
getVolumeHandling
fun getVolumeHandling(): Int
Gets information about how volume is handled on the route.
| Return | |
|---|---|
Int |
PLAYBACK_VOLUME_FIXED or PLAYBACK_VOLUME_VARIABLE Value is one of the following: |
hashCode
fun hashCode(): Int
Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.
The general contract of hashCode is:
- Whenever it is invoked on the same object more than once during an execution of a Java application, the
hashCodemethod must consistently return the same integer, provided no information used inequalscomparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application. - If two objects are equal according to the
equalsmethod, then calling thehashCodemethod on each of the two objects must produce the same integer result. - It is not required that if two objects are unequal according to the
equalsmethod, then calling thehashCodemethod on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
| Return | |
|---|---|
Int |
a hash code value for this object. |
isSystemRoute
fun isSystemRoute(): Boolean
Returns whether the route is a system route or not.
System routes are media routes directly controlled by the system such as phone speaker, wired headset, and Bluetooth devices.
toString
fun toString(): String
Returns a string representation of the object.
| Return | |
|---|---|
String |
a string representation of the object. |
writeToParcel
fun writeToParcel(
dest: Parcel,
flags: Int
): Unit
Flatten this object in to a Parcel.
| Parameters | |
|---|---|
dest |
Parcel: 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:
|