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

Commit 5bf39d79 authored by SongFerng Wang's avatar SongFerng Wang Committed by Automerger Merge Worker
Browse files

Merge "[LE] Connect and disconnect both LE headsets" am: ececa85c am:...

Merge "[LE] Connect and disconnect both LE headsets" am: ececa85c am: 0567e66c am: 254ef629 am: de247f70

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

Change-Id: I117e867c8a5a8d70123ac0b8799af2a074c9751b
parents 90b0d74d de247f70
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -285,6 +285,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
@@ -399,6 +405,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();
                }
            }
        }
    }