[LE] Connect and disconnect both LE headsets
Disconnect the LE headset from settings page, only one side(L or R) is disconnected. Bug: 206049683 Test: build pass Change-Id: I8c9c808b830947ab8d8510042827e55f85faa781
This commit is contained in:
@@ -282,6 +282,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
|
||||
@@ -396,6 +402,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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user