diff options
author | Charles Chen <clchen@google.com> | 2009-07-10 20:58:15 -0700 |
---|---|---|
committer | Charles Chen <clchen@google.com> | 2009-07-10 20:58:15 -0700 |
commit | 630a8de44fa0ca855c4a87d939432f831e8ed531 (patch) | |
tree | 88873b5824858f901e8a20aa14ca19421b0c2ad1 /packages/TtsService | |
parent | cf29e116129f38309c18ba14b9893b079a712289 (diff) | |
download | frameworks_base-630a8de44fa0ca855c4a87d939432f831e8ed531.zip frameworks_base-630a8de44fa0ca855c4a87d939432f831e8ed531.tar.gz frameworks_base-630a8de44fa0ca855c4a87d939432f831e8ed531.tar.bz2 |
Fixing TTS breakage.
Diffstat (limited to 'packages/TtsService')
-rwxr-xr-x | packages/TtsService/src/android/tts/TtsService.java | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/packages/TtsService/src/android/tts/TtsService.java b/packages/TtsService/src/android/tts/TtsService.java index ea22410..60c30b2 100755 --- a/packages/TtsService/src/android/tts/TtsService.java +++ b/packages/TtsService/src/android/tts/TtsService.java @@ -132,7 +132,7 @@ public class TtsService extends Service implements OnCompletionListener { @Override public void onCreate() { super.onCreate(); - //Log.i("TTS", "TTS starting"); + Log.i("TTS", "TTS starting"); mResolver = getContentResolver(); @@ -326,6 +326,7 @@ public class TtsService extends Service implements OnCompletionListener { * engines. */ private int speak(String callingApp, String text, int queueMode, ArrayList<String> params) { + Log.i("TTS service received", text); if (queueMode == TextToSpeech.TTS_QUEUE_FLUSH) { stop(callingApp); } @@ -455,14 +456,16 @@ public class TtsService extends Service implements OnCompletionListener { String variant = ""; for (int i = 0; i < params.size() - 1; i = i + 2){ String param = params.get(i); - if (param.equals(TextToSpeech.Engine.TTS_KEY_PARAM_RATE)){ - setSpeechRate("", Integer.parseInt(params.get(i+1))); - } else if (param.equals(TextToSpeech.Engine.TTS_KEY_PARAM_LANGUAGE)){ - language = params.get(i+1); - } else if (param.equals(TextToSpeech.Engine.TTS_KEY_PARAM_COUNTRY)){ - country = params.get(i+1); - } else if (param.equals(TextToSpeech.Engine.TTS_KEY_PARAM_VARIANT)){ - variant = params.get(i+1); + if (param != null){ + if (param.equals(TextToSpeech.Engine.TTS_KEY_PARAM_RATE)){ + setSpeechRate("", Integer.parseInt(params.get(i+1))); + } else if (param.equals(TextToSpeech.Engine.TTS_KEY_PARAM_LANGUAGE)){ + language = params.get(i+1); + } else if (param.equals(TextToSpeech.Engine.TTS_KEY_PARAM_COUNTRY)){ + country = params.get(i+1); + } else if (param.equals(TextToSpeech.Engine.TTS_KEY_PARAM_VARIANT)){ + variant = params.get(i+1); + } } } if (language.length() > 0){ @@ -510,14 +513,16 @@ public class TtsService extends Service implements OnCompletionListener { String variant = ""; for (int i = 0; i < params.size() - 1; i = i + 2){ String param = params.get(i); - if (param.equals(TextToSpeech.Engine.TTS_KEY_PARAM_RATE)){ - setSpeechRate("", Integer.parseInt(params.get(i+1))); - } else if (param.equals(TextToSpeech.Engine.TTS_KEY_PARAM_LANGUAGE)){ - language = params.get(i+1); - } else if (param.equals(TextToSpeech.Engine.TTS_KEY_PARAM_COUNTRY)){ - country = params.get(i+1); - } else if (param.equals(TextToSpeech.Engine.TTS_KEY_PARAM_VARIANT)){ - variant = params.get(i+1); + if (param != null){ + if (param.equals(TextToSpeech.Engine.TTS_KEY_PARAM_RATE)){ + setSpeechRate("", Integer.parseInt(params.get(i+1))); + } else if (param.equals(TextToSpeech.Engine.TTS_KEY_PARAM_LANGUAGE)){ + language = params.get(i+1); + } else if (param.equals(TextToSpeech.Engine.TTS_KEY_PARAM_COUNTRY)){ + country = params.get(i+1); + } else if (param.equals(TextToSpeech.Engine.TTS_KEY_PARAM_VARIANT)){ + variant = params.get(i+1); + } } } if (language.length() > 0){ |