diff options
author | Jean-Michel Trivi <jmtrivi@google.com> | 2009-07-17 16:52:54 -0700 |
---|---|---|
committer | Jean-Michel Trivi <jmtrivi@google.com> | 2009-07-17 16:52:54 -0700 |
commit | 628431de91689b62a19e5fde0ed3b546bba7da74 (patch) | |
tree | cc4e97898bf2e3398582a210b587b66c894ae44c /src/com/android/settings/TextToSpeechSettings.java | |
parent | 6b1b36a832943126d19a21dcadda11cc75c3a9b6 (diff) | |
download | packages_apps_Settings-628431de91689b62a19e5fde0ed3b546bba7da74.zip packages_apps_Settings-628431de91689b62a19e5fde0ed3b546bba7da74.tar.gz packages_apps_Settings-628431de91689b62a19e5fde0ed3b546bba7da74.tar.bz2 |
Fix bug 1956707 in which setting the default language has no effect.
Use the current Locale upon initialization of the TTS engine.
Retrieve the default engine value from the TextToSpeech.Engine class
instead of a hard-coded value in TextToSpeechSettings.
Diffstat (limited to 'src/com/android/settings/TextToSpeechSettings.java')
-rw-r--r-- | src/com/android/settings/TextToSpeechSettings.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/com/android/settings/TextToSpeechSettings.java b/src/com/android/settings/TextToSpeechSettings.java index 88bfc67..789368a 100644 --- a/src/com/android/settings/TextToSpeechSettings.java +++ b/src/com/android/settings/TextToSpeechSettings.java @@ -58,8 +58,8 @@ public class TextToSpeechSettings extends PreferenceActivity implements private static final String LOCALE_DELIMITER = "-"; - // TODO move this to android.speech.tts.TextToSpeech.Engine - private static final String FALLBACK_TTS_DEFAULT_SYNTH = "com.svox.pico"; + private static final String FALLBACK_TTS_DEFAULT_SYNTH = + TextToSpeech.Engine.FALLBACK_TTS_DEFAULT_SYNTH; private Preference mPlayExample = null; private Preference mInstallData = null; @@ -280,6 +280,7 @@ public class TextToSpeechSettings extends PreferenceActivity implements Log.v(TAG, "Voice data check passed"); if (mTts == null) { mTts = new TextToSpeech(this, this); + mTts.setLanguage(Locale.getDefault()); } } else { Log.v(TAG, "Voice data check failed"); @@ -319,6 +320,9 @@ public class TextToSpeechSettings extends PreferenceActivity implements Settings.Secure.putString(resolver, TTS_DEFAULT_VARIANT, mDefaultLocVariant); Log.v(TAG, "TTS default lang/country/variant set to " + mDefaultLanguage + "/" + mDefaultCountry + "/" + mDefaultLocVariant); + if (mTts != null) { + mTts.setLanguage(new Locale(mDefaultLanguage, mDefaultCountry)); + } } return true; |