public final class DeviceInfo


Information about the playback device.

Summary

Nested types

public final class DeviceInfo.Builder

Builder for DeviceInfo.

@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = TYPE_USE)
@IntDef(value = )
public annotation DeviceInfo.PlaybackType

Types of playback.

Constants

static final int

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

static final int

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

static final DeviceInfo

Unknown DeviceInfo.

Public fields

final @IntRange(from = 0) int

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

final @IntRange(from = 0) int

The minimum volume that the device supports.

final int

The type of playback.

final @Nullable String

The routing controller id of the associated MediaRouter2.RoutingController, or null if unset or playbackType is PLAYBACK_TYPE_LOCAL.

Public constructors

@UnstableApi
DeviceInfo(
    @DeviceInfo.PlaybackType int playbackType,
    @IntRange(from = 0) int minVolume,
    @IntRange(from = 0) int maxVolume
)

This method is deprecated.

Use Builder instead.

Public methods

boolean
static DeviceInfo

Restores a DeviceInfo from a Bundle.

int
Bundle

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 routing controller id of the associated MediaRouter2.RoutingController, or null if unset or playbackType is 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.

Public constructors

DeviceInfo

@UnstableApi
public DeviceInfo(
    @DeviceInfo.PlaybackType int playbackType,
    @IntRange(from = 0) int minVolume,
    @IntRange(from = 0) int maxVolume
)

Public methods

equals

public boolean equals(@Nullable Object obj)

fromBundle

@UnstableApi
public static DeviceInfo fromBundle(Bundle bundle)

Restores a DeviceInfo from a Bundle.

hashCode

public int hashCode()

toBundle

@UnstableApi
public Bundle toBundle()