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

Commit 7a2545c8 authored by Shiv Maliyappanahalli's avatar Shiv Maliyappanahalli
Browse files

hal: Fix voice calls starting on speaker unintendedly

If setParameters(vsid, callstate) call is processed before
setparameter(routing), voice calls will be started on speaker.
Fix by not starting voice calls by checking if the primary output
device is speaker.

Change-Id: If3ecb83bbcb02d5da40d66340276263413adabc9
parent 3bb73585
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -281,7 +281,13 @@ static int update_call_states(struct audio_device *adev,
        session->state.new = call_state;
        voice_extn_is_in_call(adev, &is_in_call);
        ALOGD("%s is_in_call:%d mode:%d\n", __func__, is_in_call, adev->mode);
        if (is_in_call || adev->mode == AUDIO_MODE_IN_CALL) {
        /* Dont start voice call before device routing for voice usescases has
         * occured, otherwise voice calls will be started unintendedly on
         * speaker.
         */
        if (is_in_call ||
            (adev->mode == AUDIO_MODE_IN_CALL &&
             adev->primary_output->devices != AUDIO_DEVICE_OUT_SPEAKER)) {
            /* Device routing is not triggered for voice calls on the subsequent
             * subs, Hence update the call states if voice call is already
             * active on other sub.