diff options
author | Jean-Michel Trivi <jmtrivi@google.com> | 2010-02-17 12:50:44 -0800 |
---|---|---|
committer | Jean-Michel Trivi <jmtrivi@google.com> | 2010-02-17 12:50:44 -0800 |
commit | 7330a88b79eef060486623989ccdc1dcc291e014 (patch) | |
tree | b7e69762e3426a426a2f0296db022ce47ad0f2d6 /src/com/android/settings/TextToSpeechSettings.java | |
parent | 76ddcecd0d300d781ed8b3af4457a68ecbe98144 (diff) | |
download | packages_apps_Settings-7330a88b79eef060486623989ccdc1dcc291e014.zip packages_apps_Settings-7330a88b79eef060486623989ccdc1dcc291e014.tar.gz packages_apps_Settings-7330a88b79eef060486623989ccdc1dcc291e014.tar.bz2 |
Fix bug 2446811 Ensure the default locale is never constructed
with a null string.
Diffstat (limited to 'src/com/android/settings/TextToSpeechSettings.java')
-rw-r--r-- | src/com/android/settings/TextToSpeechSettings.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/com/android/settings/TextToSpeechSettings.java b/src/com/android/settings/TextToSpeechSettings.java index 86f9919..3c55d10 100644 --- a/src/com/android/settings/TextToSpeechSettings.java +++ b/src/com/android/settings/TextToSpeechSettings.java @@ -265,9 +265,15 @@ public class TextToSpeechSettings extends PreferenceActivity implements if (status == TextToSpeech.SUCCESS) { Log.v(TAG, "TTS engine for settings screen initialized."); mEnableDemo = true; - if (mDefaultLanguage == null){ + if (mDefaultLanguage == null) { mDefaultLanguage = Locale.getDefault().getISO3Language(); } + if (mDefaultCountry == null) { + mDefaultCountry = Locale.getDefault().getISO3Country(); + } + if (mDefaultLocVariant == null) { + mDefaultLocVariant = new String(); + } mTts.setLanguage(new Locale(mDefaultLanguage, mDefaultCountry, mDefaultLocVariant)); mTts.setSpeechRate((float)(mDefaultRate/100.0f)); } else { |