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

Commit 4920d385 authored by Eric Laurent's avatar Eric Laurent Committed by Android (Google) Code Review
Browse files

Merge "audio: fix mic mute for SIP calls" into lmp-dev

parents 6402646d 7b2b5ab2
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1831,8 +1831,9 @@ static ssize_t in_read(struct audio_stream_in *stream, void *buffer,
    /*
     * Instead of writing zeroes here, we could trust the hardware
     * to always provide zeroes when muted.
     * No need to acquire adev->lock to read mic_muted here as we don't change its state.
     */
    if (ret == 0 && voice_get_mic_mute(adev) && !voice_is_in_call(adev))
    if (ret == 0 && adev->mic_muted && in->usecase != USECASE_AUDIO_RECORD_AFE_PROXY)
        memset(buffer, 0, bytes);

exit:
@@ -2302,6 +2303,7 @@ static int adev_set_mic_mute(struct audio_hw_device *dev, bool state)
    ALOGD("%s: state %d\n", __func__, state);
    pthread_mutex_lock(&adev->lock);
    ret = voice_set_mic_mute(adev, state);
    adev->mic_muted = state;
    pthread_mutex_unlock(&adev->lock);

    return ret;
+1 −0
Original line number Diff line number Diff line
@@ -211,6 +211,7 @@ struct audio_device {
    struct voice voice;
    unsigned int cur_hdmi_channels;
    bool bt_wb_speech_enabled;
    bool mic_muted;

    int snd_card;
    void *platform;