# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Ctors | Methods | Inherited Methods

# RoutingSessionInfo.Builder

`public static final class RoutingSessionInfo.Builder`
`extends Object` ``

java.lang.Object
↳ | android.media.RoutingSessionInfo.Builder

Builder class for `RoutingSessionInfo`.

## Summary

### Public constructors
`Builder(String id, String clientPackageName)` Constructor for builder to create `RoutingSessionInfo`.
`Builder(RoutingSessionInfo sessionInfo)` Constructor for builder to create `RoutingSessionInfo` with existing `RoutingSessionInfo` instance.

### 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
From class `java.lang.Object`
`Object` | `clone()` Creates and returns a copy of this object.
`boolean` | `equals(Object obj)` Indicates whether some other object is "equal to" this one.
`void` | `finalize()` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
`final Class<?>` | `getClass()` Returns the runtime class of this `Object`.
`int` | `hashCode()` Returns a hash code value for the object.
`final void` | `notify()` Wakes up a single thread that is waiting on this object's monitor.
`final void` | `notifyAll()` Wakes up all threads that are waiting on this object's monitor.
`String` | `toString()` Returns a string representation of the object.
`final void` | `wait(long timeout, int nanos)` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
`final void` | `wait(long timeout)` Causes the current thread to wait until either another thread invokes the `notify()` method or the `notifyAll()` method for this object, or a specified amount of time has elapsed.
`final void` | `wait()` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object.

## Public constructors

### Builder

    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:

- `MediaRoute2Info.getId()`

### Builder

    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 methods

### addDeselectableRoute

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

### addSelectableRoute

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

### addSelectedRoute

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

### addTransferableRoute

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

### build

    public RoutingSessionInfo build ()

Builds a routing session info.

Returns
`RoutingSessionInfo` | This value cannot be `null`.

Throws
`IllegalArgumentException` | if no selected routes are added.

### clearDeselectableRoutes

    public RoutingSessionInfo.Builder clearDeselectableRoutes ()

Clears the deselectable routes.

Returns
`RoutingSessionInfo.Builder` | This value cannot be `null`.

### clearSelectableRoutes

    public RoutingSessionInfo.Builder clearSelectableRoutes ()

Clears the selectable routes.

Returns
`RoutingSessionInfo.Builder` | This value cannot be `null`.

### clearSelectedRoutes

    public RoutingSessionInfo.Builder clearSelectedRoutes ()

Clears the selected routes.

Returns
`RoutingSessionInfo.Builder` | This value cannot be `null`.

### clearTransferableRoutes

    public RoutingSessionInfo.Builder clearTransferableRoutes ()

Clears the transferable routes.

Returns
`RoutingSessionInfo.Builder` | This value cannot be `null`.

### removeDeselectableRoute

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

### removeSelectableRoute

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

### removeSelectedRoute

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

### removeTransferableRoute

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

### setControlHints

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

### setName

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

### setVolume

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

### setVolumeHandling

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

### setVolumeMax

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

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*