Merge "fix calling SoundTriggerMiddleware in safeMode" into rvc-dev am: de1f26432c

Change-Id: I9705dc926f3fb5f28a438acb9c433391e52e3abd
This commit is contained in:
Nicholas Ambur
2020-05-18 22:58:52 +00:00
committed by Automerger Merge Worker

View File

@@ -346,12 +346,15 @@ public class SoundTriggerService extends SystemService {
sEventLogger.log(new SoundTriggerLogger.StringEvent("deleteSoundModel(): id = "
+ soundModelId));
// Unload the model if it is loaded.
mSoundTriggerHelper.unloadGenericSoundModel(soundModelId.getUuid());
mDbHelper.deleteGenericSoundModel(soundModelId.getUuid());
if (isInitialized()) {
// Unload the model if it is loaded.
mSoundTriggerHelper.unloadGenericSoundModel(soundModelId.getUuid());
// Stop recognition if it is started.
mSoundModelStatTracker.onStop(soundModelId.getUuid());
// Stop tracking recognition if it is started.
mSoundModelStatTracker.onStop(soundModelId.getUuid());
}
mDbHelper.deleteGenericSoundModel(soundModelId.getUuid());
}
@Override