# DeviceInfo.Builder

Artifact: [androidx.media3:media3-common](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/common/DeviceInfo.java+class:androidx.media3.common.DeviceInfo.Builder)

*** ** * ** ***


```
public final class DeviceInfo.Builder
```

<br />

*** ** * ** ***

Builder for `https://developer.android.com/reference/androidx/media3/common/DeviceInfo`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/common/DeviceInfo.Builder#Builder(int)(@https://developer.android.com/reference/androidx/media3/common/DeviceInfo.PlaybackType int playbackType)` Creates the builder. |

| ### Public methods |
|---|---|
| `https://developer.android.com/reference/androidx/media3/common/DeviceInfo` | `https://developer.android.com/reference/androidx/media3/common/DeviceInfo.Builder#build()()` Builds the `https://developer.android.com/reference/androidx/media3/common/DeviceInfo`. |
| `https://developer.android.com/reference/androidx/media3/common/DeviceInfo.Builder` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/androidx/media3/common/DeviceInfo.Builder#setMaxVolume(int)(@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int maxVolume)` Sets the maximum supported device volume. |
| `https://developer.android.com/reference/androidx/media3/common/DeviceInfo.Builder` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/androidx/media3/common/DeviceInfo.Builder#setMinVolume(int)(@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int minVolume)` Sets the minimum supported device volume. |
| `https://developer.android.com/reference/androidx/media3/common/DeviceInfo.Builder` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/androidx/media3/common/DeviceInfo.Builder#setRoutingControllerId(java.lang.String)(@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/String.html routingControllerId)` Sets the `https://developer.android.com/reference/android/media/MediaRouter2.RoutingController.html#getId()` of the associated `https://developer.android.com/reference/android/media/MediaRouter2.RoutingController.html`. |
| `https://developer.android.com/reference/androidx/media3/common/DeviceInfo.Builder` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html @https://developer.android.com/reference/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/androidx/media3/common/DeviceInfo.Builder#setRoutingControllerName(java.lang.String)(@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/String.html routingControllerName)` Sets the display name of the routing controller or remote device (e.g. "Living Room TV"). |

## Public constructors

### Builder

```
public Builder(@DeviceInfo.PlaybackType int playbackType)
```

Creates the builder.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/media3/common/DeviceInfo.PlaybackType int playbackType` | The `https://developer.android.com/reference/androidx/media3/common/DeviceInfo.PlaybackType`. |

## Public methods

### build

```
public DeviceInfo build()
```

Builds the `https://developer.android.com/reference/androidx/media3/common/DeviceInfo`.

### setMaxVolume

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

Sets the maximum supported device volume.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int maxVolume` | The maximum device volume, or `0` to leave the maximum unspecified. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/common/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 |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int minVolume` | The minimum device volume. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/common/DeviceInfo.Builder` | This builder. |

### setRoutingControllerId

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

Sets the `https://developer.android.com/reference/android/media/MediaRouter2.RoutingController.html#getId()` of the associated `https://developer.android.com/reference/android/media/MediaRouter2.RoutingController.html`.

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 `https://developer.android.com/reference/androidx/media3/common/DeviceInfo#playbackType()` is `https://developer.android.com/reference/androidx/media3/common/DeviceInfo#PLAYBACK_TYPE_LOCAL()`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/String.html routingControllerId` | The `https://developer.android.com/reference/android/media/MediaRouter2.RoutingController.html#getId()` of the associated `https://developer.android.com/reference/android/media/MediaRouter2.RoutingController.html`, or null to leave it unspecified. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/common/DeviceInfo.Builder` | This builder. |

### setRoutingControllerName

```
@CanIgnoreReturnValue
@UnstableApi
public DeviceInfo.Builder setRoutingControllerName(@Nullable String routingControllerName)
```

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

The set value must be null if `https://developer.android.com/reference/androidx/media3/common/DeviceInfo#playbackType()` is `https://developer.android.com/reference/androidx/media3/common/DeviceInfo#PLAYBACK_TYPE_LOCAL()`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/String.html routingControllerName` | The display name of the routing controller, or null to leave it unspecified. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/common/DeviceInfo.Builder` | This builder. |