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

Commit cf5e792f authored by Atneya Nair's avatar Atneya Nair Committed by Automerger Merge Worker
Browse files

Minor FakeSoundTriggerHal fixes am: abbe7c56

parents 50017849 abbe7c56
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -310,15 +310,16 @@ public class FakeSoundTriggerHal extends ISoundTriggerHw.Stub {
                        IAcknowledgeEvent callback) {
                synchronized (FakeSoundTriggerHal.this.mLock) {
                    // oneway, so don't throw on death
                    if (mIsDead || mIsResourceContended == isResourcesContended) {
                    if (mIsDead) {
                        return;
                    }
                    boolean oldIsResourcesContended = mIsResourceContended;
                    mIsResourceContended = isResourcesContended;
                    // Introducing contention is the only injection which can't be
                    // observed by the ST client.
                    mInjectionDispatcher.wrap((ISoundTriggerInjection unused) ->
                            callback.eventReceived());
                    if (!mIsResourceContended) {
                    if (!mIsResourceContended && oldIsResourcesContended) {
                        mGlobalCallbackDispatcher.wrap((ISoundTriggerHwGlobalCallback cb) ->
                                    cb.onResourcesAvailable());
                    }
@@ -501,10 +502,12 @@ public class FakeSoundTriggerHal extends ISoundTriggerHw.Stub {
                Slog.wtf(TAG, "Attempted to stop recognition with invalid handle");
            }
            ModelSession.RecognitionSession recogSession = session.stopRecognitionForModel();
            if (recogSession != null) {
                mInjectionDispatcher.wrap((ISoundTriggerInjection cb) ->
                        cb.onRecognitionStopped(recogSession));
            }
        }
    }

    @Override
    public void forceRecognitionEvent(int modelHandle) throws RemoteException {