Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f150a421 authored by Brian Lindahl's avatar Brian Lindahl Committed by Automerger Merge Worker
Browse files

Merge "Clarify documentation for why an app might use a PlaybackSession, and...

Merge "Clarify documentation for why an app might use a PlaybackSession, and how to create and use it." into main am: 9fbaf5f7 am: fc99cd5a

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2928590



Change-Id: I4448cb56a3e57383b91d8938b6cb63a6e69f9708
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents ac3cd753 fc99cd5a
Loading
Loading
Loading
Loading
+19 −1
Original line number Diff line number Diff line
@@ -24,7 +24,10 @@ import com.android.internal.util.AnnotationValidations;
import java.util.Objects;

/**
 * An instances of this class represents a session of media playback.
 * An instance of this class represents a session of media playback used to report playback
 * metrics and events.
 *
 * Create a new instance using {@link MediaMetricsManager#createPlaybackSession}.
 */
public final class PlaybackSession implements AutoCloseable {
    private final @NonNull String mId;
@@ -80,6 +83,21 @@ public final class PlaybackSession implements AutoCloseable {
        mManager.reportTrackChangeEvent(mId, event);
    }

    /**
     * A session ID is used to identify a unique playback and to tie together lower-level
     * playback components.
     *
     * Associate this session with a {@link MediaCodec} by passing the ID into
     * {@link MediaFormat} through {@link MediaFormat#LOG_SESSION_ID} when
     * creating the {@link MediaCodec}.
     *
     * Associate this session with an {@link AudioTrack} by calling
     * {@link AudioTrack#setLogSessionId}.
     *
     * Associate this session with {@link MediaDrm} and {@link MediaCrypto} by calling
     * {@link MediaDrm#getPlaybackComponent} and then calling
     * {@link PlaybackComponent#setLogSessionId}.
     */
    public @NonNull LogSessionId getSessionId() {
        return mLogSessionId;
    }