voice_extn: remove redundant check of mode when stop voice use case

voice use case is still active when mode switched from MODE_IN_CALL
to MODE_IN_COMMUNICATION, while the output used for driving call is
NULL.

This could possibly makes segment fault in mediaserver when call
is activated before the output updated to valid value.

Change-Id: I070dd5e7a1c6d2883ea611588737b1f5c577b275
CRs-Fixed: 953010
This commit is contained in:
Zhou Song 2015-12-14 18:06:31 +08:00 committed by Gerrit - the friendly Code Review server
parent 26c67740c7
commit d50037291b
1 changed files with 4 additions and 7 deletions

View File

@ -430,15 +430,12 @@ int voice_extn_stop_call(struct audio_device *adev)
* set routing with device BT A2DP profile. Hence end all voice calls when
* set_mode(AUDIO_MODE_NORMAL) before BT A2DP profile is selected.
*/
if (adev->mode == AUDIO_MODE_NORMAL) {
ALOGD("%s: end all calls", __func__);
for (i = 0; i < MAX_VOICE_SESSIONS; i++) {
adev->voice.session[i].state.new = CALL_INACTIVE;
}
ret = update_calls(adev);
}
return ret;
}