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

Commit c79c0792 authored by Narayan Kamath's avatar Narayan Kamath Committed by Android (Google) Code Review
Browse files

Merge "Few minor TTS clean ups."

parents 919511a6 90e5650f
Loading
Loading
Loading
Loading
+6 −8
Original line number Diff line number Diff line
@@ -94,14 +94,12 @@ class AudioPlaybackHandler {
            //
            // (Even if it did, all it would result in is a warning message).
            mQueue.add(new ListEntry(SYNTHESIS_DONE, token, HIGH_PRIORITY));
        } else  {
            if (token != null) {
                if (token.getType() == MessageParams.TYPE_AUDIO) {
        } else if (token.getType() == MessageParams.TYPE_AUDIO) {
            ((AudioMessageParams) token).getPlayer().stop();
            // No cleanup required for audio messages.
        } else if (token.getType() == MessageParams.TYPE_SILENCE) {
            ((SilenceMessageParams) token).getConditionVariable().open();
                }
            }
            // No cleanup required for silence messages.
        }
    }

+8 −0
Original line number Diff line number Diff line
@@ -581,6 +581,14 @@ public class TextToSpeech {
                service.setCallback(getPackageName(), null);
                service.stop(getPackageName());
                mServiceConnection.disconnect();
                // Context#unbindService does not result in a call to
                // ServiceConnection#onServiceDisconnected. As a result, the
                // service ends up being destroyed (if there are no other open
                // connections to it) but the process lives on and the
                // ServiceConnection continues to refer to the destroyed service.
                //
                // This leads to tons of log spam about SynthThread being dead.
                mServiceConnection = null;
                mCurrentEngine = null;
                return null;
            }
+0 −4
Original line number Diff line number Diff line
@@ -767,10 +767,6 @@ public abstract class TextToSpeechService extends Service {
            mCallbacks.setCallback(packageName, cb);
        }

        private boolean isDefault(String lang, String country, String variant) {
            return Locale.getDefault().equals(new Locale(lang, country, variant));
        }

        private String intern(String in) {
            // The input parameter will be non null.
            return in.intern();