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

Commit 945625ef authored by Vignesh Kulothungan's avatar Vignesh Kulothungan Committed by Andy Hung
Browse files

audio-hal: Update voice 'in_call' flag

When RIL sends CALL_INACTIVE, the corresponding voice session is closed
and call_state is set to INACTIVE whereas the in_call flag is not reset.
This causes any subsequent voice call usecase to be not setup as in_call
flag is still set as true.

Fix by checking resetting the in_call flag if no other voice session
(in 'dual sim dual active' cases) is active.

Bug: 66873748
Test: make
Change-Id: I109b8badf5a76e68ba64d1c81ce507b62e9e9a5a
parent 66a65b64
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -162,6 +162,7 @@ static int update_calls(struct audio_device *adev)
    struct voice_session *session = NULL;
    int fd = 0;
    int ret = 0;
    bool is_voice_sess_active = false;

    ALOGD("%s: enter:", __func__);

@@ -222,6 +223,12 @@ static int update_calls(struct audio_device *adev)
                          __func__, usecase_id);
                } else {
                    session->state.current = session->state.new;

                    // The flag is not reset if another voice session is active as routing/mode is
                    // set globally instead of per session.
                    voice_extn_is_call_state_active(adev, &is_voice_sess_active);
                    if (!is_voice_sess_active)
                        adev->voice.in_call = false;
                }
                break;