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

Commit 39796298 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Audio presentation: Docs & Testability fixes" into pi-dev

parents aa8cbab1 6b239489
Loading
Loading
Loading
Loading
+13 −4
Original line number Original line Diff line number Diff line
@@ -17,6 +17,9 @@
package android.media;
package android.media;


import android.annotation.IntDef;
import android.annotation.IntDef;
import android.annotation.NonNull;

import com.android.internal.annotations.VisibleForTesting;


import java.lang.annotation.Retention;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.RetentionPolicy;
@@ -88,10 +91,14 @@ public final class AudioPresentation {
     */
     */
    public static final int MASTERED_FOR_HEADPHONE          = 4;
    public static final int MASTERED_FOR_HEADPHONE          = 4;


    AudioPresentation(int presentationId,
    /**
     * @hide
     */
    @VisibleForTesting(visibility = VisibleForTesting.Visibility.PACKAGE)
    public AudioPresentation(int presentationId,
                        int programId,
                        int programId,
                        Map<String, String> labels,
                        @NonNull Map<String, String> labels,
                        String language,
                        @NonNull String language,
                        @MasteringIndicationType int masteringIndication,
                        @MasteringIndicationType int masteringIndication,
                        boolean audioDescriptionAvailable,
                        boolean audioDescriptionAvailable,
                        boolean spokenSubtitlesAvailable,
                        boolean spokenSubtitlesAvailable,
@@ -112,6 +119,7 @@ public final class AudioPresentation {
     * decoder. Presentation id is typically sequential, but does not have to be.
     * decoder. Presentation id is typically sequential, but does not have to be.
     * @hide
     * @hide
     */
     */
    @VisibleForTesting
    public int getPresentationId() {
    public int getPresentationId() {
        return mPresentationId;
        return mPresentationId;
    }
    }
@@ -121,13 +129,14 @@ public final class AudioPresentation {
     * Program id can be used to further uniquely identify the presentation to a decoder.
     * Program id can be used to further uniquely identify the presentation to a decoder.
     * @hide
     * @hide
     */
     */
    @VisibleForTesting
    public int getProgramId() {
    public int getProgramId() {
        return mProgramId;
        return mProgramId;
    }
    }


    /**
    /**
     * @return a map of available text labels for this presentation. Each label is indexed by its
     * @return a map of available text labels for this presentation. Each label is indexed by its
     * locale corresponding to the language code as specified by ISO 639-2 [42]. Either ISO 639-2/B
     * locale corresponding to the language code as specified by ISO 639-2. Either ISO 639-2/B
     * or ISO 639-2/T could be used.
     * or ISO 639-2/T could be used.
     */
     */
    public Map<Locale, String> getLabels() {
    public Map<Locale, String> getLabels() {
+3 −2
Original line number Original line Diff line number Diff line
@@ -2012,9 +2012,10 @@ public class AudioTrack extends PlayerBase
     * If the audio presentation is invalid then {@link #ERROR_BAD_VALUE} will be returned.
     * If the audio presentation is invalid then {@link #ERROR_BAD_VALUE} will be returned.
     * If a multi-stream decoder (MSD) is not present, or the format does not support
     * If a multi-stream decoder (MSD) is not present, or the format does not support
     * multiple presentations, then {@link #ERROR_INVALID_OPERATION} will be returned.
     * multiple presentations, then {@link #ERROR_INVALID_OPERATION} will be returned.
     * {@link #ERROR} is returned in case of any other error.
     * @param presentation see {@link AudioPresentation}. In particular, id should be set.
     * @param presentation see {@link AudioPresentation}. In particular, id should be set.
     * @return error code or success, see {@link #SUCCESS}, {@link #ERROR_BAD_VALUE},
     * @return error code or success, see {@link #SUCCESS}, {@link #ERROR},
     *    {@link #ERROR_INVALID_OPERATION}
     *    {@link #ERROR_BAD_VALUE}, {@link #ERROR_INVALID_OPERATION}
     * @throws IllegalArgumentException if the audio presentation is null.
     * @throws IllegalArgumentException if the audio presentation is null.
     * @throws IllegalStateException if track is not initialized.
     * @throws IllegalStateException if track is not initialized.
     */
     */