Merge "hal: Fix VoIP Mute failure in SIP call during Voice call HOLD"

This commit is contained in:
Linux Build Service Account 2014-05-08 12:24:01 -07:00 committed by Gerrit - the friendly Code Review server
commit 09e624082a
5 changed files with 34 additions and 1 deletions

View File

@ -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:

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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,
@ -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)
{