MediaRouter.GroupRouteInfo


public class MediaRouter.GroupRouteInfo extends MediaRouter.RouteInfo


Provides information about a media route that represents a dynamic group.

Summary

Constants

static final int

Adding a route to a dynamic group has failed because the route is already in the group.

static final int

Adding a route to a dynamic group has failed because the group route is a connected route but there is no available route connection for adding a route.

static final int

Adding a route to a dynamic group has failed because the route is not groupable.

static final int

Adding a route to a dynamic group has failed because the group route doesn't support adding a route.

static final int

The addRoute has added a route to the dynamic group.

static final int

Removing a route from a dynamic group has failed because the route is the last route in the group.

static final int

Removing a route from a dynamic group has failed because the group route is a connected route but there is no available route connection for removing a route.

static final int

Removing a route from a dynamic group has failed because the route isn't in the group.

static final int

Removing a route from a dynamic group has failed because the route is not unselectable.

static final int

Removing a route from a dynamic group has failed because the group route doesn't support removing a route.

static final int

The removeRoute has removed a route from the dynamic group.

static final int

Updating routes for a dynamic group has failed because the group route is a connected route but there is no available route connection for updating routes.

static final int

Updating routes for a dynamic group has failed because the updated routes don't contain any transferable route.

static final int

Updating routes for a dynamic group has failed because the group route doesn't support updating routes.

static final int

The updateRoutes has updated routes for the dynamic group.

Public methods

int

Adds the route as a member of the dynamic group if the route is groupable.

@NonNull List<MediaRouter.RouteInfo>

Returns the list of RouteInfos of the given dynamic group route.

int

Gets the selection state of the route when the route is in the dynamic group or NOT_IN_GROUP when the route isn't in the dynamic group.

boolean

Returns true if this route is currently connected.

boolean

Returns true if the route is groupable and can be added to the dynamic group with the addRoute method.

boolean

Returns true if the route is transferable and can be updated for the dynamic group with the updateRoutes method.

boolean

Returns true if the route is in the dynamic group and is unselectable from the dynamic group with the removeRoute method.

int

Removes the route from the dynamic group if the route is unselectable.

int

Updates the routes to be members of the dynamic group if the routes are transferable.

Inherited Constants

From androidx.mediarouter.media.MediaRouter.RouteInfo
static final int

A connection state indicating the route is connected.

static final int

A connection state indicating the route is in the process of connecting and is not yet ready for use.

static final int

The default connection state indicating the route is disconnected.

static final int

A receiver device type indicating that the presentation of the media is happening on an Audio/Video receiver (AVR).

static final int

A receiver device type indicating the presentation of the media is happening on a Bluetooth Low Energy (BLE) HEADSET.

static final int

A receiver device type of the route indicating the presentation of the media is happening on a bluetooth device such as a bluetooth speaker.

static final int

A receiver device type indicating the presentation of the media is happening on a speaker system (i.e. a mono speaker or stereo speakers) built into the device.

static final int

A receiver device type indicating that the presentation of the media is happening on a car.

static final int

A receiver device type indicating that the presentation of the media is happening on a computer.

static final int

A receiver device type indicating the presentation of the media is happening on an audio device associated on a dock.

static final int

A receiver device type indicating that the presentation of the media is happening on a gaming console.

static final int

A receiver device type indicating that the presentation of the media is happening on a group of devices.

static final int

A receiver device type indicating the presentation of the media is happening on an HDMI connection.

static final int

A receiver device type indicating the presentation of the media is happening on an Audio Return Channel of an HDMI connection

static final int

A receiver device type indicating the presentation of the media is happening on an Enhanced Audio Return Channel of an HDMI connection

static final int

A receiver device type indicating the presentation of the media is happening on a hearing aid device.

static final int

A receiver device type of the route indicating the presentation of the media is happening on a remote speaker.

static final int

A receiver device type indicating that the presentation of the media is happening on a smartphone.

static final int

A receiver device type indicating that the presentation of the media is happening on a smartwatch.

static final int

This field is deprecated.

use DEVICE_TYPE_BUILTIN_SPEAKER and DEVICE_TYPE_REMOTE_SPEAKER instead.

static final int

A receiver device type indicating that the presentation of the media is happening on a tablet.

static final int

A receiver device type indicating that the presentation of the media is happening on a docked tablet.

static final int

A receiver device type of the route indicating the presentation of the media is happening on a TV.

static final int

A receiver device type indicating the presentation of the media is happening on a USB audio device in accessory mode.

static final int

A receiver device type indicating the presentation of the media is happening on a USB audio device.

static final int

A receiver device type indicating the presentation of the media is happening on a USB audio headset.

static final int

A receiver device type indicating the presentation of the media is happening on a pair of wired headphones.

static final int

A receiver device type indicating the presentation of the media is happening on a headset, which is the combination of a headphones and a microphone.

static final int

The default playback type, "local", indicating the presentation of the media is happening on the same device (e.g. a phone, a tablet) as where it is controlled from.

static final int

A playback type indicating the presentation of the media is happening on a different device (i.e. the remote device) than where it is controlled from.

static final int

Playback information indicating the playback volume is fixed, i.e. it cannot be controlled from this object.

static final int

Playback information indicating the playback volume is variable and can be controlled from this object.

Inherited methods

From androidx.mediarouter.media.MediaRouter.RouteInfo
boolean

Gets whether this route supports disconnecting without interrupting playback.

void

Connects this route without selecting it.

void

Disconnects this route.

int

Gets the connection state of the route.

@NonNull List<IntentFilter>

Gets a list of media control intent filters that describe the capabilities of this route and the media control actions that it supports.

@Nullable String

Gets the user-visible description of the route.

int

Gets the type of the receiver device associated with this route.

@Nullable Bundle

Gets a collection of extra properties about this route that were supplied by its media route provider, or null if none.

@Nullable Uri

Gets the URI of the icon representing this route.

@NonNull String

Gets the unique id of the route.

@Nullable MediaRouteDescriptor

Returns the MediaRouteDescriptor of this media route info or null if it is not updated by its provider yet.

@NonNull String

Gets the user-visible name of the route.

int

Gets the audio stream over which the playback associated with this route is performed.

int

Gets the type of playback associated with this route.

@Nullable Display

Gets the Display that should be used by the application to show a android.app.Presentation on an external display when this route is selected.

@NonNull MediaRouter.ProviderInfo

Gets information about the provider of this media route.

@Nullable IntentSender

Gets an intent sender for launching a settings activity for this route.

int

Gets the current volume for this route.

int

Gets information about how volume is handled on the route.

int

Gets the maximum volume at which the playback associated with this route is performed.

boolean

Returns true if this route is a bluetooth route.

boolean

This method is deprecated.

use getConnectionState instead.

boolean

Returns true if this route is the default route.

boolean

Returns true if this route is the default route and the device speaker.

boolean

Returns true if this route is enabled and may be selected.

boolean

Returns true if this route is currently selected.

boolean

Returns true if this route is a system route.

boolean

Returns true if the route supports at least one of the capabilities described by a media route selector.

void

Requests a volume change for this route asynchronously.

void

Requests an incremental volume update for this route asynchronously.

void

Selects this media route.

void

Sends a media control request to be performed asynchronously by the route's destination.

boolean

Returns true if the route supports the specified media control category and action.

boolean

Returns true if the route supports the specified media control category.

boolean

Returns true if the route supports the specified media control request.

@NonNull String

Constants

ADD_ROUTE_FAILED_REASON_ALREADY_IN_GROUP

Added in 1.8.0-alpha02
public static final int ADD_ROUTE_FAILED_REASON_ALREADY_IN_GROUP = 3

Adding a route to a dynamic group has failed because the route is already in the group.

See also
addRoute

ADD_ROUTE_FAILED_REASON_NOT_AVAILABLE_ROUTE_CONNECTION

Added in 1.8.0-alpha02
public static final int ADD_ROUTE_FAILED_REASON_NOT_AVAILABLE_ROUTE_CONNECTION = 5

Adding a route to a dynamic group has failed because the group route is a connected route but there is no available route connection for adding a route.

See also
addRoute

ADD_ROUTE_FAILED_REASON_NOT_GROUPABLE

Added in 1.8.0-alpha02
public static final int ADD_ROUTE_FAILED_REASON_NOT_GROUPABLE = 2

Adding a route to a dynamic group has failed because the route is not groupable.

See also
addRoute

ADD_ROUTE_FAILED_REASON_UNSUPPORTED_FOR_GROUP_ROUTE

Added in 1.8.0-alpha02
public static final int ADD_ROUTE_FAILED_REASON_UNSUPPORTED_FOR_GROUP_ROUTE = 4

Adding a route to a dynamic group has failed because the group route doesn't support adding a route.

See also
addRoute

ADD_ROUTE_SUCCESSFUL

Added in 1.8.0-alpha02
public static final int ADD_ROUTE_SUCCESSFUL = 1

The addRoute has added a route to the dynamic group.

See also
addRoute

REMOVE_ROUTE_FAILED_REASON_LAST_ROUTE_IN_GROUP

Added in 1.8.0-alpha02
public static final int REMOVE_ROUTE_FAILED_REASON_LAST_ROUTE_IN_GROUP = 4

Removing a route from a dynamic group has failed because the route is the last route in the group.

See also
removeRoute

REMOVE_ROUTE_FAILED_REASON_NOT_AVAILABLE_ROUTE_CONNECTION

Added in 1.8.0-alpha02
public static final int REMOVE_ROUTE_FAILED_REASON_NOT_AVAILABLE_ROUTE_CONNECTION = 6

Removing a route from a dynamic group has failed because the group route is a connected route but there is no available route connection for removing a route.

See also
removeRoute

REMOVE_ROUTE_FAILED_REASON_NOT_IN_GROUP

