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

Commit 250aab36 authored by SongFerng Wang's avatar SongFerng Wang Committed by Gerrit Code Review
Browse files

Merge "Move connect/disconnect group from LE audio Service to Setting"

parents 46b8808b 4b2ec4c3
Loading
Loading
Loading
Loading
+0 −25
Original line number Diff line number Diff line
@@ -366,9 +366,6 @@ public class LeAudioService extends ProfileService {
            sm.sendMessage(LeAudioStateMachine.CONNECT);
        }

        // Connect other devices from this group
        connectSet(device);

        return true;
    }

@@ -394,28 +391,6 @@ public class LeAudioService extends ProfileService {
            sm.sendMessage(LeAudioStateMachine.DISCONNECT);
        }

        // Disconnect other devices from this group
        int groupId = getGroupId(device);
        if (groupId != LE_AUDIO_GROUP_ID_INVALID) {
            for (BluetoothDevice storedDevice : mDeviceGroupIdMap.keySet()) {
                if (device.equals(storedDevice)) {
                    continue;
                }
                if (getGroupId(storedDevice) != groupId) {
                    continue;
                }
                synchronized (mStateMachines) {
                    LeAudioStateMachine sm = mStateMachines.get(storedDevice);
                    if (sm == null) {
                        Log.e(TAG, "Ignored disconnect request for " + storedDevice
                                + " : no state machine");
                        continue;
                    }
                    sm.sendMessage(LeAudioStateMachine.DISCONNECT);
                }
            }
        }

        return true;
    }