hal: fix incorrect VOIP volume when device switch
During device switch, when voip playback mixer path
is updated for new backend , previously set volume
is not restored and default volume is applied. This
cause VOIP sound in maximum volume.
Fix this by setting cached volume level after device switch.
CRs-Fixed: 2166709
Change-Id: Id3d6fd4b80909db80104fc0109bf5d84c4858922
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 1a8f0a1..314b14d 100755
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -3706,8 +3706,9 @@
out->a2dp_compress_mute = false;
out_set_compr_volume(&out->stream, out->volume_l, out->volume_r);
pthread_mutex_unlock(&out->compr_mute_lock);
+ } else if (out->usecase == USECASE_AUDIO_PLAYBACK_VOIP) {
+ out_set_voip_volume(&out->stream, out->volume_l, out->volume_r);
}
-
}
}