to top
Android APIs
public static final class

MediaRouteDescriptor.Builder

extends Object
java.lang.Object
   ↳ android.support.v7.media.MediaRouteDescriptor.Builder

Class Overview

Builder for media route descriptors.

Summary

Public Constructors
MediaRouteDescriptor.Builder(String id, String name)
Creates a media route descriptor builder.
MediaRouteDescriptor.Builder(MediaRouteDescriptor descriptor)
Creates a media route descriptor builder whose initial contents are copied from an existing descriptor.
Public Methods
MediaRouteDescriptor.Builder addControlFilter(IntentFilter filter)
Adds a media control intent filter for the route.
MediaRouteDescriptor.Builder addControlFilters(Collection<IntentFilter> filters)
Adds a list of media control intent filters for the route.
MediaRouteDescriptor build()
MediaRouteDescriptor.Builder setConnecting(boolean connecting)
Sets whether the route is in the process of connecting and is not yet ready for use.
MediaRouteDescriptor.Builder setDescription(String description)
Sets the user-visible description of the route.
MediaRouteDescriptor.Builder setEnabled(boolean enabled)
Sets whether the route is enabled.
MediaRouteDescriptor.Builder setExtras(Bundle extras)
Sets a bundle of extras for this route descriptor.
MediaRouteDescriptor.Builder setId(String id)
Sets the unique id of the route.
MediaRouteDescriptor.Builder setName(String name)
Sets the user-visible name of the route.
MediaRouteDescriptor.Builder setPlaybackStream(int playbackStream)
Sets the route's playback stream.
MediaRouteDescriptor.Builder setPlaybackType(int playbackType)
Sets the route's playback type.
MediaRouteDescriptor.Builder setPresentationDisplayId(int presentationDisplayId)
Sets the route's presentation display id, or -1 if none.
MediaRouteDescriptor.Builder setVolume(int volume)
Sets the route's current volume, or 0 if unknown.
MediaRouteDescriptor.Builder setVolumeHandling(int volumeHandling)
Sets the route's volume handling.
MediaRouteDescriptor.Builder setVolumeMax(int volumeMax)
Sets the route's maximum volume, or 0 if unknown.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public MediaRouteDescriptor.Builder (String id, String name)

Creates a media route descriptor builder.

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

public MediaRouteDescriptor.Builder (MediaRouteDescriptor descriptor)

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

Public Methods

public MediaRouteDescriptor.Builder addControlFilter (IntentFilter filter)

Adds a media control intent filter for the route.

public MediaRouteDescriptor.Builder addControlFilters (Collection<IntentFilter> filters)

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

public MediaRouteDescriptor build ()

public MediaRouteDescriptor.Builder setConnecting (boolean connecting)

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

public MediaRouteDescriptor.Builder setDescription (String description)

Sets 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.

public MediaRouteDescriptor.Builder setEnabled (boolean enabled)

Sets whether the route is enabled.

Disabled routes represent routes that a route provider knows about, such as paired Wifi Display receivers, but that are not currently available for use.

public MediaRouteDescriptor.Builder setExtras (Bundle extras)

Sets a bundle of extras for this route descriptor. The extras will be ignored by the media router but they may be used by applications.

public MediaRouteDescriptor.Builder setId (String id)

Sets the unique id of the route.

The route id associated with a route descriptor functions as a stable identifier for the route and must be unique among all routes offered by the provider.

public MediaRouteDescriptor.Builder setName (String name)

Sets 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.

public MediaRouteDescriptor.Builder setPlaybackStream (int playbackStream)

Sets the route's playback stream.

public MediaRouteDescriptor.Builder setPlaybackType (int playbackType)

Sets the route's playback type.

public MediaRouteDescriptor.Builder setPresentationDisplayId (int presentationDisplayId)

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

public MediaRouteDescriptor.Builder setVolume (int volume)

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

public MediaRouteDescriptor.Builder setVolumeHandling (int volumeHandling)

Sets the route's volume handling.

public MediaRouteDescriptor.Builder setVolumeMax (int volumeMax)

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