summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Kyunglyul Hyun <klhyun@google.com> 2022-05-09 17:45:07 +0900
committer Kyunglyul Hyun <klhyun@google.com> 2022-05-11 11:22:05 +0900
commitbc4118725760199c5798b8ee28ba4c2817a4b2a4 (patch)
treed8fa5f056f568e4c3e3fadbb2b37a915d88b8825
parent197653158e575649598e7c59ce36dcb8a65851d2 (diff)
Correct stream type for BLE input device
Correct the stream type of an active BLE input device as STREAM_DEFAULT. Bug: 230556991 Test: Switching BLE -> Phone -> BLE to check if Blutooth volume is recovered (A2DP is tested as well to ensure no regression) Change-Id: I883cce5e2525d6a10970fe38bd36e676438d016a Merged-In: I0dc289d9b670133928513aa5e5c1edd240351aef
-rw-r--r--services/core/java/com/android/server/audio/AudioDeviceBroker.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/audio/AudioDeviceBroker.java b/services/core/java/com/android/server/audio/AudioDeviceBroker.java
index 406ff9b00686..a81699fa82c3 100644
--- a/services/core/java/com/android/server/audio/AudioDeviceBroker.java
+++ b/services/core/java/com/android/server/audio/AudioDeviceBroker.java
@@ -1202,8 +1202,11 @@ import java.util.concurrent.atomic.AtomicBoolean;
break;
case MSG_L_SET_BT_ACTIVE_DEVICE:
synchronized (mDeviceStateLock) {
- mDeviceInventory.onSetBtActiveDevice((BtDeviceInfo) msg.obj,
- mAudioService.getBluetoothContextualVolumeStream());
+ BtDeviceInfo btInfo = (BtDeviceInfo) msg.obj;
+ mDeviceInventory.onSetBtActiveDevice(btInfo,
+ (btInfo.mProfile != BluetoothProfile.LE_AUDIO || btInfo.mIsLeOutput)
+ ? mAudioService.getBluetoothContextualVolumeStream()
+ : AudioSystem.STREAM_DEFAULT);
}
break;
case MSG_BT_HEADSET_CNCT_FAILED: