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

Commit f0615ae8 authored by Jean-Michel Trivi's avatar Jean-Michel Trivi
Browse files

AudioService: VOICE_CALL vol changes map to SCO in calls

During a call over BT SCO, volume is controlled by
STREAM_BLUETOOTH_SCO. But applications shouldn't have to know
about the routing to control the volume.
Remap STREAM_VOICE_CALL to STREAM_BLUETOOTH_SCO in
setStreamVolume during a call over SCO.

Bug: 326861992
Test: place call on SCO, adb shell cmd audio set-volume 0 15 (0 for
STREAM_VOICE_CALL followed by vol index)

Change-Id: Ib5abee36380cc6cab8579044f105e0d503397fd5
parent 1265dc50
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -4674,6 +4674,12 @@ public class AudioService extends IAudioService.Stub
        int streamTypeAlias = mStreamVolumeAlias[streamType];
        VolumeStreamState streamState = mStreamStates[streamTypeAlias];
        if ((streamType == AudioManager.STREAM_VOICE_CALL)
                && isInCommunication() && mDeviceBroker.isBluetoothScoActive()) {
            Log.i(TAG, "setStreamVolume for STREAM_VOICE_CALL, switching to STREAM_BLUETOOTH_SCO");
            streamType = AudioManager.STREAM_BLUETOOTH_SCO;
        }
        final int device = (ada == null)
                ? getDeviceForStream(streamType)
                : ada.getInternalType();