Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

# MediaRouter2.OnGetControllerHintsListener

*** ** * ** ***

` public static interface MediaRouter2.OnGetControllerHintsListener `   
` `

|---|
| android.media.MediaRouter2.OnGetControllerHintsListener |

<br />

*** ** * ** ***

A listener interface to send optional app-specific hints when creating a `https://developer.android.com/reference/android/media/MediaRouter2.RoutingController`.

## Summary

| ### Public methods ||
|---|---|
| ` abstract https://developer.android.com/reference/android/os/Bundle` | ` https://developer.android.com/reference/android/media/MediaRouter2.OnGetControllerHintsListener#onGetControllerHints(android.media.MediaRoute2Info)(https://developer.android.com/reference/android/media/MediaRoute2Info route) ` Called when the `https://developer.android.com/reference/android/media/MediaRouter2` or the system is about to request a media route provider service to create a controller with the given route. |

## Public methods

### onGetControllerHints

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract Bundle onGetControllerHints (MediaRoute2Info route)
```

Called when the `https://developer.android.com/reference/android/media/MediaRouter2` or the system is about to request a media route provider service to create a controller with the given route. The `https://developer.android.com/reference/android/os/Bundle` returned here will be sent to media route provider service as a hint.

Since controller creation can be requested by the `https://developer.android.com/reference/android/media/MediaRouter2` and the system, set the listener as soon as possible after acquiring `https://developer.android.com/reference/android/media/MediaRouter2` instance. The method will be called on the same thread that calls `https://developer.android.com/reference/android/media/MediaRouter2#transferTo(android.media.MediaRoute2Info)` or the main thread if it is requested by the system.

<br />

| Parameters ||
|---|---|
| `route` | `MediaRoute2Info`: the route to create a controller with. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/Bundle` | An optional bundle of app-specific arguments to send to the provider, or `null` if none. The contents of this bundle may affect the result of controller creation. <br /> |

**See also:**

- `https://developer.android.com/reference/android/media/MediaRoute2ProviderService#onCreateSession(long,%20java.lang.String,%20java.lang.String,%20android.os.Bundle)`