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 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 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 | |
Boolean | |
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 id of the route. |
CharSequence |
getName() Gets the user-visible name of the route. |
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() |
Boolean |
Returns whether the route is a system route or not. |
String |
toString() |
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: 2
See 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: 1
See Also
CONNECTION_STATE_DISCONNECTED
static val CONNECTION_STATE_DISCONNECTED: Int
The default connection state indicating the route is disconnected.
Value: 0
See 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: 0
See 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: 1
See 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: 2
SUITABILITY_STATUS_SUITABLE_FOR_DEFAULT_TRANSFER
static val SUITABILITY_STATUS_SUITABLE_FOR_DEFAULT_TRANSFER: Int
Indicates the route is always suitable for media playback.
Value: 0
SUITABILITY_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: 1
TYPE_BLE_HEADSET
static val TYPE_BLE_HEADSET: Int
Indicates the route is a Bluetooth Low Energy (BLE) HEADSET.
Value: 26
See Also
TYPE_BLUETOOTH_A2DP
static val TYPE_BLUETOOTH_A2DP: Int
Indicates the route is a bluetooth device, such as a bluetooth speaker or headphones.
Value: 8
See Also
TYPE_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: 2
See Also
TYPE_DOCK
static val TYPE_DOCK: Int
Indicates the route is the audio device associated with a dock.
Value: 13
See Also
TYPE_GROUP
static val TYPE_GROUP: Int
Indicates the route is a group of devices.
Value: 2000
See Also
TYPE_HDMI
static val TYPE_HDMI: Int
Indicates the route is an HDMI connection.
Value: 9
See Also
TYPE_HDMI_ARC
static val TYPE_HDMI_ARC: Int
Indicates the route is an Audio Return Channel of an HDMI connection.
Value: 10
See Also
TYPE_HDMI_EARC
static val TYPE_HDMI_EARC: Int
Indicates the route is an Enhanced Audio Return Channel of an HDMI connection.
Value: 29
See Also
TYPE_HEARING_AID
static val TYPE_HEARING_AID: Int
Indicates the route is a hearing aid.
Value: 23
See Also
TYPE_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: 1003
See 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: 1008
See 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: 1006
See 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: 1007
See 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: 1010
See 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: 1009
See 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: 1002
See 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: 1004
See 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: 1005
See 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: 1001
See Also
TYPE_UNKNOWN
static val TYPE_UNKNOWN: Int
Indicates the route's type is unknown or undefined.
Value: 0
See Also
TYPE_USB_ACCESSORY
static val TYPE_USB_ACCESSORY: Int
Indicates the route is a USB audio device in accessory mode.
Value: 12
See Also
TYPE_USB_DEVICE
static val TYPE_USB_DEVICE: Int
Indicates the route is a USB audio device.
Value: 11
See Also
TYPE_USB_HEADSET
static val TYPE_USB_HEADSET: Int
Indicates the route is a USB audio headset.
Value: 22
See Also
TYPE_WIRED_HEADPHONES
static val TYPE_WIRED_HEADPHONES: Int
Indicates the route is a pair of wired headphones.
Value: 4
See Also
TYPE_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: 3
See Also
Public methods
describeContents
fun describeContents(): Int
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. |
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 android.media.MediaRoute2Info#CONNECTION_STATE_DISCONNECTED , android.media.MediaRoute2Info#CONNECTION_STATE_CONNECTING , or android.media.MediaRoute2Info#CONNECTION_STATE_CONNECTED |
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 id of the route. The routes which are given by MediaRouter2
will have unique IDs.
In order to ensure uniqueness in MediaRouter2
side, the value of this method can be different from what was set in MediaRoute2ProviderService
.
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 . |
getSuitabilityStatus
fun getSuitabilityStatus(): Int
Returns the route suitability status.
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 android.media.MediaRoute2Info#PLAYBACK_VOLUME_FIXED , or android.media.MediaRoute2Info#PLAYBACK_VOLUME_VARIABLE |
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
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 android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE , and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |