# 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)

*** ** * ** ***


```
class DeviceInfo.Builder
```

<br />

*** ** * ** ***

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

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/common/DeviceInfo.Builder#Builder(int)(@https://developer.android.com/reference/kotlin/androidx/media3/common/DeviceInfo.PlaybackType playbackType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Creates the builder. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/common/DeviceInfo!` | `https://developer.android.com/reference/kotlin/androidx/media3/common/DeviceInfo.Builder#build()()` Builds the `https://developer.android.com/reference/kotlin/androidx/media3/common/DeviceInfo`. |
| `https://developer.android.com/reference/kotlin/androidx/media3/common/DeviceInfo.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/common/DeviceInfo.Builder#setMaxVolume(int)(maxVolume: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Sets the maximum supported device volume. |
| `https://developer.android.com/reference/kotlin/androidx/media3/common/DeviceInfo.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/common/DeviceInfo.Builder#setMinVolume(int)(minVolume: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Sets the minimum supported device volume. |
| `https://developer.android.com/reference/kotlin/androidx/media3/common/DeviceInfo.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/common/DeviceInfo.Builder#setRoutingControllerId(java.lang.String)(routingControllerId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?)` 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/kotlin/androidx/media3/common/DeviceInfo.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html @https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/common/DeviceInfo.Builder#setRoutingControllerName(java.lang.String)(routingControllerName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?)` 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 |
|---|---|
| `@https://developer.android.com/reference/kotlin/androidx/media3/common/DeviceInfo.PlaybackType playbackType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The `https://developer.android.com/reference/kotlin/androidx/media3/common/DeviceInfo.PlaybackType`. |

## Public functions

### build

```
fun build(): DeviceInfo!
```

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

### setMaxVolume

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

Sets the maximum supported device volume.

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

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/common/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: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The minimum device volume. |

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

### setRoutingControllerId

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

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

| Parameters |
|---|---|
| `routingControllerId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | 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/kotlin/androidx/media3/common/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 `https://developer.android.com/reference/kotlin/androidx/media3/common/DeviceInfo#playbackType()` is `https://developer.android.com/reference/kotlin/androidx/media3/common/DeviceInfo#PLAYBACK_TYPE_LOCAL()`.

| Parameters |
|---|---|
| `routingControllerName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | The display name of the routing controller, or null to leave it unspecified. |

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