Added in API level 21

PlaybackInfo


class PlaybackInfo : Parcelable
kotlin.Any
   ↳ android.media.session.MediaController.PlaybackInfo

Holds information about the current playback and how audio is handled for this session.

Summary

Constants
static Int

The session uses local playback.

static Int

The session uses remote playback.

Inherited constants
Public methods
Int

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

AudioAttributes!

Get the audio attributes for this session.

Int

Get the current volume for this session.

Int

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

Int

Get the type of playback which affects volume handling.

Int

Get the volume control type associated to the session, as indicated by VolumeProvider.getVolumeControl().

String?

Get the routing controller ID for this session, as indicated by VolumeProvider.getVolumeControlId().

String

Returns a string representation of the object.

Unit
writeToParcel(dest: Parcel, flags: Int)

Flatten this object in to a Parcel.

Properties
static Parcelable.Creator<MediaController.PlaybackInfo!>

Constants

PLAYBACK_TYPE_LOCAL

Added in API level 21
static val PLAYBACK_TYPE_LOCAL: Int

The session uses local playback.

Value: 1

PLAYBACK_TYPE_REMOTE

Added in API level 21
static val PLAYBACK_TYPE_REMOTE: Int

The session uses remote playback.

Value: 2

Public methods

describeContents

Added in API level 29
fun describeContents(): Int

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(android.os.Parcel,int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance.
Value is either 0 or

getAudioAttributes

Added in API level 21
fun getAudioAttributes(): AudioAttributes!

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

Return
AudioAttributes! The attributes for this session.

getCurrentVolume

Added in API level 21
fun getCurrentVolume(): Int

Get the current volume for this session.

Return
Int The current volume where this session is playing.

getMaxVolume

Added in API level 21
fun getMaxVolume(): Int

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

Return
Int The maximum allowed volume where this session is playing.

getPlaybackType

Added in API level 21
fun getPlaybackType(): Int

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

Return
Int The type of playback this session is using.

getVolumeControl

Added in API level 21
fun getVolumeControl(): Int

Get the volume control type associated to the session, as indicated by VolumeProvider.getVolumeControl().

getVolumeControlId

Added in API level 30
fun getVolumeControlId(): String?

Get the routing controller ID for this session, as indicated by VolumeProvider.getVolumeControlId(). Returns null if unset, or if getPlaybackType() is PLAYBACK_TYPE_LOCAL.

toString

Added in API level 21
fun toString(): String

Returns a string representation of the object.

Return
String a string representation of the object.

writeToParcel

Added in API level 29
fun writeToParcel(
    dest: Parcel,
    flags: Int
): Unit

Flatten this object in to a Parcel.

Parameters
dest Parcel: The Parcel in which the object should be written.
This value cannot be null.
flags Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.
Value is either 0 or a combination of the following:

Properties

CREATOR

Added in API level 29
static val CREATOR: Parcelable.Creator<MediaController.PlaybackInfo!>