Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 23f58443 authored by Android (Google) Code Review's avatar Android (Google) Code Review Committed by The Android Open Source Project
Browse files

am d4eac5f3: Merge change 5300 into donut

Merge commit 'd4eac5f3'

* commit 'd4eac5f3':
  Using a sendBroadcast to notify interested parties of when
parents e64c5567 d4eac5f3
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -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;
            }