Android 12 Developer Preview is here! Try it out, and give us your feedback!

Builder

class Builder
kotlin.Any
   ↳ androidx.mediarouter.media.MediaRouteDescriptor.Builder

Builder for media route descriptors.

Summary

Public constructors
<init>(id: String!, name: String!)

Creates a media route descriptor builder.

Creates a media route descriptor builder whose initial contents are copied from an existing descriptor.

Public methods
MediaRouteDescriptor.Builder!

Adds a media control intent filter for the route.

MediaRouteDescriptor.Builder!

Adds a list of media control intent filters for the route.

MediaRouteDescriptor!

Builds the media route descriptor.

MediaRouteDescriptor.Builder!
setCanDisconnect(canDisconnect: Boolean)

Sets whether the route can be disconnected without stopping playback.

MediaRouteDescriptor.Builder!
setConnecting(connecting: Boolean)

Sets whether the route is in the process of connecting and is not yet ready for use.

MediaRouteDescriptor.Builder!
setConnectionState(connectionState: Int)

Sets the route's connection state.

MediaRouteDescriptor.Builder!
setDescription(description: String!)

Sets the user-visible description of the route.

MediaRouteDescriptor.Builder!
setDeviceType(deviceType: Int)

Sets the route's receiver device type.

MediaRouteDescriptor.Builder!
setEnabled(enabled: Boolean)

Sets whether the route is enabled.

MediaRouteDescriptor.Builder!
setExtras(extras: Bundle!)

Sets a bundle of extras for this route descriptor.

MediaRouteDescriptor.Builder!
setIconUri(iconUri: Uri!)

Sets the URI of the icon representing this route.

MediaRouteDescriptor.Builder!
setId(id: String!)

Sets the unique id of the route.

MediaRouteDescriptor.Builder!
setIsDynamicGroupRoute(isDynamicGroupRoute: Boolean)

Sets whether the route is a dynamic group route.

MediaRouteDescriptor.Builder!
setName(name: String!)

Sets the user-visible name of the route.

MediaRouteDescriptor.Builder!
setPlaybackStream(playbackStream: Int)

Sets the route's playback stream.

MediaRouteDescriptor.Builder!
setPlaybackType(playbackType: Int)

Sets the route's playback type.

MediaRouteDescriptor.Builder!
setPresentationDisplayId(presentationDisplayId: Int)

Sets the route's presentation display id, or -1 if none.

MediaRouteDescriptor.Builder!

Sets an intent sender for launching the settings activity for this route.

MediaRouteDescriptor.Builder!
setVolume(volume: Int)

Sets the route's current volume, or 0 if unknown.

MediaRouteDescriptor.Builder!
setVolumeHandling(volumeHandling: Int)

Sets the route's volume handling.

MediaRouteDescriptor.Builder!
setVolumeMax(volumeMax: Int)

Sets the route's maximum volume, or 0 if unknown.

Public constructors

<init>

Builder(
    id: String!,
    name: String!)

Creates a media route descriptor builder.

Parameters
id String!: The unique id of the route.
name String!: The user-visible name of the route.

<init>

Builder(descriptor: MediaRouteDescriptor!)

Creates a media route descriptor builder whose initial contents are copied from an existing descriptor.

Public methods

addControlFilter

fun addControlFilter(filter: IntentFilter!): MediaRouteDescriptor.Builder!

Adds a media control intent filter for the route.

addControlFilters

fun addControlFilters(filters: MutableCollection<IntentFilter!>!): MediaRouteDescriptor.Builder!

Adds a list of media control intent filters for the route.