Added in API level 30

OnGetControllerHintsListener


interface OnGetControllerHintsListener
android.media.MediaRouter2.OnGetControllerHintsListener

A listener interface to send optional app-specific hints when creating a RoutingController.

Summary

Public methods
abstract Bundle?

Called when the 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
abstract fun onGetControllerHints(route: MediaRoute2Info): Bundle?

Called when the MediaRouter2 or the system is about to request a media route provider service to create a controller with the given route. The Bundle returned here will be sent to media route provider service as a hint.

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

Parameters
route MediaRoute2Info: the route to create a controller with This value cannot be null.
Return
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.