audiopolicy: keep BT SCO vol at 0 dB on VoIP

The BT SCO volume of VoIP is set as the value computed with the volume
index, while that of voice call keeps constant (0 dB). It causes the
output sound of VoIP being multiplied by a gain computed with the
volume index, then the sound hears different if the volume index has
been changed before. Therefore, the volume of VoIP on BT SCO should keep
at 0 dB as well.

Bug:78206701
Test: manual audio test
Change-Id: I888b2f7c0869902dd5e0adf77f711e7b9fd7e108
Signed-off-by: HW Lee <hwlee@google.com>
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
index 1e5f9ae..3c1de1e 100644
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
@@ -5625,7 +5625,10 @@
     }
 
     float volumeDb = computeVolume(stream, index, device);
-    if (outputDesc->isFixedVolume(device)) {
+    if (outputDesc->isFixedVolume(device) ||
+            // Force VoIP volume to max for bluetooth SCO
+            ((stream == AUDIO_STREAM_VOICE_CALL || stream == AUDIO_STREAM_BLUETOOTH_SCO) &&
+             (device & AUDIO_DEVICE_OUT_ALL_SCO) != 0)) {
         volumeDb = 0.0f;
     }