public
static
final
class
MediaRouteDescriptor.Builder
extends Object
java.lang.Object | |
↳ | android.support.v7.media.MediaRouteDescriptor.Builder |
Builder for media route descriptors
.
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 |
MediaRouteDescriptor.Builder
|
addControlFilters(Collection<IntentFilter> filters)
Adds a list of |
MediaRouteDescriptor
|
build()
Builds the |
MediaRouteDescriptor.Builder
|
setCanDisconnect(boolean canDisconnect)
Sets whether the route can be disconnected without stopping playback. |
MediaRouteDescriptor.Builder
|
setConnecting(boolean connecting)
This method is deprecated.
Use |
MediaRouteDescriptor.Builder
|
setConnectionState(int connectionState)
Sets the route's connection state. |
MediaRouteDescriptor.Builder
|
setDescription(String description)
Sets the user-visible description of the route. |
MediaRouteDescriptor.Builder
|
setDeviceType(int deviceType)
Sets the route's receiver device type. |
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
|
setIconUri(Uri iconUri)
Sets the URI of the icon representing this route. |
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
|
setSettingsActivity(IntentSender is)
Sets an intent sender for launching the settings activity for this route. |
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. |
Inherited methods | |
---|---|
From
class
java.lang.Object
|
MediaRouteDescriptor.Builder (String id, String name)
Creates a media route descriptor builder.
Parameters | |
---|---|
id |
String :
The unique id of the route. |
name |
String :
The user-visible name of the route.
|
MediaRouteDescriptor.Builder (MediaRouteDescriptor descriptor)
Creates a media route descriptor builder whose initial contents are copied from an existing descriptor.
Parameters | |
---|---|
descriptor |
MediaRouteDescriptor
|
MediaRouteDescriptor.Builder addControlFilter (IntentFilter filter)
Adds a media control intent
filter for the route.
Parameters | |
---|---|
filter |
IntentFilter
|
Returns | |
---|---|
MediaRouteDescriptor.Builder |
MediaRouteDescriptor.Builder addControlFilters (Collection<IntentFilter> filters)
Adds a list of media control intent
filters for the route.
Parameters | |
---|---|
filters |
Collection
|
Returns | |
---|---|
MediaRouteDescriptor.Builder |
MediaRouteDescriptor.Builder setCanDisconnect (boolean canDisconnect)
Sets whether the route can be disconnected without stopping playback.
Parameters | |
---|---|
canDisconnect |
boolean
|
Returns | |
---|---|
MediaRouteDescriptor.Builder |
MediaRouteDescriptor.Builder setConnecting (boolean connecting)
This method is deprecated.
Use setConnectionState(int)
instead.
Sets whether the route is in the process of connecting and is not yet ready for use.
Parameters | |
---|---|
connecting |
boolean
|
Returns | |
---|---|
MediaRouteDescriptor.Builder |
MediaRouteDescriptor.Builder setConnectionState (int connectionState)
Sets the route's connection state.
Parameters | |
---|---|
connectionState |
int :
The connection state of the route:
CONNECTION_STATE_DISCONNECTED ,
CONNECTION_STATE_CONNECTING , or
CONNECTION_STATE_CONNECTED .
|
Returns | |
---|---|
MediaRouteDescriptor.Builder |
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.
Parameters | |
---|---|
description |
String
|
Returns | |
---|---|
MediaRouteDescriptor.Builder |
MediaRouteDescriptor.Builder setDeviceType (int deviceType)
Sets the route's receiver device type.
Parameters | |
---|---|
deviceType |
int :
The receive device type of the route:
DEVICE_TYPE_TV or
DEVICE_TYPE_SPEAKER .
|
Returns | |
---|---|
MediaRouteDescriptor.Builder |
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.
Parameters | |
---|---|
enabled |
boolean
|
Returns | |
---|---|
MediaRouteDescriptor.Builder |
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.
Parameters | |
---|---|
extras |
Bundle
|
Returns | |
---|---|
MediaRouteDescriptor.Builder |
MediaRouteDescriptor.Builder setIconUri (Uri iconUri)
Sets the URI of the icon representing this route.
This icon will be used in picker UIs if available.
The URI must be one of the following formats:
SCHEME_CONTENT
)SCHEME_ANDROID_RESOURCE
)
SCHEME_FILE
)Parameters | |
---|---|
iconUri |
Uri
|
Returns | |
---|---|
MediaRouteDescriptor.Builder |
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.
Parameters | |
---|---|
id |
String
|
Returns | |
---|---|
MediaRouteDescriptor.Builder |
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.
Parameters | |
---|---|
name |
String
|
Returns | |
---|---|
MediaRouteDescriptor.Builder |
MediaRouteDescriptor.Builder setPlaybackStream (int playbackStream)
Sets the route's playback stream.
Parameters | |
---|---|
playbackStream |
int
|
Returns | |
---|---|
MediaRouteDescriptor.Builder |
MediaRouteDescriptor.Builder setPlaybackType (int playbackType)
Sets the route's playback type.
Parameters | |
---|---|
playbackType |
int :
The playback type of the route:
PLAYBACK_TYPE_LOCAL or
PLAYBACK_TYPE_REMOTE .
|
Returns | |
---|---|
MediaRouteDescriptor.Builder |
MediaRouteDescriptor.Builder setPresentationDisplayId (int presentationDisplayId)
Sets the route's presentation display id, or -1 if none.
Parameters | |
---|---|
presentationDisplayId |
int
|
Returns | |
---|---|
MediaRouteDescriptor.Builder |
MediaRouteDescriptor.Builder setSettingsActivity (IntentSender is)
Sets an intent sender for launching the settings activity for this route.
Parameters | |
---|---|
is |
IntentSender
|
Returns | |
---|---|
MediaRouteDescriptor.Builder |
MediaRouteDescriptor.Builder setVolume (int volume)
Sets the route's current volume, or 0 if unknown.
Parameters | |
---|---|
volume |
int
|
Returns | |
---|---|
MediaRouteDescriptor.Builder |
MediaRouteDescriptor.Builder setVolumeHandling (int volumeHandling)
Sets the route's volume handling.
Parameters | |
---|---|
volumeHandling |
int :
how volume is handled on the route:
PLAYBACK_VOLUME_FIXED or
PLAYBACK_VOLUME_VARIABLE .
|
Returns | |
---|---|
MediaRouteDescriptor.Builder |
MediaRouteDescriptor.Builder setVolumeMax (int volumeMax)
Sets the route's maximum volume, or 0 if unknown.
Parameters | |
---|---|
volumeMax |
int
|
Returns | |
---|---|
MediaRouteDescriptor.Builder |