Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fad001d0 authored by Eric Laurent's avatar Eric Laurent
Browse files

audio policy: mute call RX when SCO volume is 0

Set voice volume to 0 when SCO volume index is 0 to
allow muting RX audio. when index is not 0, voice volume
is set to max to allow volume control by headset as before.

Bug: 111195322
Test: check call volume with SCO headset
Change-Id: I90466b01a9899929cd3e6fb1ac0a4985099497fc
parent e81a326d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -5855,11 +5855,11 @@ status_t AudioPolicyManager::checkAndSetVolume(IVolumeCurves &curves,

    if (isVoiceVolSrc || isBtScoVolSrc) {
        float voiceVolume;
        // Force voice volume to max for bluetooth SCO as volume is managed by the headset
        // Force voice volume to max or mute for Bluetooth SCO as other attenuations are managed by the headset
        if (isVoiceVolSrc) {
            voiceVolume = (float)index/(float)curves.getVolumeIndexMax();
        } else {
            voiceVolume = 1.0;
            voiceVolume = index == 0 ? 0.0 : 1.0;
        }
        if (voiceVolume != mLastVoiceVolume) {
            mpClientInterface->setVoiceVolume(voiceVolume, delayMs);