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

Commit 62038c1f authored by SongFerng Wang's avatar SongFerng Wang Committed by Automerger Merge Worker
Browse files

Merge "Move connect/disconnect group from LE audio Service to Setting" am: 250aab36

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2015215

Change-Id: I50dcb980693d07a609ac20380a43296f6b417d86
parents d5936193 250aab36
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;
    }