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

Commit c0bcb773 authored by Chris Thornton's avatar Chris Thornton Committed by android-build-merger
Browse files

Merge \"SoundTriggerHelpoer: Send pause events on abort if a model is running.\" into nyc-mr1-dev

am: d661476c

Change-Id: Ie470d782d3e16a440c345a444d4eb29cebec34b4
parents 7ce8cfbe d661476c
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -696,8 +696,13 @@ public class SoundTriggerHelper implements SoundTrigger.StatusListener {
        Slog.w(TAG, "Recognition aborted");
        MetricsLogger.count(mContext, "sth_recognition_aborted", 1);
        ModelData modelData = getModelDataForLocked(event.soundModelHandle);
        if (modelData != null) {
        if (modelData != null && modelData.isModelStarted()) {
            modelData.setStopped();
            try {
                modelData.getCallback().onRecognitionPaused();
            } catch (RemoteException e) {
                Slog.w(TAG, "RemoteException in onRecognitionPaused", e);
            }
        }
    }