From cf2c26473685f34177acda2b0b5263331777434c Mon Sep 17 00:00:00 2001 From: Nicholas Ambur Date: Wed, 14 Oct 2020 16:47:52 -0700 Subject: [PATCH] fix return behavior of deleteKeyphraseSoundModel When deleting an enrolled keyphrase sound model that is not actively started, the model is never removed from the framework database, and an incorrect value is returned. Test: gts-tradefed run gts -m GtsAssistIntentTestCases \ -t com.google.android.assist.gts.KeyphraseModelManagerTest \ \#testUpdateAndRemoveKeyphraseSoundModel Bug: 169628490 Change-Id: I469fe1fd05e386095ec646e1506fcb191b93c46f --- .../voiceinteraction/VoiceInteractionManagerService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java index 917f65ab7c01b..547d253501e88 100644 --- a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java +++ b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java @@ -1048,9 +1048,9 @@ public class VoiceInteractionManagerService extends SystemService { if (unloadStatus != SoundTriggerInternal.STATUS_OK) { Slog.w(TAG, "Unable to unload keyphrase sound model:" + unloadStatus); } - deleted = mDbHelper.deleteKeyphraseSoundModel(keyphraseId, callingUserId, - bcp47Locale); } + deleted = mDbHelper.deleteKeyphraseSoundModel(keyphraseId, callingUserId, + bcp47Locale); return deleted ? SoundTriggerInternal.STATUS_OK : SoundTriggerInternal.STATUS_ERROR; } finally { if (deleted) {