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

Commit f3b5be26 authored by Grzegorz Kołodziejczyk's avatar Grzegorz Kołodziejczyk Committed by Łukasz Rymanowski
Browse files

leaudio: Set group as inactive on service stop

Bug: 150670922
Tag: #feature
Sponsor: jpawlowski@
Test: atest BluetoothInstrumentationTests
Change-Id: Ibbdfea76255656f959ef87cabc98da2c65dff5c5
parent 055099e3
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -176,6 +176,20 @@ public class LeAudioService extends ProfileService {
            return true;
        }

        setActiveDevice(null);
        //Don't wait for async call with INACTIVE group status, clean active
        //device for active group.
        for (Map.Entry<Integer, LeAudioGroupDescriptor> entry : mGroupDescriptors.entrySet()) {
            LeAudioGroupDescriptor descriptor = entry.getValue();
            Integer group_id = entry.getKey();
            if (descriptor.mIsActive) {
                descriptor.mIsActive = false;
                updateActiveDevices(group_id, descriptor.mActiveContexts,
                        ACTIVE_CONTEXTS_NONE, descriptor.mIsActive);
                break;
            }
        }

        // Cleanup native interfaces
        mLeAudioNativeInterface.cleanup();
        mLeAudioNativeInterface = null;