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

Commit 2a70911d authored by Eric Laurent's avatar Eric Laurent Committed by Android Build Coastguard Worker
Browse files

AudioPolicyManager: fix DTMF gain over BT SCO

Similarly to voice communication, DTMF usage gain must be maxed out
when playing over Bluetooth SCO to avoid the double attenuation.

Test: repro steps in bug
Flag: EXEMPT bug fix
Bug: 367200697
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:c32e669e3da6ad44d86f9c486dfc301165731ebb)
Merged-In: I24f28c7f36c13f94fb68b44a4a5a0ccebaad7158
Change-Id: I24f28c7f36c13f94fb68b44a4a5a0ccebaad7158
parent fe7a6971
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -8478,9 +8478,11 @@ status_t AudioPolicyManager::checkAndSetVolume(IVolumeCurves &curves,
    }

    float volumeDb = computeVolume(curves, volumeSource, index, deviceTypes);
    const VolumeSource dtmfVolSrc = toVolumeSource(AUDIO_STREAM_DTMF, false);
    if (outputDesc->isFixedVolume(deviceTypes) ||
            // Force VoIP volume to max for bluetooth SCO/BLE device except if muted
            (index != 0 && (isVoiceVolSrc || isBtScoVolSrc) &&
            (index != 0 && (isVoiceVolSrc || isBtScoVolSrc
                        || (isInCall() && (dtmfVolSrc == volumeSource))) &&
                    (isSingleDeviceType(deviceTypes, audio_is_bluetooth_out_sco_device)
                    || isSingleDeviceType(deviceTypes, audio_is_ble_out_device)))) {
        volumeDb = 0.0f;