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

Commit 4c1bdd07 authored by Eric Laurent's avatar Eric Laurent Committed by Android (Google) Code Review
Browse files

Merge "audio policy: fix voice volume update when BT SCO is active" into main

parents bd104632 8d53cf12
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -524,6 +524,14 @@ bool SwAudioOutputDescriptor::setVolume(float volumeDb, bool muted,
    StreamTypeVector streams = streamTypes;
    StreamTypeVector streams = streamTypes;
    if (!AudioOutputDescriptor::setVolume(
    if (!AudioOutputDescriptor::setVolume(
            volumeDb, muted, vs, streamTypes, deviceTypes, delayMs, force, isVoiceVolSrc)) {
            volumeDb, muted, vs, streamTypes, deviceTypes, delayMs, force, isVoiceVolSrc)) {
        if (hasStream(streamTypes, AUDIO_STREAM_BLUETOOTH_SCO)) {
            VolumeSource callVolSrc = getVoiceSource();
            if (callVolSrc != VOLUME_SOURCE_NONE && volumeDb != getCurVolume(callVolSrc)) {
                setCurVolume(callVolSrc, volumeDb, true);
                mClientInterface->setStreamVolume(
                        AUDIO_STREAM_VOICE_CALL, Volume::DbToAmpl(volumeDb), mIoHandle, delayMs);
            }
        }
        return false;
        return false;
    }
    }
    if (streams.empty()) {
    if (streams.empty()) {