summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/tts
diff options
context:
space:
mode:
authorPrzemyslaw Szczepaniak <pszczepaniak@google.com>2014-06-19 16:01:39 +0100
committerPrzemyslaw Szczepaniak <pszczepaniak@google.com>2014-06-19 15:50:50 +0000
commit6ac8ddb8983a4abdf37214c86394033d6bc79235 (patch)
tree605aa82dd76b46320a8aba5214e56a1321fc7c47 /src/com/android/settings/tts
parentee18fdbec8bb640b386f38edb11dbf4122d57455 (diff)
downloadpackages_apps_Settings-6ac8ddb8983a4abdf37214c86394033d6bc79235.zip
packages_apps_Settings-6ac8ddb8983a4abdf37214c86394033d6bc79235.tar.gz
packages_apps_Settings-6ac8ddb8983a4abdf37214c86394033d6bc79235.tar.bz2
Normalize TTS default locale before #toDisplayString
TTS is... special in regard of Locale instances it uses. Recently ISO-3166 alpha 3 country codes went out of spec, so "English (GBR)". Bug: 15741357 Change-Id: I022105acad9d319d5e09231be340405d797c84c4
Diffstat (limited to 'src/com/android/settings/tts')
-rw-r--r--src/com/android/settings/tts/TextToSpeechSettings.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/com/android/settings/tts/TextToSpeechSettings.java b/src/com/android/settings/tts/TextToSpeechSettings.java
index d3f9c7b..8417cfd 100644
--- a/src/com/android/settings/tts/TextToSpeechSettings.java
+++ b/src/com/android/settings/tts/TextToSpeechSettings.java
@@ -268,7 +268,9 @@ public class TextToSpeechSettings extends SettingsPreferenceFragment implements
return;
}
- mCurrentDefaultLocale = defaultLocale;
+ // ISO-3166 alpha 3 country codes are out of spec. If we won't normalize,
+ // we may end up with English (USA)and German (DEU).
+ mCurrentDefaultLocale = mEnginesHelper.parseLocaleString(defaultLocale.toString());
int defaultAvailable = mTts.setLanguage(defaultLocale);
if (evaluateDefaultLocale()) {