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

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 android.media.VolumeProvider#getVolumeControl().

String?

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

String

Unit
writeToParcel(dest: Parcel, flags: Int)

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
Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR

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 android.media.VolumeProvider#getVolumeControl().

getVolumeControlId

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

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

toString

Added in API level 21
fun toString(): String
Return
String a string representation of the object.

writeToParcel

Added in API level 29
fun writeToParcel(
    dest: Parcel,
    flags: Int
): Unit
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 android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES

Properties

CREATOR

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