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

Commit a30bc8d8 authored by Grzegorz Kołodziejczyk's avatar Grzegorz Kołodziejczyk
Browse files

le_audio: Deactivate active group before removing last active member

This patch helps to clean up active group before removing last member.

Tag: #feature
Bug: 261362580
Test: atest LeAudioServiceTest
Change-Id: I0917ce3fd72792ca9b2c49aabd9131c100c1667c
Merged-In: I0917ce3fd72792ca9b2c49aabd9131c100c1667c
(cherry picked from commit c7911d8f)
parent 636396e4
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -2252,6 +2252,13 @@ public class LeAudioService extends ProfileService {
            }

            if (isGroupEmpty) {
                /* Device is currently an active device. Group needs to be inactivated before
                 * removing
                 */
                if (Objects.equals(device, mActiveAudioOutDevice)
                        || Objects.equals(device, mActiveAudioInDevice)) {
                    handleGroupTransitToInactive(groupId);
                }
                mGroupDescriptors.remove(groupId);
            }
            notifyGroupNodeRemoved(device, groupId);