From 1bbfeb9e73dbd5ec41f491a5878f396bad70c07f Mon Sep 17 00:00:00 2001 From: Anton Potapov Date: Wed, 11 Sep 2024 17:55:07 +0100 Subject: Check for SCO devices for STREAM_VOICE_CALL when determining routedToBluetooth Flag: EXEMPT BUGFIX Fixes: 365673126 Test: atest VolumeDialogControllerImpl Test: manual on the foldable. Join a call with a compatible headset and adjust volume Change-Id: I6b535d6debb3479eba5b49136d564684846376c1 --- .../android/systemui/volume/VolumeDialogControllerImpl.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogControllerImpl.java b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogControllerImpl.java index d9e72bf592a0..768fda949a4a 100644 --- a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogControllerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogControllerImpl.java @@ -539,10 +539,12 @@ public class VolumeDialogControllerImpl implements VolumeDialogController, Dumpa != 0; changed |= updateStreamRoutedToBluetoothW(stream, routedToBluetooth); } else if (stream == AudioManager.STREAM_VOICE_CALL) { - final boolean routedToBluetooth = - (mAudio.getDevicesForStream(AudioManager.STREAM_VOICE_CALL) - & AudioManager.DEVICE_OUT_BLE_HEADSET) != 0; - changed |= updateStreamRoutedToBluetoothW(stream, routedToBluetooth); + final int devices = mAudio.getDevicesForStream(AudioManager.STREAM_VOICE_CALL); + final int bluetoothDevicesMask = (AudioManager.DEVICE_OUT_BLE_HEADSET + | AudioManager.DEVICE_OUT_BLUETOOTH_SCO_HEADSET + | AudioManager.DEVICE_OUT_BLUETOOTH_SCO_CARKIT); + changed |= updateStreamRoutedToBluetoothW(stream, + (devices & bluetoothDevicesMask) != 0); } return changed; } -- cgit v1.2.3-59-g8ed1b