am 7865507c: am ab6552c3: Make sure the TTS example in the TTS Settings loads a supported language. This fixes the issue where the example wouldn\'t play when the UI is in Japanese in bug 2088099.

Merge commit '7865507c978fe104deecc702f392d3ff085ff132'

* commit '7865507c978fe104deecc702f392d3ff085ff132':
  Make sure the TTS example in the TTS Settings loads a supported language.
This commit is contained in:
Jean-Michel Trivi
2009-09-01 16:18:54 -07:00
committed by Android Git Automerger

View File

@@ -265,6 +265,12 @@ public class TextToSpeechSettings extends PreferenceActivity implements
if (status == TextToSpeech.SUCCESS) {
Log.v(TAG, "TTS engine for settings screen initialized.");
mEnableDemo = true;
// check to see if the current locale is supported
if (mTts.isLanguageAvailable(Locale.getDefault()) == TextToSpeech.LANG_NOT_SUPPORTED) {
mTts.setLanguage(Locale.US);
} else {
mTts.setLanguage(Locale.getDefault());
}
} else {
Log.v(TAG, "TTS engine for settings screen failed to initialize successfully.");
mEnableDemo = false;
@@ -282,7 +288,6 @@ 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");