Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d936b5bc authored by SongFerngWang's avatar SongFerngWang
Browse files

[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
parent 4734b581
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -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();
                }
            }
        }
    }