From dcf3068fcb55f101680e70a8a6f84f3b2c9cb1e3 Mon Sep 17 00:00:00 2001 From: Sandeep Siddhartha Date: Fri, 22 Aug 2014 16:36:34 -0700 Subject: Fix the Locale story in the hotword API Tighten the API by taking in a locale rather than a string tag. Tighten the checks when reading the enrollment metadata, bail out if any attribute is missing or invalid. Add missing recycle call for a TypedArray Stop recognition when sound model(s) change. This is needed during un-enrollment/re-enrollment. Bug: 17187528 Bug: 17205230 Change-Id: Idb00b51ef8c4ea0a8f8993decea582223181fa3d --- .../src/com/android/test/voiceinteraction/MainInteractionService.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tests/VoiceInteraction/src/com') diff --git a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionService.java b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionService.java index 77c0c32..1233c0c 100644 --- a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionService.java +++ b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionService.java @@ -25,6 +25,7 @@ import android.service.voice.VoiceInteractionService; import android.util.Log; import java.util.Arrays; +import java.util.Locale; public class MainInteractionService extends VoiceInteractionService { static final String TAG = "MainInteractionService"; @@ -67,7 +68,8 @@ public class MainInteractionService extends VoiceInteractionService { Log.i(TAG, "Keyphrase enrollment meta-data: " + Arrays.toString(getKeyphraseEnrollmentInfo().listKeyphraseMetadata())); - mHotwordDetector = createAlwaysOnHotwordDetector("Hello There", "en-US", mHotwordCallback); + mHotwordDetector = createAlwaysOnHotwordDetector( + "Hello There", new Locale("en-US"), mHotwordCallback); } @Override -- cgit v1.1