hal: fix voice call mute issue
The backend is always configured with default bit width and sample
rate for voice calls. The backend reconfiguration should not be done
when a new stream starts during voice call.
Change-Id: I9fda27c4fb1925b3ddeec929ad986886dc4d695e
CRs-fixed: 747001
diff --git a/hal/msm8974/platform.c b/hal/msm8974/platform.c
index a46e414..f08657a 100644
--- a/hal/msm8974/platform.c
+++ b/hal/msm8974/platform.c
@@ -2641,24 +2641,20 @@
// For voice calls use default configuration
// force routing is not required here, caller will do it anyway
- if (adev->mode == AUDIO_MODE_IN_CALL ||
- adev->mode == AUDIO_MODE_IN_COMMUNICATION) {
+ if (voice_is_in_call(adev) || adev->mode == AUDIO_MODE_IN_COMMUNICATION) {
ALOGW("%s:Use default bw and sr for voice/voip calls ",__func__);
- *new_bit_width = CODEC_BACKEND_DEFAULT_BIT_WIDTH;
- *new_sample_rate = CODEC_BACKEND_DEFAULT_SAMPLE_RATE;
- backend_change = true;
- }
-
- /*
- * The backend should be configured at highest bit width and/or
- * sample rate amongst all playback usecases.
- * If the selected sample rate and/or bit width differ with
- * current backend sample rate and/or bit width, then, we set the
- * backend re-configuration flag.
- *
- * Exception: 16 bit playbacks is allowed through 16 bit/48 khz backend only
- */
- if (!backend_change) {
+ bit_width = CODEC_BACKEND_DEFAULT_BIT_WIDTH;
+ sample_rate = CODEC_BACKEND_DEFAULT_SAMPLE_RATE;
+ } else {
+ /*
+ * The backend should be configured at highest bit width and/or
+ * sample rate amongst all playback usecases.
+ * If the selected sample rate and/or bit width differ with
+ * current backend sample rate and/or bit width, then, we set the
+ * backend re-configuration flag.
+ *
+ * Exception: 16 bit playbacks is allowed through 16 bit/48 khz backend only
+ */
list_for_each(node, &adev->usecase_list) {
struct audio_usecase *curr_usecase;
curr_usecase = node_to_item(node, struct audio_usecase, list);