Added in API level 16

UserRouteInfo


open class UserRouteInfo : MediaRouter.RouteInfo

Information about a route that the application may define and modify. A user route defaults to RouteInfo.PLAYBACK_TYPE_REMOTE and RouteInfo.PLAYBACK_VOLUME_FIXED.

Summary

Inherited constants
Int DEVICE_TYPE_BLUETOOTH

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

Int DEVICE_TYPE_SPEAKER

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

Int DEVICE_TYPE_TV

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

Int DEVICE_TYPE_UNKNOWN

The default receiver device type of the route indicating the type is unknown.

Int PLAYBACK_TYPE_LOCAL

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.

Int PLAYBACK_TYPE_REMOTE

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.

Int PLAYBACK_VOLUME_FIXED

Playback information indicating the playback volume is fixed, i.e. it cannot be controlled from this object. An example of fixed playback volume is a remote player, playing over HDMI where the user prefers to control the volume on the HDMI sink, rather than attenuate at the source.

Int PLAYBACK_VOLUME_VARIABLE

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

Public methods
open RemoteControlClient!

Retrieve the RemoteControlClient associated with this route, if one has been set.

open Unit

open Unit

open Unit

Set the user-visible description of this route.

open Unit

Set an icon that will be used to represent this route.

open Unit

Set an icon that will be used to represent this route.

open Unit
setName(resId: Int)

Set the user-visible name of this route.

open Unit

Set the user-visible name of this route.

open Unit

Defines over what stream type the media is presented.

open Unit

Defines whether playback associated with this route is "local" (RouteInfo.PLAYBACK_TYPE_LOCAL) or "remote" (RouteInfo.PLAYBACK_TYPE_REMOTE).

open Unit

Set the RemoteControlClient responsible for reporting playback info for this user route.

open Unit

Set the current user-visible status for this route.

open Unit
setVolume(volume: Int)

Defines at what volume the playback associated with this route is performed (for user feedback purposes).

open Unit

Set a callback to be notified of volume update requests

open Unit
setVolumeHandling(volumeHandling: Int)

Defines whether volume for the playback associated with this route is fixed (RouteInfo.PLAYBACK_VOLUME_FIXED) or can modified (RouteInfo.PLAYBACK_VOLUME_VARIABLE).

open Unit
setVolumeMax(volumeMax: Int)

Defines the maximum volume at which the playback associated with this route is performed (for user feedback purposes).

Inherited functions
MediaRouter.RouteCategory! getCategory()

CharSequence! getDescription()

Gets the user-visible description of the route.

The route description describes the kind of destination represented by the route. It may be a user-supplied string, a model number or brand of device.

Int getDeviceType()

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

MediaRouter.RouteGroup! getGroup()

Drawable! getIconDrawable()

Get the icon representing this route. This icon will be used in picker UIs if available.

CharSequence! getName()

Gets the user-visible name of the route.

The route name identifies the destination represented by the route. It may be a user-supplied name, an alias, or device serial number.

CharSequence! getName(context: Context!)

Return the properly localized/resource user-visible name of this route.

The route name identifies the destination represented by the route. It may be a user-supplied name, an alias, or device serial number.

Int getPlaybackStream()

Int getPlaybackType()

Display! getPresentationDisplay()

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. Depending on the route, this may only be valid if the route is currently selected.

The preferred presentation display may change independently of the route being selected or unselected. For example, the presentation display of the default system route may change when an external HDMI display is connected or disconnected even though the route itself has not changed.

This method may return null if there is no external display associated with the route or if the display is not ready to show UI yet.

The application should listen for changes to the presentation display using the Callback.onRoutePresentationDisplayChanged callback and show or dismiss its android.app.Presentation accordingly when the display becomes available or is removed.

This method only makes sense for live video routes.

CharSequence! getStatus()

Int getSupportedTypes()

Any! getTag()

Int getVolume()

Return the current volume for this route. Depending on the route, this may only be valid if the route is currently selected.

Int getVolumeHandling()

Int getVolumeMax()

Boolean isConnecting()

Returns true if the route is in the process of connecting and is not yet ready for use.

Boolean isEnabled()

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

Unit setTag(tag: Any!)

