# MediaRouter.GroupRouteInfo

Artifact: [androidx.mediarouter:mediarouter](https://developer.android.com/jetpack/androidx/releases/mediarouter) [View Source](https://cs.android.com/search?q=file:androidx/mediarouter/media/MediaRouter.java+class:androidx.mediarouter.media.MediaRouter.GroupRouteInfo) Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/mediarouter#1.8.0)

*** ** * ** ***


```
public class MediaRouter.GroupRouteInfo extends MediaRouter.RouteInfo
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.mediarouter.media.MediaRouter.RouteInfo](https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo) ||
|   | ↳ | [androidx.mediarouter.media.MediaRouter.GroupRouteInfo](https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.GroupRouteInfo) |

*** ** * ** ***

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

## Summary

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.GroupRouteInfo#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. |
| `static final int` | `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.GroupRouteInfo#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. |
| `static final int` | `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.GroupRouteInfo#ADD_ROUTE_FAILED_REASON_NOT_GROUPABLE() = 2` Adding a route to a dynamic group has failed because the route is not groupable. |
| `static final int` | `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.GroupRouteInfo#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. |
| `static final int` | `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.GroupRouteInfo#ADD_ROUTE_SUCCESSFUL() = 1` The `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.GroupRouteInfo#addRoute(androidx.mediarouter.media.MediaRouter.RouteInfo)` has added a route to the dynamic group. |
| `static final int` | `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.GroupRouteInfo#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. |
| `static final int` | `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.GroupRouteInfo#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. |
| `static final int` | `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.GroupRouteInfo#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. |
| `static final int` | `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.GroupRouteInfo#REMOVE_ROUTE_FAILED_REASON_NOT_UNSELECTABLE() = 2` Removing a route from a dynamic group has failed because the route is not unselectable. |
| `static final int` | `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.GroupRouteInfo#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. |
| `static final int` | `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.GroupRouteInfo#REMOVE_ROUTE_SUCCESSFUL() = 1` The `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.GroupRouteInfo#removeRoute(androidx.mediarouter.media.MediaRouter.RouteInfo)` has removed a route from the dynamic group. |

| ### Public methods |
|---|---|
| `int` | `@https://developer.android.com/reference/androidx/annotation/MainThread https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.GroupRouteInfo#addRoute(androidx.mediarouter.media.MediaRouter.RouteInfo)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo route)` Adds the route as a member of the dynamic group if the route is groupable. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo>` | `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.GroupRouteInfo#getRoutesInGroup()()` Returns the list of `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo`s of the given dynamic group route. |
| `int` | `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.GroupRouteInfo#getSelectionState(androidx.mediarouter.media.MediaRouter.RouteInfo)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo route)` Gets the selection state of the route when the route is in the dynamic group or `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouteProvider.DynamicGroupRouteController.DynamicRouteDescriptor#NOT_IN_GROUP()` when the route isn't in the dynamic group. |
| `boolean` | `@https://developer.android.com/reference/androidx/annotation/MainThread https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.GroupRouteInfo#isConnected()()` Returns `true` if this route is currently connected. |
| `boolean` | `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.GroupRouteInfo#isGroupable(androidx.mediarouter.media.MediaRouter.RouteInfo)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo route)` Returns `true` if the route is groupable and can be added to the dynamic group with the `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.GroupRouteInfo#addRoute(androidx.mediarouter.media.MediaRouter.RouteInfo)` method. |
| `boolean` | `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.GroupRouteInfo#isUnselectable(androidx.mediarouter.media.MediaRouter.RouteInfo)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo route)` Returns `true` if the route is in the dynamic group and is unselectable from the dynamic group with the `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.GroupRouteInfo#removeRoute(androidx.mediarouter.media.MediaRouter.RouteInfo)` method. |
| `int` | `@https://developer.android.com/reference/androidx/annotation/MainThread https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.GroupRouteInfo#removeRoute(androidx.mediarouter.media.MediaRouter.RouteInfo)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo route)` Removes the route from the dynamic group if the route is unselectable. |

### Inherited Constants

From [androidx.mediarouter.media.MediaRouter.RouteInfo](https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo) `static final int` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#CONNECTION_STATE_CONNECTED() = 2`

A connection state indicating the route is connected.
`static final int` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#CONNECTION_STATE_CONNECTING() = 1`

A connection state indicating the route is in the process of connecting and is not yet ready for use.
`static final int` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#CONNECTION_STATE_DISCONNECTED() = 0`

The default connection state indicating the route is disconnected.
`static final int` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#DEVICE_TYPE_AUDIO_VIDEO_RECEIVER() = 4`

A receiver device type indicating that the presentation of the media is happening on an Audio/Video receiver (AVR).
`static final int` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#DEVICE_TYPE_BLE_HEADSET() = 22`

A receiver device type indicating the presentation of the media is happening on a Bluetooth Low Energy (BLE) HEADSET.
`static final int` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#DEVICE_TYPE_BLUETOOTH_A2DP() = 3`

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` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#DEVICE_TYPE_BUILTIN_SPEAKER() = 12`

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` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#DEVICE_TYPE_CAR() = 9`

A receiver device type indicating that the presentation of the media is happening on a car.
`static final int` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#DEVICE_TYPE_COMPUTER() = 7`

A receiver device type indicating that the presentation of the media is happening on a computer.
`static final int` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#DEVICE_TYPE_DOCK() = 19`

A receiver device type indicating the presentation of the media is happening on an audio device associated on a dock.
`static final int` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#DEVICE_TYPE_GAME_CONSOLE() = 8`

A receiver device type indicating that the presentation of the media is happening on a gaming console.
`static final int` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#DEVICE_TYPE_GROUP() = 1000`

A receiver device type indicating that the presentation of the media is happening on a group of devices.
`static final int` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#DEVICE_TYPE_HDMI() = 16`

A receiver device type indicating the presentation of the media is happening on an HDMI connection.
`static final int` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#DEVICE_TYPE_HDMI_ARC() = 23`

A receiver device type indicating the presentation of the media is happening on an Audio Return Channel of an HDMI connection
`static final int` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#DEVICE_TYPE_HDMI_EARC() = 24`

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` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#DEVICE_TYPE_HEARING_AID() = 21`

A receiver device type indicating the presentation of the media is happening on a hearing aid device.
`static final int` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#DEVICE_TYPE_REMOTE_SPEAKER() = 2`

A receiver device type of the route indicating the presentation of the media is happening on a remote speaker.
`static final int` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#DEVICE_TYPE_SMARTPHONE() = 11`

A receiver device type indicating that the presentation of the media is happening on a smartphone.
`static final int` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#DEVICE_TYPE_SMARTWATCH() = 10`

A receiver device type indicating that the presentation of the media is happening on a smartwatch.
`static final int` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#DEVICE_TYPE_SPEAKER() = 2`

**This field is deprecated.**

use `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#DEVICE_TYPE_BUILTIN_SPEAKER()` and `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#DEVICE_TYPE_REMOTE_SPEAKER()` instead.

<br />

`static final int` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#DEVICE_TYPE_TABLET() = 5`

A receiver device type indicating that the presentation of the media is happening on a tablet.
`static final int` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#DEVICE_TYPE_TABLET_DOCKED() = 6`

A receiver device type indicating that the presentation of the media is happening on a docked tablet.
`static final int` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#DEVICE_TYPE_TV() = 1`

A receiver device type of the route indicating the presentation of the media is happening on a TV.
`static final int` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#DEVICE_TYPE_USB_ACCESSORY() = 18`

A receiver device type indicating the presentation of the media is happening on a USB audio device in accessory mode.
`static final int` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#DEVICE_TYPE_USB_DEVICE() = 17`

A receiver device type indicating the presentation of the media is happening on a USB audio device.
`static final int` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#DEVICE_TYPE_USB_HEADSET() = 20`

A receiver device type indicating the presentation of the media is happening on a USB audio headset.
`static final int` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#DEVICE_TYPE_WIRED_HEADPHONES() = 14`

A receiver device type indicating the presentation of the media is happening on a pair of wired headphones.
`static final int` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#DEVICE_TYPE_WIRED_HEADSET() = 13`

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` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#PLAYBACK_TYPE_LOCAL() = 0`

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` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#PLAYBACK_TYPE_REMOTE() = 1`

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` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#PLAYBACK_VOLUME_FIXED() = 0`

Playback information indicating the playback volume is fixed, i.e. it cannot be controlled from this object.
`static final int` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#PLAYBACK_VOLUME_VARIABLE() = 1`

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

### Inherited methods

From [androidx.mediarouter.media.MediaRouter.RouteInfo](https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo) `boolean` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#canDisconnect()()`

Gets whether this route supports disconnecting without interrupting playback.
`void` `@https://developer.android.com/reference/androidx/annotation/MainThread
https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#connect()()`

Connects this route without selecting it.
`void` `@https://developer.android.com/reference/androidx/annotation/MainThread
https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#disconnect()()`

Disconnects this route.
`int` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#getConnectionState()()`

Gets the connection state of the route.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/android/content/IntentFilter.html>` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#getControlFilters()()`

Gets a list of `https://developer.android.com/reference/androidx/mediarouter/media/MediaControlIntent` filters that describe the capabilities of this route and the media control actions that it supports.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#getDescription()()`

Gets the user-visible description of the route.
`int` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#getDeviceType()()`

Gets the type of the receiver device associated with this route.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/Bundle.html` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#getExtras()()`

Gets a collection of extra properties about this route that were supplied by its media route provider, or null if none.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/net/Uri.html` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#getIconUri()()`

Gets the URI of the icon representing this route.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#getId()()`

Gets the unique id of the route.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/mediarouter/media/MediaRouteDescriptor` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#getMediaRouteDescriptor()()`

Returns the `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouteDescriptor` of this media route info or `null` if it is not updated by its provider yet.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#getName()()`

Gets the user-visible name of the route.
`int` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#getPlaybackStream()()`

Gets the audio stream over which the playback associated with this route is performed.
`int` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#getPlaybackType()()`

Gets the type of playback associated with this route.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/view/Display.html` `@https://developer.android.com/reference/androidx/annotation/MainThread
https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#getPresentationDisplay()()`

Gets the `https://developer.android.com/reference/android/view/Display.html` that should be used by the application to show a `https://developer.android.com/reference/android/app/Presentation.html` on an external display when this route is selected.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.ProviderInfo` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#getProvider()()`

Gets information about the provider of this media route.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/content/IntentSender.html` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#getSettingsIntent()()`

Gets an intent sender for launching a settings activity for this route.
`int` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#getVolume()()`

Gets the current volume for this route.
`int` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#getVolumeHandling()()`

Gets information about how volume is handled on the route.
`int` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#getVolumeMax()()`

Gets the maximum volume at which the playback associated with this route is performed.
`boolean` `@https://developer.android.com/reference/androidx/annotation/MainThread
https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#isBluetooth()()`

Returns true if this route is a bluetooth route.
`boolean` `[isConnecting](https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#isConnecting())()`

**This method is deprecated.**

use `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#getConnectionState()` instead.

<br />

`boolean` `@https://developer.android.com/reference/androidx/annotation/MainThread
https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#isDefault()()`

Returns true if this route is the default route.
`boolean` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#isDeviceSpeaker()()`

Returns true if this route is the default route and the device speaker.
`boolean` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#isEnabled()()`

Returns true if this route is enabled and may be selected.
`boolean` `@https://developer.android.com/reference/androidx/annotation/MainThread
https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#isSelected()()`

Returns true if this route is currently selected.
`boolean` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#isSystemRoute()()`

Returns `true` if this route is a system route.
`boolean` `@https://developer.android.com/reference/androidx/annotation/MainThread
https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#matchesSelector(androidx.mediarouter.media.MediaRouteSelector)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/mediarouter/media/MediaRouteSelector selector)`

Returns true if the route supports at least one of the capabilities described by a media route selector.
`void` `@https://developer.android.com/reference/androidx/annotation/MainThread
https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#requestSetVolume(int)(int volume)`

Requests a volume change for this route asynchronously.
`void` `@https://developer.android.com/reference/androidx/annotation/MainThread
https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#requestUpdateVolume(int)(int delta)`

Requests an incremental volume update for this route asynchronously.
`void` `@https://developer.android.com/reference/androidx/annotation/MainThread
https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#select()()`

Selects this media route.
`void` `@https://developer.android.com/reference/androidx/annotation/MainThread
https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#sendControlRequest(android.content.Intent,androidx.mediarouter.media.MediaRouter.ControlRequestCallback)(
@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Intent.html intent,
@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.ControlRequestCallback callback
)`

Sends a `https://developer.android.com/reference/androidx/mediarouter/media/MediaControlIntent` request to be performed asynchronously by the route's destination.
`boolean` `@https://developer.android.com/reference/androidx/annotation/MainThread
https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#supportsControlAction(java.lang.String,java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html category, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html action)`

Returns true if the route supports the specified `https://developer.android.com/reference/androidx/mediarouter/media/MediaControlIntent` category and action.
`boolean` `@https://developer.android.com/reference/androidx/annotation/MainThread
https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#supportsControlCategory(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html category)`

Returns true if the route supports the specified `https://developer.android.com/reference/androidx/mediarouter/media/MediaControlIntent` category.
`boolean` `@https://developer.android.com/reference/androidx/annotation/MainThread
https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#supportsControlRequest(android.content.Intent)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Intent.html intent)`

Returns true if the route supports the specified `https://developer.android.com/reference/androidx/mediarouter/media/MediaControlIntent` request.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo#toString()()`

## Constants

### ADD_ROUTE_FAILED_REASON_ALREADY_IN_GROUP

Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/mediarouter#1.8.0)

```
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 |
|---|---|
| `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.GroupRouteInfo#addRoute(androidx.mediarouter.media.MediaRouter.RouteInfo)` |   |

### ADD_ROUTE_FAILED_REASON_NOT_AVAILABLE_ROUTE_CONNECTION

Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/mediarouter#1.8.0)

```
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 |
|---|---|
| `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.GroupRouteInfo#addRoute(androidx.mediarouter.media.MediaRouter.RouteInfo)` |   |

### ADD_ROUTE_FAILED_REASON_NOT_GROUPABLE

Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/mediarouter#1.8.0)

```
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 |
|---|---|
| `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.GroupRouteInfo#addRoute(androidx.mediarouter.media.MediaRouter.RouteInfo)` |   |

### ADD_ROUTE_FAILED_REASON_UNSUPPORTED_FOR_GROUP_ROUTE

Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/mediarouter#1.8.0)

```
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 |
|---|---|
| `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.GroupRouteInfo#addRoute(androidx.mediarouter.media.MediaRouter.RouteInfo)` |   |

### ADD_ROUTE_SUCCESSFUL

Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/mediarouter#1.8.0)

```
public static final int ADD_ROUTE_SUCCESSFUL = 1
```

The `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.GroupRouteInfo#addRoute(androidx.mediarouter.media.MediaRouter.RouteInfo)` has added a route to the dynamic group.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.GroupRouteInfo#addRoute(androidx.mediarouter.media.MediaRouter.RouteInfo)` |   |

### REMOVE_ROUTE_FAILED_REASON_LAST_ROUTE_IN_GROUP

Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/mediarouter#1.8.0)

```
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 |
|---|---|
| `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.GroupRouteInfo#removeRoute(androidx.mediarouter.media.MediaRouter.RouteInfo)` |   |

### REMOVE_ROUTE_FAILED_REASON_NOT_AVAILABLE_ROUTE_CONNECTION

Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/mediarouter#1.8.0)

```
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 |
|---|---|
| `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.GroupRouteInfo#removeRoute(androidx.mediarouter.media.MediaRouter.RouteInfo)` |   |

### REMOVE_ROUTE_FAILED_REASON_NOT_IN_GROUP

Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/mediarouter#1.8.0)

```
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 |
|---|---|
| `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.GroupRouteInfo#removeRoute(androidx.mediarouter.media.MediaRouter.RouteInfo)` |   |

### REMOVE_ROUTE_FAILED_REASON_NOT_UNSELECTABLE

Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/mediarouter#1.8.0)

```
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 |
|---|---|
| `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.GroupRouteInfo#removeRoute(androidx.mediarouter.media.MediaRouter.RouteInfo)` |   |

### REMOVE_ROUTE_FAILED_REASON_UNSUPPORTED_FOR_GROUP_ROUTE

Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/mediarouter#1.8.0)

```
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 |
|---|---|
| `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.GroupRouteInfo#removeRoute(androidx.mediarouter.media.MediaRouter.RouteInfo)` |   |

### REMOVE_ROUTE_SUCCESSFUL

Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/mediarouter#1.8.0)

```
public static final int REMOVE_ROUTE_SUCCESSFUL = 1
```

The `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.GroupRouteInfo#removeRoute(androidx.mediarouter.media.MediaRouter.RouteInfo)` has removed a route from the dynamic group.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.GroupRouteInfo#removeRoute(androidx.mediarouter.media.MediaRouter.RouteInfo)` |   |

## Public methods

### addRoute

Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/mediarouter#1.8.0)

```
@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 |
|---|---|
| `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.GroupRouteInfo#isGroupable(androidx.mediarouter.media.MediaRouter.RouteInfo)` |   |

### getRoutesInGroup

Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/mediarouter#1.8.0)

```
public @NonNull List<MediaRouter.RouteInfo> getRoutesInGroup()
```

Returns the list of `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.RouteInfo`s of the given dynamic group route.

### getSelectionState

Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/mediarouter#1.8.0)

```
public int getSelectionState(@NonNull MediaRouter.RouteInfo route)
```

Gets the selection state of the route when the route is in the dynamic group or `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouteProvider.DynamicGroupRouteController.DynamicRouteDescriptor#NOT_IN_GROUP()` when the route isn't in the dynamic group.

### isConnected

Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/mediarouter#1.8.0)

```
@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 |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter#getConnectedGroupRoutes()` |   |

### isGroupable

Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/mediarouter#1.8.0)

```
public boolean isGroupable(@NonNull MediaRouter.RouteInfo route)
```

Returns `true` if the route is groupable and can be added to the dynamic group with the `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.GroupRouteInfo#addRoute(androidx.mediarouter.media.MediaRouter.RouteInfo)` method.

### isUnselectable

Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/mediarouter#1.8.0)

```
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 `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.GroupRouteInfo#removeRoute(androidx.mediarouter.media.MediaRouter.RouteInfo)` method.

### removeRoute

Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/mediarouter#1.8.0)

```
@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 |
|---|---|
| `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter.GroupRouteInfo#isUnselectable(androidx.mediarouter.media.MediaRouter.RouteInfo)` |   |