DeviceInfo.Builder


class DeviceInfo.Builder


Builder for DeviceInfo.

Summary

Public constructors

Creates the builder.

Public functions

DeviceInfo!

Builds the DeviceInfo.

DeviceInfo.Builder!
@CanIgnoreReturnValue
setMaxVolume(maxVolume: @IntRange(from = 0) Int)

Sets the maximum supported device volume.

DeviceInfo.Builder!
@CanIgnoreReturnValue
setMinVolume(minVolume: @IntRange(from = 0) Int)

Sets the minimum supported device volume.

DeviceInfo.Builder!

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

DeviceInfo.Builder!

Sets the display name of the routing controller or remote device (e.g. "Living Room TV").

Public constructors

Builder

Builder(@DeviceInfo.PlaybackType playbackType: Int)

Creates the builder.

Parameters
@DeviceInfo.PlaybackType playbackType: Int

The PlaybackType.

Public functions

build

fun build(): DeviceInfo!

Builds the DeviceInfo.

setMaxVolume

@CanIgnoreReturnValue
fun setMaxVolume(maxVolume: @IntRange(from = 0) Int): DeviceInfo.Builder!

Sets the maximum supported device volume.

Parameters
maxVolume: @IntRange(from = 0) Int

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

Returns
DeviceInfo.Builder!

This builder.

setMinVolume

@CanIgnoreReturnValue
fun setMinVolume(minVolume: @IntRange(from = 0) Int): DeviceInfo.Builder!

Sets the minimum supported device volume.

The minimum will be set to 0 if not specified.

Parameters
minVolume: @IntRange(from = 0) Int

The minimum device volume.

Returns
DeviceInfo.Builder!

This builder.

setRoutingControllerId

@CanIgnoreReturnValue
fun setRoutingControllerId(routingControllerId: String?): DeviceInfo.Builder!

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
routingControllerId: String?

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

Returns
DeviceInfo.Builder!

This builder.

setRoutingControllerName

@CanIgnoreReturnValue
@UnstableApi
fun setRoutingControllerName(routingControllerName: String?): DeviceInfo.Builder!

Sets the display name of the routing controller or remote device (e.g. "Living Room TV").

The set value must be null if playbackType is PLAYBACK_TYPE_LOCAL.

Parameters
routingControllerName: String?

The display name of the routing controller, or null to leave it unspecified.

Returns
DeviceInfo.Builder!

This builder.