diff options
author | Narayan Kamath <narayan@google.com> | 2011-09-13 14:38:20 +0100 |
---|---|---|
committer | Narayan Kamath <narayan@google.com> | 2011-09-13 14:38:20 +0100 |
commit | 52b2745e8532a209b2925c5240e63e2da7bad237 (patch) | |
tree | f69c10c30fb126b73d3bbb528d8cc498be9351a3 /src/com/android/settings/tts | |
parent | 88b75f740a1c75040bd7339e5ef9d5abdb50014d (diff) | |
download | packages_apps_settings-52b2745e8532a209b2925c5240e63e2da7bad237.zip packages_apps_settings-52b2745e8532a209b2925c5240e63e2da7bad237.tar.gz packages_apps_settings-52b2745e8532a209b2925c5240e63e2da7bad237.tar.bz2 |
Remove some unnecessary setLanguage() calls.
This prevents QUEUE_FLUSH from working as intented since
there is a (blocking) setLanguage() call that waits for
the previous synthesis to complete before flushing the queue.
bug:5288327
Change-Id: I00467f0ac1584863ae27bfc076b8413e29e5379b
Diffstat (limited to 'src/com/android/settings/tts')
-rw-r--r-- | src/com/android/settings/tts/TextToSpeechSettings.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/com/android/settings/tts/TextToSpeechSettings.java b/src/com/android/settings/tts/TextToSpeechSettings.java index e8255bf..517eade 100644 --- a/src/com/android/settings/tts/TextToSpeechSettings.java +++ b/src/com/android/settings/tts/TextToSpeechSettings.java @@ -198,9 +198,13 @@ public class TextToSpeechSettings extends SettingsPreferenceFragment implements currentEngine); if (localeString != null) { final String[] locale = TtsEngines.parseLocalePref(localeString); + final Locale newLocale = new Locale(locale[0], locale[1], locale[2]); + final Locale engineLocale = mTts.getLanguage(); - if (DBG) Log.d(TAG, "Loading language ahead of sample check : " + locale); - mTts.setLanguage(new Locale(locale[0], locale[1], locale[2])); + if (!newLocale.equals(engineLocale)) { + if (DBG) Log.d(TAG, "Loading language ahead of sample check : " + locale); + mTts.setLanguage(newLocale); + } } } } |