Android Dev Summit, October 23-24: two days of technical content, directly from the Android team. Sign-up for livestream updates.

MediaSessionManager

class MediaSessionManager
kotlin.Any
   ↳ androidx.media2.session.MediaSessionManager

Provides support for interacting with media sessions that applications have published in order to express their ongoing media playback state.

Summary

Public methods

static MediaSessionManager
getInstance(@NonNull context: Context)

Gets an instance of MediaSessionManager associated with the context.

MutableSet<SessionToken!>

Gets Set of SessionToken for MediaSessionService regardless of their activeness.

Public methods

getInstance

@NonNull static fun getInstance(@NonNull context: Context): MediaSessionManager

Gets an instance of MediaSessionManager associated with the context.

Return
MediaSessionManager: the MediaSessionManager instance for this context.

getSessionServiceTokens

@NonNull fun getSessionServiceTokens(): MutableSet<SessionToken!>

Gets Set of SessionToken for MediaSessionService regardless of their activeness. This list represents media apps that support background playback.

Return
MutableSet<SessionToken!>: set of tokens