belongs to Maven artifact com.android.support:mediarouter-v7:28.0.0-alpha1
MediaRouteDescriptor
public
final
class
MediaRouteDescriptor
extends Object
java.lang.Object | |
↳ | android.support.v7.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 MediaRouteDescriptor.Builder
instance.
Summary
Nested classes | |
---|---|
class |
MediaRouteDescriptor.Builder
Builder for |
Public methods | |
---|---|
Bundle
|
asBundle()
Converts this object to a bundle for serialization. |
boolean
|
canDisconnectAndKeepPlaying()
Gets whether the route can be disconnected without stopping playback. |
static
MediaRouteDescriptor
|
fromBundle(Bundle bundle)
Creates an instance from a bundle. |
int
|
getConnectionState()
Gets the connection state of the route. |
List<IntentFilter>
|
getControlFilters()
Gets the route's |
String
|
getDescription()
Gets the user-visible description of the route. |
int
|
getDeviceType()
Gets the type of the receiver device associated with this route. |
Bundle
|
getExtras()
Gets a bundle of extras for this route descriptor. |
Uri
|
getIconUri()
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
|
getPlaybackStream()
Gets the route's playback stream. |
int
|
getPlaybackType()
Gets the type of playback associated with this route. |
int
|
getPresentationDisplayId()
Gets the route's presentation display id, or -1 if none. |
IntentSender
|
getSettingsActivity()
Gets an |
int
|
getVolume()
Gets the route's current volume, or 0 if unknown. |
int
|
getVolumeHandling()
Gets information about how volume is handled on the route. |
int
|
getVolumeMax()
Gets the route's maximum volume, or 0 if unknown. |
boolean
|
isConnecting()
This method was deprecated
in API level 24.1.0.
Use |
boolean
|
isEnabled()
Gets whether the route is enabled. |
boolean
|
isValid()
Returns true if the route descriptor has all of the required fields. |
String
|
toString()
|
Inherited methods | |
---|---|
From
class
java.lang.Object
|
Public methods
asBundle
Bundle asBundle ()
Converts this object to a bundle for serialization.
Returns | |
---|---|
Bundle |
The contents of the object represented as a bundle. |
canDisconnectAndKeepPlaying
boolean canDisconnectAndKeepPlaying ()
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
unselect(int)
with
UNSELECT_REASON_DISCONNECTED
.
Returns | |
---|---|
boolean |
fromBundle
MediaRouteDescriptor fromBundle (Bundle bundle)
Creates an instance from a bundle.
Parameters | |
---|---|
bundle |
Bundle : The bundle, or null if none. |
Returns | |
---|---|
MediaRouteDescriptor |
The new instance, or null if the bundle was null. |
getConnectionState
int getConnectionState ()
Gets the connection state of the route.
Returns | |
---|---|
int |
The connection state of this route:
CONNECTION_STATE_DISCONNECTED ,
CONNECTION_STATE_CONNECTING , or
CONNECTION_STATE_CONNECTED .
|
getControlFilters
List<IntentFilter> getControlFilters ()
Gets the route's media control intent
filters.
Returns | |
---|---|
List<IntentFilter> |
getDescription
String getDescription ()
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.
Returns | |
---|---|
String |
getDeviceType
int getDeviceType ()
Gets the type of the receiver device associated with this route.
Returns | |
---|---|
int |
The type of the receiver device associated with this route:
DEVICE_TYPE_TV or
DEVICE_TYPE_SPEAKER .
|
getExtras
Bundle getExtras ()
Gets a bundle of extras for this route descriptor. The extras will be ignored by the media router but they may be used by applications.
Returns | |
---|---|
Bundle |
getIconUri
Uri getIconUri ()
Gets the URI of the icon representing this route.
This icon will be used in picker UIs if available.
Returns | |
---|---|
Uri |
getId
String getId ()
Gets the unique id of the route.
The route id associated with a route descriptor functions as a stable identifier for the route and must be unique among all routes offered by the provider.
Returns | |
---|---|
String |
getName
String getName ()
Gets the user-visible name of the route.
The route name identifies the destination represented by the route. It may be a user-supplied name, an alias, or device serial number.
Returns | |
---|---|
String |
getPlaybackStream
int getPlaybackStream ()
Gets the route's playback stream.
Returns | |
---|---|
int |
getPlaybackType
int getPlaybackType ()
Gets the type of playback associated with this route.
Returns | |
---|---|
int |
The type of playback associated with this route:
PLAYBACK_TYPE_LOCAL or
PLAYBACK_TYPE_REMOTE .
|
getPresentationDisplayId
int getPresentationDisplayId ()
Gets the route's presentation display id, or -1 if none.
Returns | |
---|---|
int |
getSettingsActivity
IntentSender getSettingsActivity ()
Gets an IntentSender
for starting a settings activity for this
route. The activity may have specific route settings or general settings
for the connected device or route provider.
Returns | |
---|---|
IntentSender |
An IntentSender to start a settings activity.
|
getVolume
int getVolume ()
Gets the route's current volume, or 0 if unknown.
Returns | |
---|---|
int |
getVolumeHandling
int getVolumeHandling ()
Gets information about how volume is handled on the route.
Returns | |
---|---|
int |
How volume is handled on the route:
PLAYBACK_VOLUME_FIXED or
PLAYBACK_VOLUME_VARIABLE .
|
getVolumeMax
int getVolumeMax ()
Gets the route's maximum volume, or 0 if unknown.
Returns | |
---|---|
int |
isConnecting
boolean isConnecting ()
This method was deprecated
in API level 24.1.0.
Use getConnectionState()
instead
Gets whether the route is connecting.
Returns | |
---|---|
boolean |
isEnabled
boolean isEnabled ()
Gets whether the route is enabled.
Returns | |
---|---|
boolean |
isValid
boolean isValid ()
Returns true if the route descriptor has all of the required fields.
Returns | |
---|---|
boolean |
toString
String toString ()
Returns | |
---|---|
String |
Interfaces
Classes
- MediaControlIntent
- MediaItemMetadata
- MediaItemStatus
- MediaItemStatus.Builder
- MediaRouteDescriptor
- MediaRouteDescriptor.Builder
- MediaRouteDiscoveryRequest
- MediaRouteProvider
- MediaRouteProvider.Callback
- MediaRouteProvider.ProviderMetadata
- MediaRouteProvider.RouteController
- MediaRouteProviderDescriptor
- MediaRouteProviderDescriptor.Builder
- MediaRouteProviderService
- MediaRouter
- MediaRouter.Callback
- MediaRouter.ControlRequestCallback
- MediaRouter.ProviderInfo
- MediaRouter.RouteInfo
- MediaRouteSelector
- MediaRouteSelector.Builder
- MediaSessionStatus
- MediaSessionStatus.Builder
- RemotePlaybackClient
- RemotePlaybackClient.ActionCallback
- RemotePlaybackClient.ItemActionCallback
- RemotePlaybackClient.SessionActionCallback
- RemotePlaybackClient.StatusCallback
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 2024-04-11 UTC.