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

Commit 5062ccee authored by samin.ryu's avatar samin.ryu Committed by Iliyan Malchev
Browse files

alsa_sound: change input device for communication



Match to VOIP speaker device pair with voice call.  In voice call using
speakerphone, we want to use BACK_MIC for input.

Bug: 7329372
Change-Id: I9c42719f17e2be6f0b38292dc74ac3ce54767b64
Signed-off-by: default avatarIliyan Malchev <malchev@google.com>
parent 0f5426b3
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -409,6 +409,11 @@ void switchDevice(alsa_handle_t *handle, uint32_t devices, uint32_t mode)
        } else if (devices & AudioSystem::DEVICE_IN_BUILTIN_MIC) {
            if (mode == AudioSystem::MODE_IN_CALL) {
                devices |= AudioSystem::DEVICE_OUT_EARPIECE;
            } else if (mode == AudioSystem::MODE_IN_COMMUNICATION) {
                if (!strncmp(curRxUCMDevice, SND_USE_CASE_DEV_SPEAKER, MAX_LEN(curRxUCMDevice, SND_USE_CASE_DEV_SPEAKER))) {
                    devices &= ~AudioSystem::DEVICE_IN_BUILTIN_MIC;
                    devices |= AudioSystem::DEVICE_IN_BACK_MIC;
                }
            }
        } else if (devices & AudioSystem::DEVICE_OUT_EARPIECE) {
            devices = devices | AudioSystem::DEVICE_IN_BUILTIN_MIC;