diff options
author | Charles Chen <clchen@google.com> | 2010-03-01 18:52:41 -0800 |
---|---|---|
committer | Charles Chen <clchen@google.com> | 2010-03-01 18:52:41 -0800 |
commit | 6a8b73be572f37b471322e7d49b44c3783633d96 (patch) | |
tree | a5c11a7c81dd8a01e97690ee7614c5c191896f2c /packages | |
parent | 5d3bea6229c2ba71e87c750204662ee71a01c2dd (diff) | |
download | frameworks_base-6a8b73be572f37b471322e7d49b44c3783633d96.zip frameworks_base-6a8b73be572f37b471322e7d49b44c3783633d96.tar.gz frameworks_base-6a8b73be572f37b471322e7d49b44c3783633d96.tar.bz2 |
Fixing a bug with TTS that caused TTS to ignore the default settings
unless the user had set the defaults to always override app settings.
Diffstat (limited to 'packages')
-rwxr-xr-x | packages/TtsService/src/android/tts/TtsService.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/packages/TtsService/src/android/tts/TtsService.java b/packages/TtsService/src/android/tts/TtsService.java index c0e4cc0..7f76425 100755 --- a/packages/TtsService/src/android/tts/TtsService.java +++ b/packages/TtsService/src/android/tts/TtsService.java @@ -206,6 +206,9 @@ public class TtsService extends Service implements OnCompletionListener { private int setEngine(String enginePackageName) { String soFilename = ""; + if (isDefaultEnforced()) { + enginePackageName = getDefaultEngine(); + } // The SVOX TTS is an exception to how the TTS packaging scheme works // because it is part of the system and not a 3rd party add-on; thus // its binary is actually located under /system/lib/ @@ -779,12 +782,19 @@ public class TtsService extends Service implements OnCompletionListener { if (mKillList.get(speechItem) == null) { if (engine.length() > 0) { setEngine(engine); + } else { + setEngine(getDefaultEngine()); } if (language.length() > 0){ setLanguage("", language, country, variant); + } else { + setLanguage("", getDefaultLanguage(), getDefaultCountry(), + getDefaultLocVariant()); } if (speechRate.length() > 0){ setSpeechRate("", Integer.parseInt(speechRate)); + } else { + setSpeechRate("", getDefaultRate()); } try { sNativeSynth.speak(speechItem.mText, streamType); @@ -864,12 +874,19 @@ public class TtsService extends Service implements OnCompletionListener { if (mKillList.get(speechItem) == null){ if (engine.length() > 0) { setEngine(engine); + } else { + setEngine(getDefaultEngine()); } if (language.length() > 0){ setLanguage("", language, country, variant); + } else { + setLanguage("", getDefaultLanguage(), getDefaultCountry(), + getDefaultLocVariant()); } if (speechRate.length() > 0){ setSpeechRate("", Integer.parseInt(speechRate)); + } else { + setSpeechRate("", getDefaultRate()); } try { sNativeSynth.synthesizeToFile(speechItem.mText, speechItem.mFilename); |