diff options
author | Sandeep Siddhartha <sansid@google.com> | 2014-08-01 11:32:03 -0700 |
---|---|---|
committer | Sandeep Siddhartha <sansid@google.com> | 2014-08-01 17:46:27 -0700 |
commit | 2c0273e50a3162595e9a54030166f2369b039a5a (patch) | |
tree | 6075295a33de952b996038ffdf10f22594a1cf4b /tests/VoiceInteraction | |
parent | fc0fc0e341f2a2d707d5a8eafd65db34bdffb35c (diff) | |
download | frameworks_base-2c0273e50a3162595e9a54030166f2369b039a5a.zip frameworks_base-2c0273e50a3162595e9a54030166f2369b039a5a.tar.gz frameworks_base-2c0273e50a3162595e9a54030166f2369b039a5a.tar.bz2 |
Add a flag for multiple triggers with same recognition session
Also annotate the flags with @IntDef to make things clearer and safer
Add more debug logging
Revert to start/stop being synchronous since telephony and microphone will
need to be handled internally.
Bug: 16731586
Bug: 16514535
Bug: 16549061
Change-Id: I83695d52e9547269c95d443e4d921c9238b7401e
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; } } |