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

*** ** * ** ***


```
public final class DeviceInfo
```

<br />

*** ** * ** ***

Information about the playback device.

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/media3/common/DeviceInfo.Builder` Builder for `https://developer.android.com/reference/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/androidx/annotation/IntDef(value = ) public annotation https://developer.android.com/reference/androidx/media3/common/DeviceInfo.PlaybackType` Types of playback. |

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/DeviceInfo#PLAYBACK_TYPE_LOCAL() = 0` Playback happens on the local device (e.g. phone). |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/DeviceInfo#PLAYBACK_TYPE_REMOTE() = 1` Playback happens outside of the device (e.g. a cast device). |
| `static final https://developer.android.com/reference/androidx/media3/common/DeviceInfo` | `https://developer.android.com/reference/androidx/media3/common/DeviceInfo#UNKNOWN()` Unknown DeviceInfo. |

| ### Public fields |
|---|---|
| `final @https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int` | `https://developer.android.com/reference/androidx/media3/common/DeviceInfo#maxVolume()` The maximum volume that the device supports, or `0` if unspecified. |
| `final @https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int` | `https://developer.android.com/reference/androidx/media3/common/DeviceInfo#minVolume()` The minimum volume that the device supports. |
| `final int` | `@https://developer.android.com/reference/androidx/media3/common/DeviceInfo.PlaybackType https://developer.android.com/reference/androidx/media3/common/DeviceInfo#playbackType()` The type of playback. |
| `final @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/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/androidx/media3/common/DeviceInfo#playbackType()` is `https://developer.android.com/reference/androidx/media3/common/DeviceInfo#PLAYBACK_TYPE_LOCAL()`. |
| `final @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/String.html` | `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/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/androidx/media3/common/DeviceInfo#playbackType()` is `https://developer.android.com/reference/androidx/media3/common/DeviceInfo#PLAYBACK_TYPE_LOCAL()`. |

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

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/media3/common/DeviceInfo#equals(java.lang.Object)(@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/Object.html obj)` |
| `static https://developer.android.com/reference/androidx/media3/common/DeviceInfo` | `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/androidx/media3/common/DeviceInfo#fromBundle(android.os.Bundle)(https://developer.android.com/reference/android/os/Bundle.html bundle)` Restores a `DeviceInfo` from a `https://developer.android.com/reference/android/os/Bundle.html`. |
| `int` | `https://developer.android.com/reference/androidx/media3/common/DeviceInfo#hashCode()()` |
| `https://developer.android.com/reference/android/os/Bundle.html` | `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/androidx/media3/common/DeviceInfo#toBundle()()` |

## Constants

### PLAYBACK_TYPE_LOCAL

```
public static final int PLAYBACK_TYPE_LOCAL = 0
```

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

### PLAYBACK_TYPE_REMOTE

```
public static final int PLAYBACK_TYPE_REMOTE = 1
```

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

### UNKNOWN

```
public static final DeviceInfo UNKNOWN
```

Unknown DeviceInfo.

## Public fields

### maxVolume

```
public final @IntRange(from = 0) int maxVolume
```

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

### minVolume

```
public final @IntRange(from = 0) int minVolume
```

The minimum volume that the device supports.

### playbackType

```
@DeviceInfo.PlaybackType
public final int playbackType
```

The type of playback.

### routingControllerId

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

## Public constructors

### DeviceInfo

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

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

## Public methods

### equals

```
public boolean equals(@Nullable Object obj)
```

### fromBundle

```
@UnstableApi
public static DeviceInfo fromBundle(Bundle bundle)
```

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

### hashCode

```
public int hashCode()
```

### toBundle

```
@UnstableApi
public Bundle toBundle()
```