Call removeActiveDevice when want to remove an active device.
When telecomm wants to remove an active device, will call
setActiveDevice with the device parameter is null. Since
BluetoothAdapter provides a new api removeActiveDevice, it needs to call
the api if the device parameter is null.
Bug: 151410432
Test: manual
Change-Id: I8363e93a8a3ad45de014275033939574ef4828bc
diff --git a/src/com/android/server/telecom/BluetoothAdapterProxy.java b/src/com/android/server/telecom/BluetoothAdapterProxy.java
index 41b4faa..ee9cde3 100644
--- a/src/com/android/server/telecom/BluetoothAdapterProxy.java
+++ b/src/com/android/server/telecom/BluetoothAdapterProxy.java
@@ -43,6 +43,10 @@
if (mBluetoothAdapter == null) {
return false;
}
- return mBluetoothAdapter.setActiveDevice(device, profiles);
+ if (device != null) {
+ return mBluetoothAdapter.setActiveDevice(device, profiles);
+ } else {
+ return mBluetoothAdapter.removeActiveDevice(profiles);
+ }
}
}