Stop audio after call without disconnecting device
`removeActiveDevice(ACTIVE_DEVICE_ALL)` is removing the active device
from all sound profiles. (a2dp, hfp, le_audio, hearing aid).
The telecom BluetoothDeviceManager should not interract with the current
bluetooth active device.
Fix: 222229401
Test: No device to test - need external testing
Change-Id: I11850bf221a36e4e3846b148020807a250db4126
diff --git a/src/com/android/server/telecom/bluetooth/BluetoothDeviceManager.java b/src/com/android/server/telecom/bluetooth/BluetoothDeviceManager.java
index 2785739..e5706d2 100644
--- a/src/com/android/server/telecom/bluetooth/BluetoothDeviceManager.java
+++ b/src/com/android/server/telecom/bluetooth/BluetoothDeviceManager.java
@@ -382,16 +382,8 @@
}
public void disconnectAudio() {
- if (mBluetoothAdapter != null) {
- for (BluetoothDevice device: mBluetoothAdapter.getActiveDevices(
- BluetoothProfile.HEARING_AID)) {
- if (device != null) {
- mBluetoothAdapter.removeActiveDevice(BluetoothAdapter.ACTIVE_DEVICE_ALL);
- }
- }
- disconnectSco();
- clearLeAudioCommunicationDevice();
- }
+ disconnectSco();
+ clearLeAudioCommunicationDevice();
}
public void disconnectSco() {
diff --git a/tests/src/com/android/server/telecom/tests/BluetoothDeviceManagerTest.java b/tests/src/com/android/server/telecom/tests/BluetoothDeviceManagerTest.java
index f011f0c..a9851bf 100644
--- a/tests/src/com/android/server/telecom/tests/BluetoothDeviceManagerTest.java
+++ b/tests/src/com/android/server/telecom/tests/BluetoothDeviceManagerTest.java
@@ -367,7 +367,6 @@
.thenReturn(Arrays.asList(device2, null));
mBluetoothDeviceManager.disconnectAudio();
- verify(mAdapter).removeActiveDevice(BluetoothAdapter.ACTIVE_DEVICE_ALL);
verify(mBluetoothHeadset).disconnectAudio();
}