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

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

Unregister AudioManager callbacks while LE Audio service stops

There is chance that AudioManager may call already cleared callback
instances from LeAudioService instance. To avoid this situation,
callbacks needs to be cleared when service stops.

Tag: #feature
Bug: 258573934
Test: atest BluetoothInstrumentationTests
Change-Id: Iec41c1f9c4633f084d8740732e549bbdb552bf5b
parent e3125b3d
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -379,6 +379,9 @@ public class LeAudioService extends ProfileService {
            }
        }

        mAudioManager.unregisterAudioDeviceCallback(mAudioManagerAddAudioDeviceCallback);
        mAudioManager.unregisterAudioDeviceCallback(mAudioManagerRemoveAudioDeviceCallback);

        mAdapterService = null;
        mAudioManager = null;
        mVolumeControlService = null;