Set an application-specific tag object for this route. The application may use this to store arbitrary data associated with the route for internal tracking.

Note that the lifespan of a route may be well past the lifespan of an Activity or other Context; take care that objects you store here will not keep more data in memory alive than you intend.

String toString()

Public methods

getRemoteControlClient

Added in API level 16
open fun getRemoteControlClient(): RemoteControlClient!

Retrieve the RemoteControlClient associated with this route, if one has been set.

Return
RemoteControlClient! the RemoteControlClient associated with this route

requestSetVolume

Added in API level 16
open fun requestSetVolume(volume: Int): Unit
Parameters
volume Int: value between 0 and getVolumeMax

requestUpdateVolume

Added in API level 16
open fun requestUpdateVolume(direction: Int): Unit
Parameters
direction Int: Delta to apply to the current volume

setDescription

Added in API level 18
open fun setDescription(description: CharSequence!): Unit

Set the user-visible description of this route.

The route description describes the kind of destination represented by the route. It may be a user-supplied string, a model number or brand of device.

Parameters
description CharSequence!: The description of the route, or null if none.

setIconDrawable

Added in API level 16
open fun setIconDrawable(icon: Drawable!): Unit

Set an icon that will be used to represent this route. The system may use this icon in picker UIs or similar.

Parameters
icon Drawable!: icon drawable to use to represent this route

setIconResource

Added in API level 16
open fun setIconResource(resId: Int): Unit

Set an icon that will be used to represent this route. The system may use this icon in picker UIs or similar.

Parameters
resId Int: Resource ID of an icon drawable to use to represent this route

setName

Added in API level 16
open fun setName(resId: Int): Unit

Set the user-visible name of this route.

The route name identifies the destination represented by the route. It may be a user-supplied name, an alias, or device serial number.

Parameters
resId Int: Resource ID of the name to display to the user to describe this route

setName

Added in API level 16
open fun setName(name: CharSequence!): Unit

Set the user-visible name of this route.

Parameters
name CharSequence!: Name to display to the user to describe this route

setPlaybackStream

Added in API level 16
open fun setPlaybackStream(stream: Int): Unit

Defines over what stream type the media is presented.

Parameters
stream Int:

setPlaybackType

Added in API level 16
open fun setPlaybackType(type: Int): Unit

Defines whether playback associated with this route is "local" (RouteInfo.PLAYBACK_TYPE_LOCAL) or "remote" (RouteInfo.PLAYBACK_TYPE_REMOTE).

setRemoteControlClient

Added in API level 16
open fun setRemoteControlClient(rcc: RemoteControlClient!): Unit

Set the RemoteControlClient responsible for reporting playback info for this user route.

If this route manages remote playback, the data exposed by this RemoteControlClient will be used to reflect and update information such as route volume info in related UIs.

The RemoteControlClient must have been previously registered with AudioManager.registerRemoteControlClient(RemoteControlClient).

Parameters
rcc RemoteControlClient!: RemoteControlClient associated with this route

setStatus

Added in API level 16
open fun setStatus(status: CharSequence!): Unit

Set the current user-visible status for this route.

Parameters
status CharSequence!: Status to display to the user to describe what the endpoint of this route is currently doing

setVolume

Added in API level 16
open fun setVolume(volume: Int): Unit

Defines at what volume the playback associated with this route is performed (for user feedback purposes). This information is only used when the playback is not local.

Parameters
volume Int:

setVolumeCallback

Added in API level 16
open fun setVolumeCallback(vcb: MediaRouter.VolumeCallback!): Unit

Set a callback to be notified of volume update requests

Parameters
vcb MediaRouter.VolumeCallback!:

setVolumeHandling

Added in API level 16
open fun setVolumeHandling(volumeHandling: Int): Unit

Defines whether volume for the playback associated with this route is fixed (RouteInfo.PLAYBACK_VOLUME_FIXED) or can modified (RouteInfo.PLAYBACK_VOLUME_VARIABLE).

setVolumeMax

Added in API level 16
open fun setVolumeMax(volumeMax: Int): Unit

Defines the maximum volume at which the playback associated with this route is performed (for user feedback purposes). This information is only used when the playback is not local.

Parameters
volumeMax Int: