diff options
Diffstat (limited to 'tests/VoiceInteraction')
-rw-r--r-- | tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionService.java | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionService.java b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionService.java index b43ad6f..02610f8 100644 --- a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionService.java +++ b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionService.java @@ -20,6 +20,7 @@ import android.content.Intent; import android.os.Bundle; import android.service.voice.AlwaysOnHotwordDetector; import android.service.voice.AlwaysOnHotwordDetector.Callback; +import android.service.voice.AlwaysOnHotwordDetector.TriggerAudio; import android.service.voice.VoiceInteractionService; import android.util.Log; @@ -36,21 +37,11 @@ public class MainInteractionService extends VoiceInteractionService { } @Override - public void onDetected(byte[] data) { + public void onDetected(TriggerAudio triggerAudio) { Log.i(TAG, "onDetected"); } @Override - public void onDetectionStarted() { - Log.i(TAG, "onDetectionStarted"); - } - - @Override - public void onDetectionStopped() { - Log.i(TAG, "onDetectionStopped"); - } - - @Override public void onError() { Log.i(TAG, "onError"); } @@ -95,8 +86,12 @@ public class MainInteractionService extends VoiceInteractionService { break; case AlwaysOnHotwordDetector.STATE_KEYPHRASE_ENROLLED: Log.i(TAG, "STATE_KEYPHRASE_ENROLLED - starting recognition"); - mHotwordDetector.startRecognition( - AlwaysOnHotwordDetector.RECOGNITION_FLAG_NONE); + if (mHotwordDetector.startRecognition( + AlwaysOnHotwordDetector.RECOGNITION_FLAG_NONE)) { + Log.i(TAG, "startRecognition succeeded"); + } else { + Log.i(TAG, "startRecognition failed"); + } break; } } |