MediaSession

Class of android.media.session · MediaSession.java · Android's reference

public final class MediaSession

A media session. Its controllers are in the process: a controller made from the session's token reads the session's state and calls its callback on the callback's handler. No system UI or other app controls it.

Nested types

Fields

public static final int FLAG_HANDLES_MEDIA_BUTTONS = 1 source
public static final int FLAG_HANDLES_TRANSPORT_CONTROLS = 2 source

Constructors

public MediaSession(Context context, String tag) source
public MediaSession(Context context, String tag, Bundle sessionInfo) source

Methods

public void setCallback(Callback callback) source
public void setCallback(Callback callback, Handler handler) source
public void setSessionActivity(PendingIntent pi) source
public void setMediaButtonReceiver(PendingIntent mbr) empty body source
public void setMediaButtonBroadcastReceiver(ComponentName broadcastReceiver) empty body source
public void setFlags(int flags) source
public void setPlaybackToLocal(AudioAttributes attributes) source
public void setPlaybackToRemote(VolumeProvider volumeProvider) source
public void setActive(boolean active) source
public boolean isActive() source
public void sendSessionEvent(String event, Bundle extras) source
public void release() source
public Token getSessionToken() source
public MediaController getController() source
public void setPlaybackState(PlaybackState state) source
public void setMetadata(MediaMetadata metadata) source
public void setQueue(List<QueueItem> queue) source
public void setQueueTitle(CharSequence title) source
public void setRatingType(int type) source
public void setExtras(Bundle extras) source
public final MediaSessionManager.RemoteUserInfo getCurrentControllerInfo() source

Every controller is the app's own.


Made from ScarletNX's Sail at 166ad3910f80. The framework is ScarletNX's (GPL-3.0-or-later); the parts that follow the Android Open Source Project's sources (Apache-2.0) say so in their files.