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
diff --git a/hal/voice_extn/voice_extn.c b/hal/voice_extn/voice_extn.c
index 1717cba..f36a7a6 100644
--- a/hal/voice_extn/voice_extn.c
+++ b/hal/voice_extn/voice_extn.c
@@ -430,15 +430,12 @@
* 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);
+ 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;
}