diff options
author | Sandeep Siddhartha <sansid@google.com> | 2014-07-29 14:41:50 -0700 |
---|---|---|
committer | Sandeep Siddhartha <sansid@google.com> | 2014-07-30 11:43:41 -0700 |
commit | 1ed12ddb8c46193cc4d790b9c7d6a5d61afb3311 (patch) | |
tree | 98c42d193596c9c24dc94b8c1df391081160a7d3 /tests | |
parent | 38e2d104d80e092af7d997db025b2a9b47150470 (diff) | |
download | frameworks_base-1ed12ddb8c46193cc4d790b9c7d6a5d61afb3311.zip frameworks_base-1ed12ddb8c46193cc4d790b9c7d6a5d61afb3311.tar.gz frameworks_base-1ed12ddb8c46193cc4d790b9c7d6a5d61afb3311.tar.bz2 |
Make startRecognition async
- This is needed for telephony and audio integration which should happen via async callbacks
that'll end up starting/stopping recognition.
e.g. if a startRecognition happens when in a phone call - the onDetectionStarted will get called once the phone
call ends.
For now the transient stoppages due to internal reasons will not be propagated back to the client.
Bug: 16514535
Bug: 16515468
Change-Id: I1b2b8edd28f5c5e67c453f66c23e1a67a626114e
Diffstat (limited to 'tests')
-rw-r--r-- | tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionService.java | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionService.java b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionService.java index cc710f9..49c3d0a 100644 --- a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionService.java +++ b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionService.java @@ -41,9 +41,19 @@ public class MainInteractionService extends VoiceInteractionService { } @Override + public void onDetectionStarted() { + Log.i(TAG, "onDetectionStarted"); + } + + @Override public void onDetectionStopped() { Log.i(TAG, "onDetectionStopped"); } + + @Override + public void onError() { + Log.i(TAG, "onError"); + } }; private AlwaysOnHotwordDetector mHotwordDetector; @@ -89,10 +99,9 @@ public class MainInteractionService extends VoiceInteractionService { Log.i(TAG, "Need to enroll with " + enroll); break; case AlwaysOnHotwordDetector.STATE_KEYPHRASE_ENROLLED: - Log.i(TAG, "STATE_KEYPHRASE_ENROLLED"); - int status = mHotwordDetector.startRecognition( + Log.i(TAG, "STATE_KEYPHRASE_ENROLLED - starting recognition"); + mHotwordDetector.startRecognition( AlwaysOnHotwordDetector.RECOGNITION_FLAG_NONE); - Log.i(TAG, "startRecognition status = " + status); break; } } |