summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author SongFerng Wang <songferngwang@google.com> 2022-03-10 07:08:29 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2022-03-10 07:08:29 +0000
commitececa85c9e205d14bc276132c7d11ec40afdb9ef (patch)
tree66c95c8daa3b9f935a2955900609a188a0a0aab3
parent0979ff10d8a339158bd7bc23490aac060df2ce02 (diff)
parentd936b5bc7a1588a0f62d7362356ab7c1d16af590 (diff)
Merge "[LE] Connect and disconnect both LE headsets"
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
index d6f08c663ccd..981d8e403cd6 100644
--- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
+++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
@@ -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();
+ }
+ }
}
}