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

Commit a7657196 authored by Eric Laurent's avatar Eric Laurent
Browse files

audio: use consistent in call indication

Use voice_is_in_call() instead of mode == MODE_IN_CALL
as a valid indication that we are in call to apply
a new route via voice extention.

Bug: 17940126.
Change-Id: I672f2420968e7ffe8c21c9994c5996b15b93ea07
parent a4fc9020
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -1338,15 +1338,18 @@ static int out_set_parameters(struct audio_stream *stream, const char *kvpairs)
            if (!out->standby)
                select_devices(adev, out->usecase);

            if ((adev->mode == AUDIO_MODE_IN_CALL) &&
                    output_drives_call(adev, out)) {
            if (output_drives_call(adev, out)) {
                if (!voice_is_in_call(adev)) {
                    if (adev->mode == AUDIO_MODE_IN_CALL) {
                        adev->current_call_output = out;
                if (!voice_is_in_call(adev))
                        ret = voice_start_call(adev);
                else
                    }
                } else {
                    adev->current_call_output = out;
                    voice_update_devices_for_all_voice_usecases(adev);
                }
            }
        }

        pthread_mutex_unlock(&adev->lock);
        pthread_mutex_unlock(&out->lock);