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

Commit 285e082c authored by Jean-Michel Trivi's avatar Jean-Michel Trivi Committed by Android (Google) Code Review
Browse files

Merge "Add @IntDef to getSpeakerLayoutChannelMask and clarify comment" into main

parents 48d2f0d3 eb57a51e
Loading
Loading
Loading
Loading
+39 −1
Original line number Diff line number Diff line
@@ -548,8 +548,45 @@ public final class AudioDeviceInfo {
        return counts;
    }

    /** @hide */
    @IntDef(flag = true, prefix = "AudioFormat.CHANNEL_OUT_", value = {
            AudioFormat.CHANNEL_INVALID,
            AudioFormat.CHANNEL_OUT_DEFAULT,
            AudioFormat.CHANNEL_OUT_FRONT_LEFT,
            AudioFormat.CHANNEL_OUT_FRONT_RIGHT,
            AudioFormat.CHANNEL_OUT_FRONT_CENTER,
            AudioFormat.CHANNEL_OUT_LOW_FREQUENCY,
            AudioFormat.CHANNEL_OUT_BACK_LEFT,
            AudioFormat.CHANNEL_OUT_BACK_RIGHT,
            AudioFormat.CHANNEL_OUT_FRONT_LEFT_OF_CENTER,
            AudioFormat.CHANNEL_OUT_FRONT_RIGHT_OF_CENTER,
            AudioFormat.CHANNEL_OUT_BACK_CENTER,
            AudioFormat.CHANNEL_OUT_SIDE_LEFT,
            AudioFormat.CHANNEL_OUT_SIDE_RIGHT,
            AudioFormat.CHANNEL_OUT_TOP_CENTER,
            AudioFormat.CHANNEL_OUT_TOP_FRONT_LEFT,
            AudioFormat.CHANNEL_OUT_TOP_FRONT_CENTER,
            AudioFormat.CHANNEL_OUT_TOP_FRONT_RIGHT,
            AudioFormat.CHANNEL_OUT_TOP_BACK_LEFT,
            AudioFormat.CHANNEL_OUT_TOP_BACK_CENTER,
            AudioFormat.CHANNEL_OUT_TOP_BACK_RIGHT,
            AudioFormat.CHANNEL_OUT_TOP_SIDE_LEFT,
            AudioFormat.CHANNEL_OUT_TOP_SIDE_RIGHT,
            AudioFormat.CHANNEL_OUT_BOTTOM_FRONT_LEFT,
            AudioFormat.CHANNEL_OUT_BOTTOM_FRONT_CENTER,
            AudioFormat.CHANNEL_OUT_BOTTOM_FRONT_RIGHT,
            AudioFormat.CHANNEL_OUT_LOW_FREQUENCY_2,
            AudioFormat.CHANNEL_OUT_FRONT_WIDE_LEFT,
            AudioFormat.CHANNEL_OUT_FRONT_WIDE_RIGHT}
    )
    @Retention(RetentionPolicy.SOURCE)
    @FlaggedApi(FLAG_SPEAKER_LAYOUT_API)
    public @interface SpeakerLayoutChannelMask {}

    /**
     * @return A ChannelMask representing the physical output speaker layout of the device.
     * @return A ChannelMask representing the speaker layout of a TYPE_BUILTIN_SPEAKER device.
     *
     * Valid only for speakers built-in to the device.
     *
     * The layout channel mask only indicates which speaker channels are present, the
     * physical layout of the speakers should be informed by a standard for multi-channel
@@ -557,6 +594,7 @@ public final class AudioDeviceInfo {
     * @see AudioFormat
     */
    @FlaggedApi(FLAG_SPEAKER_LAYOUT_API)
    @SpeakerLayoutChannelMask
    public int getSpeakerLayoutChannelMask() {
        return mPort.speakerLayoutChannelMask();
    }