fix calling SoundTriggerMiddleware in safeMode
deleteSoundModel is calling into the SoundTriggerModdleware when safe mode is enabled. Middleware should not be called in this case. Bug: 152354427 Test: atest SoundTriggerServiceTest#testServiceDisabledInSafeMode Change-Id: I1fa13fd32a384b59928a5deb9505dc4a1e757efa
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user