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

Commit 6b239489 authored by Mikhail Naganov's avatar Mikhail Naganov
Browse files

Audio presentation: Docs & Testability fixes

Fix some minor issues in JavaDocs. Make some methods visible
for tests.

No public API changes.

Bug: 63901775
Test: cts-tradefed run cts -m CtsMediaTestCases
Change-Id: If3e4d0ac0878408cfa552406a011869b9b8c606e
parent 0aa191cc
Loading
Loading
Loading
Loading
+13 −4
Original line number Diff line number Diff line
@@ -17,6 +17,9 @@
package android.media;

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

import com.android.internal.annotations.VisibleForTesting;

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

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

    /**
     * @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.
     */
    public Map<Locale, String> getLabels() {
+3 −2
Original line number 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 a multi-stream decoder (MSD) is not present, or the format does not support
     * 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.
     * @return error code or success, see {@link #SUCCESS}, {@link #ERROR_BAD_VALUE},
     *    {@link #ERROR_INVALID_OPERATION}
     * @return error code or success, see {@link #SUCCESS}, {@link #ERROR},
     *    {@link #ERROR_BAD_VALUE}, {@link #ERROR_INVALID_OPERATION}
     * @throws IllegalArgumentException if the audio presentation is null.
     * @throws IllegalStateException if track is not initialized.
     */