# DeviceInfo

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)

*** ** * ** ***


```
class DeviceInfo
```

<br />

*** ** * ** ***

Information about the playback device.

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/media3/common/DeviceInfo.Builder` Builder for `https://developer.android.com/reference/kotlin/androidx/media3/common/DeviceInfo`. |
| `@https://developer.android.com/reference/java/lang/annotation/Documented.html @https://developer.android.com/reference/java/lang/annotation/Retention.html(value = https://developer.android.com/reference/java/lang/annotation/RetentionPolicy.html#SOURCE) @https://developer.android.com/reference/java/lang/annotation/Target.html(value = https://developer.android.com/reference/java/lang/annotation/ElementType.html#TYPE_USE) @https://developer.android.com/reference/kotlin/androidx/annotation/IntDef(value = ) annotation https://developer.android.com/reference/kotlin/androidx/media3/common/DeviceInfo.PlaybackType` Types of playback. |

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/common/DeviceInfo#PLAYBACK_TYPE_LOCAL() = 0` Playback happens on the local device (e.g. phone). |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/common/DeviceInfo#PLAYBACK_TYPE_REMOTE() = 1` Playback happens outside of the device (e.g. a cast device). |
| `const https://developer.android.com/reference/kotlin/androidx/media3/common/DeviceInfo!` | `https://developer.android.com/reference/kotlin/androidx/media3/common/DeviceInfo#UNKNOWN()` Unknown DeviceInfo. |

| ### Public constructors |
|---|
| `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi [DeviceInfo](https://developer.android.com/reference/kotlin/androidx/media3/common/DeviceInfo#DeviceInfo(int,int,int))( @https://developer.android.com/reference/kotlin/androidx/media3/common/DeviceInfo.PlaybackType playbackType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, minVolume: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, maxVolume: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` **This function is deprecated.** Use `https://developer.android.com/reference/kotlin/androidx/media3/common/DeviceInfo.Builder` instead. <br /> |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/common/DeviceInfo#equals(java.lang.Object)(obj: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `java-static https://developer.android.com/reference/kotlin/androidx/media3/common/DeviceInfo!` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/common/DeviceInfo#fromBundle(android.os.Bundle)(bundle: https://developer.android.com/reference/android/os/Bundle.html!)` Restores a `DeviceInfo` from a `https://developer.android.com/reference/android/os/Bundle.html`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/common/DeviceInfo#hashCode()()` |
| `https://developer.android.com/reference/android/os/Bundle.html!` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/common/DeviceInfo#toBundle()()` |

| ### Public properties |
|---|---|
| `@https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/common/DeviceInfo#maxVolume()` The maximum volume that the device supports, or `0` if unspecified. |
| `@https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/common/DeviceInfo#minVolume()` The minimum volume that the device supports. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/DeviceInfo.PlaybackType https://developer.android.com/reference/kotlin/androidx/media3/common/DeviceInfo#playbackType()` The type of playback. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/kotlin/androidx/media3/common/DeviceInfo#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 if unset or `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()`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/common/DeviceInfo#routingControllerName()` The display name of the routing controller or remote device (e.g. "Living Room TV"), or null if unset or `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()`. |

## Constants

### PLAYBACK_TYPE_LOCAL

```
const val PLAYBACK_TYPE_LOCAL = 0: Int
```

Playback happens on the local device (e.g. phone).

### PLAYBACK_TYPE_REMOTE

```
const val PLAYBACK_TYPE_REMOTE = 1: Int
```

Playback happens outside of the device (e.g. a cast device).

### UNKNOWN

```
const val UNKNOWN: DeviceInfo!
```

Unknown DeviceInfo.

## Public constructors

### DeviceInfo

```
@UnstableApi
[DeviceInfo](https://developer.android.com/reference/kotlin/androidx/media3/common/DeviceInfo#DeviceInfo(int,int,int))(
    @DeviceInfo.PlaybackType playbackType: Int,
    minVolume: @IntRange(from = 0) Int,
    maxVolume: @IntRange(from = 0) Int
)
```

> [!CAUTION]
> **This function is deprecated.**   
>
> Use `https://developer.android.com/reference/kotlin/androidx/media3/common/DeviceInfo.Builder` instead.

## Public functions

### equals

```
fun equals(obj: Any?): Boolean
```

### fromBundle

```
@UnstableApi
java-static fun fromBundle(bundle: Bundle!): DeviceInfo!
```

Restores a `DeviceInfo` from a `https://developer.android.com/reference/android/os/Bundle.html`.

### hashCode

```
fun hashCode(): Int
```

### toBundle

```
@UnstableApi
fun toBundle(): Bundle!
```

## Public properties

### maxVolume

```
val maxVolume: @IntRange(from = 0) Int
```

The maximum volume that the device supports, or `0` if unspecified.

### minVolume

```
val minVolume: @IntRange(from = 0) Int
```

The minimum volume that the device supports.

### playbackType

```
@DeviceInfo.PlaybackType
val playbackType: Int
```

The type of playback.

### routingControllerId

```
val routingControllerId: String?
```

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 if unset or `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()`.

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

### routingControllerName

```
@UnstableApi
val routingControllerName: String?
```

The display name of the routing controller or remote device (e.g. "Living Room TV"), or null if unset or `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()`.