Merge "AudioDeviceInventory: Fix for switching leaudio active/inactive" am: 810cf114cd am: 94964fc768 am: 9101f31567 am: 15b15867f8

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

Change-Id: I7ea215c9e5f6a2d95d5f17f643bb1fd6d7172044
This commit is contained in:
Treehugger Robot
2022-01-15 07:31:58 +00:00
committed by Automerger Merge Worker

View File

@@ -1124,6 +1124,12 @@ public class AudioDeviceInventory {
private void makeLeAudioDeviceAvailable(String address, String name, int streamType, int device,
String eventSource) {
if (device != AudioSystem.DEVICE_NONE) {
/* Audio Policy sees Le Audio similar to A2DP. Let's make sure
* AUDIO_POLICY_FORCE_NO_BT_A2DP is not set
*/
mDeviceBroker.setBluetoothA2dpOnInt(true, false /*fromA2dp*/, eventSource);
AudioSystem.setDeviceConnectionState(device, AudioSystem.DEVICE_STATE_AVAILABLE,
address, name, AudioSystem.AUDIO_FORMAT_DEFAULT);
mConnectedDevices.put(DeviceInfo.makeDeviceListKey(device, address),