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

Commit ae8f14f2 authored by Eric Laurent's avatar Eric Laurent Committed by Android Git Automerger
Browse files

am d5ec806a: am 991bd713: Merge "unhide AudioFormat getters" into lmp-dev

* commit 'd5ec806a6dd0ba6b0f242ac9ebb5425de4a27bdf':
  unhide AudioFormat getters
parents dbec29c7 4309f95f
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -14108,6 +14108,9 @@ package android.media {
  }
  public class AudioFormat {
    method public int getChannelMask();
    method public int getEncoding();
    method public int getSampleRate();
    field public static final deprecated int CHANNEL_CONFIGURATION_DEFAULT = 1; // 0x1
    field public static final deprecated int CHANNEL_CONFIGURATION_INVALID = 0; // 0x0
    field public static final deprecated int CHANNEL_CONFIGURATION_MONO = 2; // 0x2
+24 −3
Original line number Diff line number Diff line
@@ -263,18 +263,39 @@ public class AudioFormat {
    private int mChannelMask;
    private int mPropertySetMask;

    /** @hide */
    /**
     * Return the encoding.
     * @return one of the values that can be set in {@link Builder#setEncoding(int)} or
     * {@link AudioFormat#ENCODING_INVALID} if not set.
     */
    public int getEncoding() {
        if ((mPropertySetMask & AUDIO_FORMAT_HAS_PROPERTY_ENCODING) == 0) {
            return ENCODING_INVALID;
        }
        return mEncoding;
    }

    /** @hide */
    /**
     * Return the sample rate.
     * @return one of the values that can be set in {@link Builder#setSampleRate(int)} or
     * 0 if not set.
     */
    public int getSampleRate() {
        if ((mPropertySetMask & AUDIO_FORMAT_HAS_PROPERTY_SAMPLE_RATE) == 0) {
            return 0;
        }
        return mSampleRate;
    }

    /** @hide */
    /**
     * Return the channel mask.
     * @return one of the values that can be set in {@link Builder#setChannelMask(int)} or
     * {@link AudioFormat#CHANNEL_INVALID} if not set.
     */
    public int getChannelMask() {
        if ((mPropertySetMask & AUDIO_FORMAT_HAS_PROPERTY_CHANNEL_MASK) == 0) {
            return CHANNEL_INVALID;
        }
        return mChannelMask;
    }