MediaRouteDescriptor
class MediaRouteDescriptor
kotlin.Any | |
↳ | androidx.mediarouter.media.MediaRouteDescriptor |
Describes the properties of a route.
Each route is uniquely identified by an opaque id string. This token may take any form as long as it is unique within the media route provider.
This object is immutable once created using a Builder
instance.
Summary
Nested classes | |
---|---|
Builder for |
Public methods | |
---|---|
Bundle! |
asBundle() Converts this object to a bundle for serialization. |
Boolean |
Gets whether the route can be disconnected without stopping playback. |
static MediaRouteDescriptor! |
fromBundle(bundle: Bundle!) Creates an instance from a bundle. |
Int |
Gets the connection state of the route. |
MutableList<IntentFilter!>! |
Gets the route's |
String! |
Gets the user-visible description of the route. |
Int |
Gets the type of the receiver device associated with this route. |
Bundle! |
Gets a bundle of extras for this route descriptor. |
Uri! |
Gets the URI of the icon representing this route. |
String! |
getId() Gets the unique id of the route. |
String! |
getName() Gets the user-visible name of the route. |
Int |
Gets the route's playback stream. |
Int |
Gets the type of playback associated with this route. |
Int |
Gets the route's presentation display id, or -1 if none. |
IntentSender! |
Gets an |
Int |
Gets the route's current volume, or 0 if unknown. |
Int |
Gets information about how volume is handled on the route. |
Int |
Gets the route's maximum volume, or 0 if unknown. |
Boolean |
Gets whether the route is connecting. |
Boolean |
Returns if this route is a dynamic group route. |
Boolean |
Gets whether the route is enabled. |
Boolean |
isValid() Returns true if the route descriptor has all of the required fields. |
String |
toString() |
Public methods
asBundle
fun asBundle(): Bundle!
Converts this object to a bundle for serialization.
Return | |
---|---|
Bundle! |
The contents of the object represented as a bundle. |
canDisconnectAndKeepPlaying
fun canDisconnectAndKeepPlaying(): Boolean
Gets whether the route can be disconnected without stopping playback.
The route can normally be disconnected without stopping playback when the destination device on the route is connected to two or more source devices. The route provider should update the route immediately when the number of connected devices changes.
To specify that the route should disconnect without stopping use MediaRouter#unselect(int)
with MediaRouter#UNSELECT_REASON_DISCONNECTED
.
fromBundle
static fun fromBundle(bundle: Bundle!): MediaRouteDescriptor!
Creates an instance from a bundle.
Parameters | |
---|---|
bundle |
Bundle!: The bundle, or null if none. |
Return | |
---|---|
MediaRouteDescriptor! |
The new instance, or null if the bundle was null. |
getConnectionState
fun getConnectionState(): Int
Gets the connection state of the route.
Return | |
---|---|
Int |
The connection state of this route: MediaRouter.RouteInfo#CONNECTION_STATE_DISCONNECTED , MediaRouter.RouteInfo#CONNECTION_STATE_CONNECTING , or MediaRouter.RouteInfo#CONNECTION_STATE_CONNECTED . |
getControlFilters
fun getControlFilters(): MutableList<IntentFilter!>!
Gets the route's media control intent
filters.
getDescription
fun getDescription(): String!
Gets the user-visible description of the route.
The route description describes the kind of destination represented by the route. It may be a user-supplied string, a model number or brand of device.
getDeviceType
fun getDeviceType(): Int
Gets the type of the receiver device associated with this route.
Return | |
---|---|
Int |
The type of the receiver device associated with this route: MediaRouter.RouteInfo#DEVICE_TYPE_TV or MediaRouter.RouteInfo#DEVICE_TYPE_SPEAKER . |
getExtras
fun getExtras(): Bundle