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

Commit 9fbaf5f7 authored by Brian Lindahl's avatar Brian Lindahl Committed by Gerrit Code Review
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
parents bc05bdbb d5af19e4
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;
    }