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

Commit 22cfec3c authored by Paul McLean's avatar Paul McLean
Browse files

Documenting behavior of returning a 0-length array for formats,

channels, rates queries for analog devices.

Bug: 22729461
Change-Id: I3cb1d586f6264e3627cbb0261a3b2c74ca51cf6b
parent 845d14db
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -156,6 +156,8 @@ public final class AudioDeviceInfo {

    /**
     * @return An array of sample rates supported by the audio device.
     *
     * Note: an empty array indicates that the device supports arbitrary rates.
     */
    public @NonNull int[] getSampleRates() {
        return mPort.samplingRates();
@@ -166,6 +168,8 @@ public final class AudioDeviceInfo {
     * {@link AudioFormat#CHANNEL_OUT_7POINT1}) for which this audio device can be configured.
     *
     * @see AudioFormat
     *
     * Note: an empty array indicates that the device supports arbitrary channel masks.
     */
    public @NonNull int[] getChannelMasks() {
        return mPort.channelMasks();
@@ -175,6 +179,8 @@ public final class AudioDeviceInfo {
     * @return An array of channel index masks for which this audio device can be configured.
     *
     * @see AudioFormat
     *
     * Note: an empty array indicates that the device supports arbitrary channel index masks.
     */
    public @NonNull int[] getChannelIndexMasks() {
        return mPort.channelIndexMasks();
@@ -183,6 +189,8 @@ public final class AudioDeviceInfo {
    /**
     * @return An array of channel counts (1, 2, 4, ...) for which this audio device
     * can be configured.
     *
     * Note: an empty array indicates that the device supports arbitrary channel counts.
     */
    public @NonNull int[] getChannelCounts() {
        int[] masks = getChannelMasks();
@@ -205,6 +213,8 @@ public final class AudioDeviceInfo {
     * integer precision to that device.
     *
     * @see AudioFormat
     *
     * Note: an empty array indicates that the device supports arbitrary encodings.
     */
    public @NonNull int[] getEncodings() {
        return AudioFormat.filterPublicFormats(mPort.formats());