Merge "[LE] Connect and disconnect both LE headsets" am: ececa85c9e am: 0567e66c2c

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

Change-Id: I649095997f69f04a211030140c087d78ba5a5bc7
This commit is contained in:
SongFerng Wang
2022-03-10 08:01:00 +00:00
committed by Automerger Merge Worker

View File

@@ -283,6 +283,12 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
public void disconnect() {
synchronized (mProfileLock) {
if (getGroupId() != BluetoothCsipSetCoordinator.GROUP_ID_INVALID) {
for (CachedBluetoothDevice member : getMemberDevice()) {
Log.d(TAG, "Disconnect the member(" + member.getAddress() + ")");
member.disconnect();
}
}
mDevice.disconnect();
}
// Disconnect PBAP server in case its connected
@@ -397,6 +403,12 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
}
mDevice.connect();
if (getGroupId() != BluetoothCsipSetCoordinator.GROUP_ID_INVALID) {
for (CachedBluetoothDevice member : getMemberDevice()) {
Log.d(TAG, "connect the member(" + member.getAddress() + ")");
member.connect();
}
}
}
}