Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Looking at the <a href="http://eyes-free.googlecode.com/svn-history/r593/trunk/tts/src/com/google/tts/TTSService.java" rel="nofollow">TTSService.java</a> source code available at <a href="http://eyes-free.googlecode.com" rel="nofollow">http://eyes-free.googlecode.com</a> you can find the function <strong>dispatchUtteranceCompletedCallback()</strong>:</p> <pre><code>private void dispatchUtteranceCompletedCallback(String utteranceId, String packageName) { /* Legacy support for TTS */ final int oldN = mCallbacksOld.beginBroadcast(); for (int i = 0; i &lt; oldN; i++) { try { mCallbacksOld.getBroadcastItem(i).markReached(""); } catch (RemoteException e) { // The RemoteCallbackList will take care of removing // the dead object for us. } } try { mCallbacksOld.finishBroadcast(); } catch (IllegalStateException e) { // May get an illegal state exception here if there is only // one app running and it is trying to quit on completion. // This is the exact scenario triggered by MakeBagel return; } /* End of legacy support for TTS */ ITtsCallbackBeta cb = mCallbacksMap.get(packageName); if (cb == null) { return; } Log.v(SERVICE_TAG, "TTS callback: dispatch started"); // Broadcast to all clients the new value. final int N = mCallbacks.beginBroadcast(); try { cb.utteranceCompleted(utteranceId); } catch (RemoteException e) { // The RemoteCallbackList will take care of removing // the dead object for us. } mCallbacks.finishBroadcast(); Log.v(SERVICE_TAG, "TTS callback: dispatch completed to " + N); } </code></pre> <p>1 is the current value of N, which is initialized by the return value from <strong>mCallbacks.beginBroadcast()</strong>.</p> <p><a href="http://developer.android.com/reference/android/os/RemoteCallbackList.html#beginBroadcast%28%29" rel="nofollow">beginBroadcast()</a> is a method of the class <a href="http://developer.android.com/reference/android/os/RemoteCallbackList.html" rel="nofollow">RemoteCallbackList</a> and its documentation states that it:</p> <blockquote> <p>Returns the number of callbacks in the broadcast, to be used with getBroadcastItem(int) to determine the range of indices you can supply</p> </blockquote> <p>Does this help?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload