public final class

DeviceInfo.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.media3.common.DeviceInfo.Builder

Overview

Builder for DeviceInfo.

Summary

Constructors
publicBuilder(int playbackType)

Creates the builder.

Methods
public DeviceInfobuild()

Builds the DeviceInfo.

public DeviceInfo.BuildersetMaxVolume(int maxVolume)

Sets the maximum supported device volume.

public DeviceInfo.BuildersetMinVolume(int minVolume)

Sets the minimum supported device volume.

public DeviceInfo.BuildersetRoutingControllerId(java.lang.String routingControllerId)

Sets the of the associated .

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder(int playbackType)

Creates the builder.

Parameters:

playbackType: The DeviceInfo.PlaybackType.

Methods

public DeviceInfo.Builder setMinVolume(int minVolume)

Sets the minimum supported device volume.

The minimum will be set to 0 if not specified.

Parameters:

minVolume: The minimum device volume.

Returns:

This builder.

public DeviceInfo.Builder setMaxVolume(int maxVolume)

Sets the maximum supported device volume.

Parameters:

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

Returns:

This builder.

public DeviceInfo.Builder setRoutingControllerId(java.lang.String routingControllerId)

Sets the of the associated .

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 DeviceInfo.playbackType is DeviceInfo.PLAYBACK_TYPE_LOCAL.

Parameters:

routingControllerId: The of the associated , or null to leave it unspecified.

Returns:

This builder.

public DeviceInfo build()

Builds the DeviceInfo.