diff options
author | Charles Chen <clchen@google.com> | 2009-06-24 17:47:21 -0700 |
---|---|---|
committer | Charles Chen <clchen@google.com> | 2009-06-24 17:49:07 -0700 |
commit | 28dbae7df43ee683ba1bf468ad9924092bb9c569 (patch) | |
tree | 70e507a55b1097baa4acfcdd504a45f564633aa8 /packages/TtsService/src | |
parent | 69e1f472c33e241f729c470285a5680866ede75c (diff) | |
download | frameworks_base-28dbae7df43ee683ba1bf468ad9924092bb9c569.zip frameworks_base-28dbae7df43ee683ba1bf468ad9924092bb9c569.tar.gz frameworks_base-28dbae7df43ee683ba1bf468ad9924092bb9c569.tar.bz2 |
Using a sendBroadcast to notify interested parties of when
the TTS queue has finished processing.
Diffstat (limited to 'packages/TtsService/src')
-rwxr-xr-x | packages/TtsService/src/android/tts/TtsService.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/packages/TtsService/src/android/tts/TtsService.java b/packages/TtsService/src/android/tts/TtsService.java index 6fa3141..6e6e121 100755 --- a/packages/TtsService/src/android/tts/TtsService.java +++ b/packages/TtsService/src/android/tts/TtsService.java @@ -424,6 +424,11 @@ public class TtsService extends Service implements OnCompletionListener { return sr; } + private void broadcastTtsQueueProcessingCompleted(){ + Intent i = new Intent(Intent.ACTION_TTS_QUEUE_PROCESSING_COMPLETED); + sendBroadcast(i); + } + private void dispatchSpeechCompletedCallbacks(String mark) { Log.i("TTS callback", "dispatch started"); // Broadcast to all clients the new value. @@ -449,11 +454,7 @@ public class TtsService extends Service implements OnCompletionListener { } if (mSpeechQueue.size() < 1) { mIsSpeaking = false; - // Dispatch a completion here as this is the - // only place where speech completes normally. - // Nothing left to say in the queue is a special case - // that is always a "mark" - associated text is null. - dispatchSpeechCompletedCallbacks(""); + broadcastTtsQueueProcessingCompleted(); return; } |