Loading hal/audio_hw.c +1 −1 Original line number Diff line number Diff line Loading @@ -2054,7 +2054,7 @@ 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. */ if (ret == 0 && voice_get_mic_mute(adev) && !voice_is_in_call(adev)) if (ret == 0 && voice_get_mic_mute(adev) && !voice_is_in_call_rec_stream(in)) memset(buffer, 0, bytes); exit: Loading hal/voice.c +13 −0 Original line number Diff line number Diff line Loading @@ -197,6 +197,19 @@ bool voice_is_in_call(struct audio_device *adev) return in_call; } bool voice_is_in_call_rec_stream(struct stream_in *in) { bool in_call_rec = false; int ret = 0; ret = voice_extn_is_in_call_rec_stream(in, &in_call_rec); if (ret == -ENOSYS) { in_call_rec = false; } return in_call_rec; } uint32_t voice_get_active_session_id(struct audio_device *adev) { int ret = 0; Loading hal/voice.h +1 −0 Original line number Diff line number Diff line Loading @@ -77,6 +77,7 @@ void voice_get_parameters(struct audio_device *adev, struct str_parms *query, struct str_parms *reply); void voice_init(struct audio_device *adev); bool voice_is_in_call(struct audio_device *adev); bool voice_is_in_call_rec_stream(struct stream_in *in); int voice_set_mic_mute(struct audio_device *dev, bool state); bool voice_get_mic_mute(struct audio_device *dev); int voice_set_volume(struct audio_device *adev, float volume); Loading hal/voice_extn/voice_extn.c +13 −0 Original line number Diff line number Diff line Loading @@ -356,6 +356,19 @@ int voice_extn_is_in_call(struct audio_device *adev, bool *in_call) return 0; } int voice_extn_is_in_call_rec_stream(struct stream_in *in, bool *in_call_rec) { *in_call_rec = false; if(in->source == AUDIO_SOURCE_VOICE_DOWNLINK || in->source == AUDIO_SOURCE_VOICE_UPLINK || in->source == AUDIO_SOURCE_VOICE_CALL) { *in_call_rec = true; } return 0; } void voice_extn_init(struct audio_device *adev) { adev->voice.session[VOICE_SESS_IDX].vsid = VOICE_VSID; Loading hal/voice_extn/voice_extn.h +6 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ void voice_extn_get_parameters(const struct audio_device *adev, struct str_parms *query, struct str_parms *reply); int voice_extn_is_in_call(struct audio_device *adev, bool *in_call); int voice_extn_is_in_call_rec_stream(struct stream_in *in, bool *in_call_rec); int voice_extn_get_active_session_id(struct audio_device *adev, uint32_t *session_id); void voice_extn_in_get_parameters(struct stream_in *in, Loading Loading @@ -80,6 +81,11 @@ static int voice_extn_is_in_call(struct audio_device *adev, bool *in_call) return -ENOSYS; } static int voice_extn_is_in_call_rec_stream(struct stream_in *in, bool *in_call_rec) { return -ENOSYS; } static int voice_extn_get_active_session_id(struct audio_device *adev, uint32_t *session_id) { Loading Loading
hal/audio_hw.c +1 −1 Original line number Diff line number Diff line Loading @@ -2054,7 +2054,7 @@ 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. */ if (ret == 0 && voice_get_mic_mute(adev) && !voice_is_in_call(adev)) if (ret == 0 && voice_get_mic_mute(adev) && !voice_is_in_call_rec_stream(in)) memset(buffer, 0, bytes); exit: Loading
hal/voice.c +13 −0 Original line number Diff line number Diff line Loading @@ -197,6 +197,19 @@ bool voice_is_in_call(struct audio_device *adev) return in_call; } bool voice_is_in_call_rec_stream(struct stream_in *in) { bool in_call_rec = false; int ret = 0; ret = voice_extn_is_in_call_rec_stream(in, &in_call_rec); if (ret == -ENOSYS) { in_call_rec = false; } return in_call_rec; } uint32_t voice_get_active_session_id(struct audio_device *adev) { int ret = 0; Loading
hal/voice.h +1 −0 Original line number Diff line number Diff line Loading @@ -77,6 +77,7 @@ void voice_get_parameters(struct audio_device *adev, struct str_parms *query, struct str_parms *reply); void voice_init(struct audio_device *adev); bool voice_is_in_call(struct audio_device *adev); bool voice_is_in_call_rec_stream(struct stream_in *in); int voice_set_mic_mute(struct audio_device *dev, bool state); bool voice_get_mic_mute(struct audio_device *dev); int voice_set_volume(struct audio_device *adev, float volume); Loading
hal/voice_extn/voice_extn.c +13 −0 Original line number Diff line number Diff line Loading @@ -356,6 +356,19 @@ int voice_extn_is_in_call(struct audio_device *adev, bool *in_call) return 0; } int voice_extn_is_in_call_rec_stream(struct stream_in *in, bool *in_call_rec) { *in_call_rec = false; if(in->source == AUDIO_SOURCE_VOICE_DOWNLINK || in->source == AUDIO_SOURCE_VOICE_UPLINK || in->source == AUDIO_SOURCE_VOICE_CALL) { *in_call_rec = true; } return 0; } void voice_extn_init(struct audio_device *adev) { adev->voice.session[VOICE_SESS_IDX].vsid = VOICE_VSID; Loading
hal/voice_extn/voice_extn.h +6 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ void voice_extn_get_parameters(const struct audio_device *adev, struct str_parms *query, struct str_parms *reply); int voice_extn_is_in_call(struct audio_device *adev, bool *in_call); int voice_extn_is_in_call_rec_stream(struct stream_in *in, bool *in_call_rec); int voice_extn_get_active_session_id(struct audio_device *adev, uint32_t *session_id); void voice_extn_in_get_parameters(struct stream_in *in, Loading Loading @@ -80,6 +81,11 @@ static int voice_extn_is_in_call(struct audio_device *adev, bool *in_call) return -ENOSYS; } static int voice_extn_is_in_call_rec_stream(struct stream_in *in, bool *in_call_rec) { return -ENOSYS; } static int voice_extn_get_active_session_id(struct audio_device *adev, uint32_t *session_id) { Loading