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

Commit d430d357 authored by Łukasz Rymanowski's avatar Łukasz Rymanowski Committed by Jakub Pawlowski
Browse files

leaudio: Fix removing group descriptors

Group description shall be removed when all the devices from the group
are removed

Bug: 150670922
Tag: #feature
Sponsor: jpawlowski@
Test: atest BluetoothInstrumentationTests

Change-Id: I2ab3fdc9903d9acffe03d36b4027e56f3946c688
parent ef2cf803
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -332,8 +332,6 @@ public class LeAudioService extends ProfileService {
            }
        }

        mGroupDescriptors.remove(groupId);

        return true;
    }

@@ -652,11 +650,16 @@ public class LeAudioService extends ProfileService {
            switch (node_status) {
                case LeAudioStackEvent.GROUP_NODE_ADDED:
                    mDeviceGroupIdMap.put(device, group_id);
                    LeAudioGroupDescriptor descriptor = mGroupDescriptors.get(group_id);
                    if (descriptor == null) {
                        mGroupDescriptors.put(group_id, new LeAudioGroupDescriptor());
                    }
                    break;
                case LeAudioStackEvent.GROUP_NODE_REMOVED:
                    mDeviceGroupIdMap.remove(device);
                    if (mDeviceGroupIdMap.containsKey(group_id) == false) {
                        mGroupDescriptors.remove(group_id);
                    }
                    break;
                default:
                    break;