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

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

Merge "Speaker channel swapping is conditional to audio mode" into nyc-mr1-dev

parents ed6a3848 f7148705
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -2755,6 +2755,14 @@ int platform_swap_lr_channels(struct audio_device *adev, bool swap_channels)
    struct platform_data *my_data = (struct platform_data *)adev->platform;

    if (my_data->speaker_lr_swap != swap_channels) {

        // do not swap channels in audio modes with concurrent capture and playback
        // as this may break the echo reference
        if ((adev->mode == AUDIO_MODE_IN_COMMUNICATION) || (adev->mode == AUDIO_MODE_IN_CALL)) {
            ALOGV("%s: will not swap due to audio mode %d", __func__, adev->mode);
            return 0;
        }

        my_data->speaker_lr_swap = swap_channels;

        list_for_each(node, &adev->usecase_list) {