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

Commit 30852637 authored by Ray Essick's avatar Ray Essick
Browse files

Add @IntRange() to audio encoding capability apis

add @IntRange() to android.media.MediaCodecInfo.AudioCapabilities
methods getMinInputChannelCount() and getMaxInputChannelCount()

Bug: 180962503
Test: build
Change-Id: Ia408eb4e8bf4f07d80a52bd998e9135f34adf981
parent d549483e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -21300,8 +21300,8 @@ package android.media {
  public static final class MediaCodecInfo.AudioCapabilities {
    method public android.util.Range<java.lang.Integer> getBitrateRange();
    method @NonNull public android.util.Range<java.lang.Integer>[] getInputChannelCountRanges();
    method public int getMaxInputChannelCount();
    method public int getMinInputChannelCount();
    method @IntRange(from=1, to=255) public int getMaxInputChannelCount();
    method @IntRange(from=1, to=255) public int getMinInputChannelCount();
    method public android.util.Range<java.lang.Integer>[] getSupportedSampleRateRanges();
    method public int[] getSupportedSampleRates();
    method public boolean isSampleRateSupported(int);
+3 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package android.media;
import static android.media.Utils.intersectSortedDistinctRanges;
import static android.media.Utils.sortDistinctRanges;

import android.annotation.IntRange;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SuppressLint;
@@ -1133,6 +1134,7 @@ public final class MediaCodecInfo {
         * in the ranges returned by {@link #getInputChannelCountRanges}
         *
         */
        @IntRange(from = 1, to = 255)
        public int getMaxInputChannelCount() {
            int overall_max = 0;
            for (int i = mInputChannelRanges.length - 1; i >= 0; i--) {
@@ -1151,6 +1153,7 @@ public final class MediaCodecInfo {
         * This returns the lowest channel count in the ranges returned by
         * {@link #getInputChannelCountRanges}.
         */
        @IntRange(from = 1, to = 255)
        public int getMinInputChannelCount() {
            int overall_min = MAX_INPUT_CHANNEL_COUNT;
            for (int i = mInputChannelRanges.length - 1; i >= 0; i--) {