Google is committed to advancing racial equity for Black communities. See how.

MediaController.PlaybackInfo

public static final class MediaController.PlaybackInfo
extends Object implements VersionedParcelable

java.lang.Object
   ↳ androidx.media2.session.MediaController.PlaybackInfo


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

Summary

Constants

int PLAYBACK_TYPE_LOCAL

The session uses local playback.

int PLAYBACK_TYPE_REMOTE

The session uses remote playback.

Public methods

boolean equals(Object obj)
AudioAttributesCompat getAudioAttributes()

Gets the audio attributes for this session.

int getControlType()

Gets the type of volume control that can be used.

int getCurrentVolume()

Gets the current volume for this session.

int getMaxVolume()

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

int getPlaybackType()

Gets the type of playback which affects volume handling.

int hashCode()

Inherited methods

Constants

PLAYBACK_TYPE_LOCAL

public static final int PLAYBACK_TYPE_LOCAL

The session uses local playback.

Constant Value: 1 (0x00000001)

PLAYBACK_TYPE_REMOTE

public static final int PLAYBACK_TYPE_REMOTE

The session uses remote playback.

Constant Value: 2 (0x00000002)

Public methods

equals

public boolean equals (Object obj)

Parameters
obj Object

Returns
boolean

getAudioAttributes

public 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
AudioAttributesCompat the attributes for this session

getControlType

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

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

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

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

Returns
int