Merge "fix calling SoundTriggerMiddleware in safeMode" into rvc-dev

This commit is contained in:
Nicholas Ambur
2020-05-18 22:52:09 +00:00
committed by Android (Google) Code Review

View File

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