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

Commit d80ed57e authored by Vlad Popa's avatar Vlad Popa
Browse files

Fix condition for host managed voice SCO volume

After replacing STREAM_BT_SCO and not using the equivalent volume group
in APM, the flags isVoiceVolSrc and isBtScoVolSrc are not mutual
exclusive anymore. In order to check whether the voice volume is managed
by host it is now necessary to check the isBtScoVolSrc is false.

Test: manual
Flag: EXEMPT bugfix
Bug: 374151894
Change-Id: I3e29b86029cc89b3b78da8da2cbd5e1e31940c42
parent 97e57dde
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -3782,7 +3782,7 @@ status_t AudioPolicyManager::setVolumeIndexForAttributes(const audio_attributes_
        if (isVolumeConsistentForCalls(vs, {mCallRxSourceClient->sinkDevice()->type()},
                isVoiceVolSrc, isBtScoVolSrc, __func__)
                && (isVoiceVolSrc || isBtScoVolSrc)) {
            bool voiceVolumeManagedByHost = isVoiceVolSrc &&
            bool voiceVolumeManagedByHost = !isBtScoVolSrc &&
                    !audio_is_ble_out_device(mCallRxSourceClient->sinkDevice()->type());
            setVoiceVolume(index, curves, voiceVolumeManagedByHost, 0);
        }
@@ -8588,7 +8588,7 @@ status_t AudioPolicyManager::checkAndSetVolume(IVolumeCurves &curves,
            deviceTypes, delayMs, force, isVoiceVolSrc);

    if (outputDesc == mPrimaryOutput && (isVoiceVolSrc || isBtScoVolSrc)) {
        bool voiceVolumeManagedByHost = isVoiceVolSrc &&
        bool voiceVolumeManagedByHost = !isBtScoVolSrc &&
                !isSingleDeviceType(deviceTypes, audio_is_ble_out_device);
        setVoiceVolume(index, curves, voiceVolumeManagedByHost, delayMs);
    }