MediaControllerCompat.PlaybackInfo


public final class MediaControllerCompat.PlaybackInfo


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

@NonNull AudioAttributesCompat

Get the audio attributes for this session.

int

This method is deprecated.

Use getAudioAttributes instead.

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 volume handling, either local or remote.

int

Gets the type of volume control that can be used.

Constants

PLAYBACK_TYPE_LOCAL

Added in 1.1.0
public static final int PLAYBACK_TYPE_LOCAL = 1

The session uses local playback.

PLAYBACK_TYPE_REMOTE

Added in 1.1.0
public static final int PLAYBACK_TYPE_REMOTE = 2

The session uses remote playback.

Public methods

getAudioAttributes

Added in 1.1.0
public @NonNull AudioAttributesCompat getAudioAttributes()

Get 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
@NonNull AudioAttributesCompat

The attributes for this session.

getAudioStream

Added in 1.1.0
Deprecated in 1.1.0
public int getAudioStream()

Gets the stream this is currently controlling volume on. When the volume type is PLAYBACK_TYPE_REMOTE this value does not have meaning and should be ignored.

Returns
int

The stream this session is playing on.

getCurrentVolume

Added in 1.1.0
public int getCurrentVolume()

Gets the current volume for this session.

Returns
int

The current volume where this session is playing.

getMaxVolume

Added in 1.1.0
public int getMaxVolume()

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

Returns
int

The maximum allowed volume where this session is playing.

getPlaybackType

Added in 1.1.0
public int getPlaybackType()

Gets the type of volume handling, either local or remote. One of:

Returns
int

The type of volume handling this session is using.

getVolumeControl

Added in 1.1.0
public int getVolumeControl()

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.