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

Commit f8de683e authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "hal: Add SSR/PDR handling in voice call"

parents f4b4f16d 59ebed40
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -3987,9 +3987,17 @@ static void out_snd_mon_cb(void * stream, struct str_parms * parms)
          use_case_table[out->usecase],
          status == CARD_STATUS_OFFLINE ? "offline" : "online");

    if (status == CARD_STATUS_OFFLINE)
    if (status == CARD_STATUS_OFFLINE) {
        out_on_error(stream);

        if (voice_is_call_state_active(adev) &&
            out == adev->primary_output) {
            ALOGD("%s: SSR/PDR occurred, end all calls\n", __func__);
            pthread_mutex_lock(&adev->lock);
            voice_stop_call(adev);
            adev->mode = AUDIO_MODE_NORMAL;
            pthread_mutex_unlock(&adev->lock);
        }
    }
    return;
}