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

Commit 8f099bb0 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...

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

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