From 6c0020c6a9e50887b9571ef71d04dd622aa7380d Mon Sep 17 00:00:00 2001 From: "Christopher N. Hesse" Date: Fri, 17 Nov 2017 20:41:11 +0100 Subject: [PATCH] audio: End voice call in set_mode() Previously, we would only end the voice call once the next output stream happened (and parameters would be set). Change-Id: Id0d2711605e57ad69d9b26b36afb562444349358 (cherry picked from commit 5169e86c10b7429b01d6ab0500a0509141dcbfe1) --- audio/audio_hw.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/audio/audio_hw.c b/audio/audio_hw.c index 0f8a2a6..169f5c7 100644 --- a/audio/audio_hw.c +++ b/audio/audio_hw.c @@ -2942,10 +2942,6 @@ static int out_set_parameters(struct audio_stream *stream, const char *kvpairs) } } - if ((adev->mode == AUDIO_MODE_NORMAL) && adev->voice.in_call && - (out == adev->primary_output)) { - stop_voice_call(adev); - } pthread_mutex_unlock(&adev->lock); pthread_mutex_unlock(&out->lock); #ifdef PREPROCESSING_ENABLED @@ -4278,6 +4274,10 @@ static int adev_set_mode(struct audio_hw_device *dev, audio_mode_t mode) ALOGE("Failed setting amplifier mode"); } adev->mode = mode; + + if ((mode == AUDIO_MODE_NORMAL) && adev->voice.in_call) { + stop_voice_call(adev); + } } pthread_mutex_unlock(&adev->lock); return 0; -- 2.20.1