MediaController.PlaybackInfo

Added in 1.0.0
Deprecated in 1.3.0

public final class MediaController.PlaybackInfo implements VersionedParcelable


Holds information about the way volume is handled for this session.

Summary

Constants

static final int

The session uses local playback.

static final int

The session uses remote playback.

Public methods

boolean
@Nullable AudioAttributesCompat

Gets the audio attributes for this session.

int

Gets the type of volume control that can be used.

int

Gets the current volume for this session.

int

Gets the maximum volume that may be set for this session.

int

Gets the type of playback which affects volume handling.

int

Constants

PLAYBACK_TYPE_LOCAL

Added in 1.0.0
Deprecated in 1.3.0
public static final int PLAYBACK_TYPE_LOCAL = 1

The session uses local playback.

PLAYBACK_TYPE_REMOTE

Added in 1.0.0
Deprecated in 1.3.0
public static final int PLAYBACK_TYPE_REMOTE = 2

The session uses remote playback.

Public methods

equals

public boolean equals(@Nullable Object obj)

getAudioAttributes

Added in 1.0.0
Deprecated in 1.3.0
public @Nullable AudioAttributesCompat getAudioAttributes()

Gets the audio attributes for this session. The attributes will affect volume handling for the session. When the volume type is PLAYBACK_TYPE_REMOTE these may be ignored by the remote volume handler.

Returns
@Nullable AudioAttributesCompat

the attributes for this session

getControlType

Added in 1.0.0
Deprecated in 1.3.0
public int getControlType()

Gets the type of volume control that can be used. One of:

Returns
int

the type of volume control that may be used with this session

getCurrentVolume

Added in 1.0.0
Deprecated in 1.3.0
public int getCurrentVolume()

Gets the current volume for this session.

This is only meaningful when the playback type is PLAYBACK_TYPE_REMOTE.

Returns
int

the current volume where this session is playing

getMaxVolume

Added in 1.0.0
Deprecated in 1.3.0
public int getMaxVolume()

Gets the maximum volume that may be set for this session.

This is only meaningful when the playback type is PLAYBACK_TYPE_REMOTE.

Returns
int

the maximum allowed volume where this session is playing

getPlaybackType

Added in 1.0.0
Deprecated in 1.3.0
public int getPlaybackType()

Gets the type of playback which affects volume handling. One of:

Returns
int

the type of playback this session is using

hashCode

public int hashCode()