# Print output for @column tags ?>
public
static
final
class
RoutingSessionInfo.Builder
extends Object
java.lang.Object | |
↳ | android.media.RoutingSessionInfo.Builder |
Builder class for RoutingSessionInfo
.
Public constructors | |
---|---|
Builder(String id, String clientPackageName)
Constructor for builder to create |
|
Builder(RoutingSessionInfo sessionInfo)
Constructor for builder to create |
Public methods | |
---|---|
RoutingSessionInfo.Builder
|
addDeselectableRoute(String routeId)
Adds a route to the deselectable routes. |
RoutingSessionInfo.Builder
|
addSelectableRoute(String routeId)
Adds a route to the selectable routes. |
RoutingSessionInfo.Builder
|
addSelectedRoute(String routeId)
Adds a route to the selected routes. |
RoutingSessionInfo.Builder
|
addTransferableRoute(String routeId)
Adds a route to the transferable routes. |
RoutingSessionInfo
|
build()
Builds a routing session info. |
RoutingSessionInfo.Builder
|
clearDeselectableRoutes()
Clears the deselectable routes. |
RoutingSessionInfo.Builder
|
clearSelectableRoutes()
Clears the selectable routes. |
RoutingSessionInfo.Builder
|
clearSelectedRoutes()
Clears the selected routes. |
RoutingSessionInfo.Builder
|
clearTransferableRoutes()
Clears the transferable routes. |
RoutingSessionInfo.Builder
|
removeDeselectableRoute(String routeId)
Removes a route from the deselectable routes. |
RoutingSessionInfo.Builder
|
removeSelectableRoute(String routeId)
Removes a route from the selectable routes. |
RoutingSessionInfo.Builder
|
removeSelectedRoute(String routeId)
Removes a route from the selected routes. |
RoutingSessionInfo.Builder
|
removeTransferableRoute(String routeId)
Removes a route from the transferable routes. |
RoutingSessionInfo.Builder
|
setControlHints(Bundle controlHints)
Sets control hints. |
RoutingSessionInfo.Builder
|
setName(CharSequence name)
Sets the user-visible name of the session. |
RoutingSessionInfo.Builder
|
setVolume(int volume)
Sets the session's current volume, or 0 if unknown. |
RoutingSessionInfo.Builder
|
setVolumeHandling(int volumeHandling)
Sets the session's volume handling. |
RoutingSessionInfo.Builder
|
setVolumeMax(int volumeMax)
Sets the session's maximum volume, or 0 if unknown. |
Inherited methods | |
---|---|
public Builder (String id, String clientPackageName)
Constructor for builder to create RoutingSessionInfo
.
In order to ensure ID uniqueness in MediaRouter2
side, the value of
RoutingSessionInfo#getId()
can be different from what was set in
MediaRoute2ProviderService
.
Parameters | |
---|---|
id |
String : ID of the session. Must not be empty.
This value cannot be null . |
clientPackageName |
String : package name of the client app which uses this session.
If is is unknown, then just use an empty string.
This value cannot be null . |
See also:
public Builder (RoutingSessionInfo sessionInfo)
Constructor for builder to create RoutingSessionInfo
with
existing RoutingSessionInfo
instance.
Parameters | |
---|---|
sessionInfo |
RoutingSessionInfo : the existing instance to copy data from.
This value cannot be null . |
public RoutingSessionInfo.Builder addDeselectableRoute (String routeId)
Adds a route to the deselectable routes. The routeId
must not be empty.
Parameters | |
---|---|
routeId |
String : This value cannot be null . |
Returns | |
---|---|
RoutingSessionInfo.Builder |
This value cannot be null . |
public RoutingSessionInfo.Builder addSelectableRoute (String routeId)
Adds a route to the selectable routes. The routeId
must not be empty.
Parameters | |
---|---|
routeId |
String : This value cannot be null . |
Returns | |
---|---|
RoutingSessionInfo.Builder |
This value cannot be null . |
public RoutingSessionInfo.Builder addSelectedRoute (String routeId)
Adds a route to the selected routes. The routeId
must not be empty.
Parameters | |
---|---|
routeId |
String : This value cannot be null . |
Returns | |
---|---|
RoutingSessionInfo.Builder |
This value cannot be null . |
public RoutingSessionInfo.Builder addTransferableRoute (String routeId)
Adds a route to the transferable routes. The routeId
must not be empty.
Parameters | |
---|---|
routeId |
String : This value cannot be null . |
Returns | |
---|---|
RoutingSessionInfo.Builder |
This value cannot be null . |
public RoutingSessionInfo build ()
Builds a routing session info.
Returns | |
---|---|
RoutingSessionInfo |
This value cannot be null . |
Throws | |
---|---|
IllegalArgumentException |
if no selected routes are added. |
public RoutingSessionInfo.Builder clearDeselectableRoutes ()
Clears the deselectable routes.
Returns | |
---|---|
RoutingSessionInfo.Builder |
This value cannot be null . |
public RoutingSessionInfo.Builder clearSelectableRoutes ()
Clears the selectable routes.
Returns | |
---|---|
RoutingSessionInfo.Builder |
This value cannot be null . |
public RoutingSessionInfo.Builder clearSelectedRoutes ()
Clears the selected routes.
Returns | |
---|---|
RoutingSessionInfo.Builder |
This value cannot be null . |
public RoutingSessionInfo.Builder clearTransferableRoutes ()
Clears the transferable routes.
Returns | |
---|---|
RoutingSessionInfo.Builder |
This value cannot be null . |
public RoutingSessionInfo.Builder removeDeselectableRoute (String routeId)
Removes a route from the deselectable routes. The routeId
must not be empty.
Parameters | |
---|---|
routeId |
String : This value cannot be null . |
Returns | |
---|---|
RoutingSessionInfo.Builder |
This value cannot be null . |
public RoutingSessionInfo.Builder removeSelectableRoute (String routeId)
Removes a route from the selectable routes. The routeId
must not be empty.
Parameters | |
---|---|
routeId |
String : This value cannot be null . |
Returns | |
---|---|
RoutingSessionInfo.Builder |
This value cannot be null . |
public RoutingSessionInfo.Builder removeSelectedRoute (String routeId)
Removes a route from the selected routes. The routeId
must not be empty.
Parameters | |
---|---|
routeId |
String : This value cannot be null . |
Returns | |
---|---|
RoutingSessionInfo.Builder |
This value cannot be null . |
public RoutingSessionInfo.Builder removeTransferableRoute (String routeId)
Removes a route from the transferable routes. The routeId
must not be empty.
Parameters | |
---|---|
routeId |
String : This value cannot be null . |
Returns | |
---|---|
RoutingSessionInfo.Builder |
This value cannot be null . |
public RoutingSessionInfo.Builder setControlHints (Bundle controlHints)
Sets control hints.
Parameters | |
---|---|
controlHints |
Bundle : This value may be null . |
Returns | |
---|---|
RoutingSessionInfo.Builder |
This value cannot be null . |
public RoutingSessionInfo.Builder setName (CharSequence name)
Sets the user-visible name of the session.
Parameters | |
---|---|
name |
CharSequence : This value may be null . |
Returns | |
---|---|
RoutingSessionInfo.Builder |
This value cannot be null . |
public RoutingSessionInfo.Builder setVolume (int volume)
Sets the session's current volume, or 0 if unknown.
Parameters | |
---|---|
volume |
int |
Returns | |
---|---|
RoutingSessionInfo.Builder |
This value cannot be null . |
public RoutingSessionInfo.Builder setVolumeHandling (int volumeHandling)
Sets the session's volume handling.
MediaRoute2Info#PLAYBACK_VOLUME_FIXED
or
MediaRoute2Info#PLAYBACK_VOLUME_VARIABLE
.
Parameters | |
---|---|
volumeHandling |
int : Value is MediaRoute2Info.PLAYBACK_VOLUME_FIXED , or MediaRoute2Info.PLAYBACK_VOLUME_VARIABLE |
Returns | |
---|---|
RoutingSessionInfo.Builder |
This value cannot be null . |
public RoutingSessionInfo.Builder setVolumeMax (int volumeMax)
Sets the session's maximum volume, or 0 if unknown.
Parameters | |
---|---|
volumeMax |
int |
Returns | |
---|---|
RoutingSessionInfo.Builder |
This value cannot be null . |