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

Commit a8ef43e8 authored by Jakub Tyszkowski's avatar Jakub Tyszkowski Committed by Automerger Merge Worker
Browse files

Merge "AS: Fix sometimes invalid volume set to LE Audio devices" am:...

Merge "AS: Fix sometimes invalid volume set to LE Audio devices" am: f38b2252 am: 61bf3ed9 am: dde6a3c3

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2502315



Change-Id: I957b05cd05df0a075a330cade5a3c6787a52c6e8
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 25af806a dde6a3c3
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -4424,13 +4424,14 @@ public class AudioService extends IAudioService.Stub
                return;
        }
        // Forcefully set LE audio volume as a workaround, since in some cases
        // (like the outgoing call) the value of 'device' is not DEVICE_OUT_BLE_*
        // even when BLE is connected.
        // In some cases (like the outgoing or rejected call) the value of 'device' is not
        // DEVICE_OUT_BLE_* even when BLE is connected. Changing the volume level in such case
        // may cuase the other devices volume level leaking into the LeAudio device settings.
        if (!AudioSystem.isLeAudioDeviceType(device)) {
            Log.w(TAG, "setLeAudioVolumeOnModeUpdate got unexpected device=" + device
                    + ", forcing to device=" + AudioSystem.DEVICE_OUT_BLE_HEADSET);
            device = AudioSystem.DEVICE_OUT_BLE_HEADSET;
            Log.w(TAG, "setLeAudioVolumeOnModeUpdate ignoring invalid device="
                    + device + ", mode=" + mode + ", index=" + index + " maxIndex=" + maxIndex
                    + " streamType=" + streamType);
            return;
        }
        if (DEBUG_VOL) {