added in version 22.1.0
belongs to Maven artifact


public final class MediaRouteDescriptor
extends Object


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.


Nested classes

class MediaRouteDescriptor.Builder

Builder for media route descriptors

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 media control intent filters.

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 IntentSender for starting a settings activity for this route.

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 getConnectionState() instead

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