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

Commit 286569b3 authored by Felix Oghina's avatar Felix Oghina
Browse files

[hotword] call destroy listener outside of lock

Bug: 296002243
Test: atest CtsVoiceInteractionTestCases

Change-Id: I0c783fad416f6f0c7d82dc3e71c5531b3b6f62bd
parent 31d917a5
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -199,8 +199,12 @@ abstract class AbstractDetector implements HotwordDetector {
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
        Consumer<AbstractDetector> onDestroyListener;
        synchronized (mLock) {
            mOnDestroyListener.accept(this);
            onDestroyListener = mOnDestroyListener;
        }
        if (onDestroyListener != null) {
            onDestroyListener.accept(this);
        }
    }