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

Commit 8a0aba5e authored by Łukasz Rymanowski's avatar Łukasz Rymanowski
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: I28d778687eb31a8d6772f90d98487a834ecdfdc2
parent 1c04fad2
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.containsValue(group_id) == false) {
                        mGroupDescriptors.remove(group_id);
                    }
                    break;
                default:
                    break;