DeviceInfo.Builder


public final class DeviceInfo.Builder


Builder for DeviceInfo.

Summary

Public constructors

Builder(@DeviceInfo.PlaybackType int playbackType)

Creates the builder.

Public methods

DeviceInfo

Builds the DeviceInfo.

DeviceInfo.Builder
@CanIgnoreReturnValue
setMaxVolume(@IntRange(from = 0) int maxVolume)

Sets the maximum supported device volume.

DeviceInfo.Builder
@CanIgnoreReturnValue
setMinVolume(@IntRange(from = 0) int minVolume)

Sets the minimum supported device volume.

DeviceInfo.Builder

Sets the routing controller id of the associated MediaRouter2.RoutingController.

Public constructors

Builder

public Builder(@DeviceInfo.PlaybackType int playbackType)

Creates the builder.

Parameters
@DeviceInfo.PlaybackType int playbackType

The PlaybackType.

Public methods

build

public DeviceInfo build()

Builds the DeviceInfo.

setMaxVolume

@CanIgnoreReturnValue
public DeviceInfo.Builder setMaxVolume(@IntRange(from = 0) int maxVolume)

Sets the maximum supported device volume.

Parameters
@IntRange(from = 0) int maxVolume

The maximum device volume, or 0 to leave the maximum unspecified.

Returns
DeviceInfo.Builder

This builder.

setMinVolume

@CanIgnoreReturnValue
public DeviceInfo.Builder setMinVolume(@IntRange(from = 0) int minVolume)

Sets the minimum supported device volume.

The minimum will be set to 0 if not specified.

Parameters
@IntRange(from = 0) int minVolume

The minimum device volume.

Returns
DeviceInfo.Builder

This builder.

setRoutingControllerId

@CanIgnoreReturnValue
public DeviceInfo.Builder setRoutingControllerId(@Nullable String routingControllerId)

Sets the routing controller id of the associated MediaRouter2.RoutingController.

This id allows mapping this device information to a routing controller, which provides information about the media route and allows controlling its volume.

The set value must be null if playbackType is PLAYBACK_TYPE_LOCAL.

Parameters
@Nullable String routingControllerId

The routing controller id of the associated MediaRouter2.RoutingController, or null to leave it unspecified.

Returns
DeviceInfo.Builder

This builder.