hal: Fix ANR if In-Call recording is started at end of voice call

Sometimes ANR is observed, if In-call recording is started at the
end of voice call.
Incorrect use case "afe-proxy-record" is being picked up in this
case as voice call is not active by the time audio HAL starts
the input stream, thus resulting in pcm device open failures.
Fix this by rejecting start input request if voice call is not
active by the time input is started.

CRs-Fixed: 810997
Change-Id: I8a9d0789cf37f5523de5d1da5e9fda59198eb901
This commit is contained in:
Venkata Narendra Kumar Gutta 2015-03-30 19:16:14 +05:30
parent 94a5bdc428
commit 76440ba853
1 changed files with 12 additions and 0 deletions

View File

@ -293,6 +293,18 @@ int voice_check_and_set_incall_rec_usecase(struct audio_device *adev,
session_id, rec_mode);
ALOGV("%s: Update usecase to %d",__func__, in->usecase);
} else {
/*
* Reject the recording instances, where the recording is started
* with In-call voice recording source types but voice call is not
* active by the time input is started
*/
if ((in->source == AUDIO_SOURCE_VOICE_UPLINK) ||
(in->source == AUDIO_SOURCE_VOICE_DOWNLINK) ||
(in->source == AUDIO_SOURCE_VOICE_CALL)) {
ret = -EINVAL;
ALOGE("%s: As voice call is not active, Incall rec usecase can't be \
selected for requested source:%d",__func__, in->source);
}
ALOGV("%s: voice call not active", __func__);
}