Added in 1.8.0-alpha02
public static final int REMOVE_ROUTE_FAILED_REASON_NOT_IN_GROUP = 3

Removing a route from a dynamic group has failed because the route isn't in the group.

See also
removeRoute

REMOVE_ROUTE_FAILED_REASON_NOT_UNSELECTABLE

Added in 1.8.0-alpha02
public static final int REMOVE_ROUTE_FAILED_REASON_NOT_UNSELECTABLE = 2

Removing a route from a dynamic group has failed because the route is not unselectable.

See also
removeRoute

REMOVE_ROUTE_FAILED_REASON_UNSUPPORTED_FOR_GROUP_ROUTE

Added in 1.8.0-alpha02
public static final int REMOVE_ROUTE_FAILED_REASON_UNSUPPORTED_FOR_GROUP_ROUTE = 5

Removing a route from a dynamic group has failed because the group route doesn't support removing a route.

See also
removeRoute

REMOVE_ROUTE_SUCCESSFUL

Added in 1.8.0-alpha02
public static final int REMOVE_ROUTE_SUCCESSFUL = 1

The removeRoute has removed a route from the dynamic group.

See also
removeRoute

UPDATE_ROUTES_FAILED_REASON_NOT_AVAILABLE_ROUTE_CONNECTION

Added in 1.8.0-alpha02
public static final int UPDATE_ROUTES_FAILED_REASON_NOT_AVAILABLE_ROUTE_CONNECTION = 4

Updating routes for a dynamic group has failed because the group route is a connected route but there is no available route connection for updating routes.

See also
updateRoutes

UPDATE_ROUTES_FAILED_REASON_NOT_TRANSFERABLE

Added in 1.8.0-alpha02
public static final int UPDATE_ROUTES_FAILED_REASON_NOT_TRANSFERABLE = 2

Updating routes for a dynamic group has failed because the updated routes don't contain any transferable route.

See also
updateRoutes

UPDATE_ROUTES_FAILED_REASON_UNSUPPORTED_FOR_GROUP_ROUTE

Added in 1.8.0-alpha02
public static final int UPDATE_ROUTES_FAILED_REASON_UNSUPPORTED_FOR_GROUP_ROUTE = 3

Updating routes for a dynamic group has failed because the group route doesn't support updating routes.

See also
updateRoutes

UPDATE_ROUTES_SUCCESSFUL

Added in 1.8.0-alpha02
public static final int UPDATE_ROUTES_SUCCESSFUL = 1

The updateRoutes has updated routes for the dynamic group.

See also
updateRoutes

Public methods

addRoute

Added in 1.8.0-alpha02
@MainThread
public int addRoute(@NonNull MediaRouter.RouteInfo route)

Adds the route as a member of the dynamic group if the route is groupable.

If the route is not groupable or is already in the dynamic group, then adding it to the dynamic group will do nothing.

Returns
int

The state of adding a route to the dynamic group.

See also
isGroupable

getRoutesInGroup

Added in 1.8.0-alpha02
public @NonNull List<MediaRouter.RouteInfogetRoutesInGroup()

Returns the list of RouteInfos of the given dynamic group route.

getSelectionState

Added in 1.8.0-alpha02
public int getSelectionState(@NonNull MediaRouter.RouteInfo route)

Gets the selection state of the route when the route is in the dynamic group or NOT_IN_GROUP when the route isn't in the dynamic group.

isConnected

Added in 1.8.0-alpha02
@MainThread
public boolean isConnected()

Returns true if this route is currently connected.

Must be called on the main thread.

Returns
boolean

True if this route is currently connected

isGroupable

Added in 1.8.0-alpha02
public boolean isGroupable(@NonNull MediaRouter.RouteInfo route)

Returns true if the route is groupable and can be added to the dynamic group with the addRoute method.

isTransferable

Added in 1.8.0-alpha02
public boolean isTransferable(@NonNull MediaRouter.RouteInfo route)

Returns true if the route is transferable and can be updated for the dynamic group with the updateRoutes method.

isUnselectable

Added in 1.8.0-alpha02
public boolean isUnselectable(@NonNull MediaRouter.RouteInfo route)

Returns true if the route is in the dynamic group and is unselectable from the dynamic group with the removeRoute method.

removeRoute

Added in 1.8.0-alpha02
@MainThread
public int removeRoute(@NonNull MediaRouter.RouteInfo route)

Removes the route from the dynamic group if the route is unselectable.

If the route is not unselectable, not in the dynamic group, or is the last route of the dynamic group, then removing it from the dynamic group will do nothing.

Returns
int

The state of removing a route from the dynamic group.

See also
isUnselectable

updateRoutes

Added in 1.8.0-alpha02
@MainThread
public int updateRoutes(@NonNull List<MediaRouter.RouteInfo> routes)

Updates the routes to be members of the dynamic group if the routes are transferable. Non-transferable routes will not be included in the dynamic group.

Returns
int

The state of updating routes for the dynamic group.

See also
isTransferable