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

Commit 8672d25e authored by Ytai Ben-Tsvi's avatar Ytai Ben-Tsvi
Browse files

Correctly set the recognition state in response to GET_STATE

A forced recognition does not stop recognition.
SoundTriggerHelper had a bug where it assumed that it does, and so
future interactions would assume the wrong state and would eventually
erroneously use the underlying layers.

Bug: 147568295
Change-Id: I5ae69a8b292fda6aadc6011c4bf5cbc4d263a1ca
parent ae479e55
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -756,7 +756,9 @@ public class SoundTriggerHelper implements SoundTrigger.StatusListener {
            return;
        }

        if (event.status != SoundTrigger.RECOGNITION_STATUS_GET_STATE_RESPONSE) {
            model.setStopped();
        }

        try {
            callback.onGenericSoundTriggerDetected((GenericRecognitionEvent) event);
@@ -900,7 +902,9 @@ public class SoundTriggerHelper implements SoundTrigger.StatusListener {
            return;
        }

        if (event.status != SoundTrigger.RECOGNITION_STATUS_GET_STATE_RESPONSE) {
            modelData.setStopped();
        }

        try {
            modelData.getCallback().onKeyphraseDetected((KeyphraseRecognitionEvent) event);