Skip to content

Commit cc084f1

Browse files
committed
Fix superfluous onError callbacks.
When stop() is called twice or after done().This relates to bug 5662598 because users using the old deprecated API will see two calls to onUtteranceCompleted. bug:5662598 Change-Id: I5d59cf66b4f4c8650d3f8f9e503ac3f33132c0d0
1 parent bb1e7d4 commit cc084f1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/java/android/speech/tts/AudioPlaybackHandler.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,8 @@ private void handleSynthesisDone(MessageParams msg) {
428428
final AudioTrack audioTrack = params.getAudioTrack();
429429

430430
if (audioTrack == null) {
431-
params.getDispatcher().dispatchOnError();
431+
// There was already a call to handleSynthesisDone for
432+
// this token.
432433
return;
433434
}
434435

0 commit comments

Comments
 (0)