Commit ad912061 authored by Dominic Mazzoni's avatar Dominic Mazzoni Committed by Commit Bot

Work around crash in Google TTS by skipping "bn" language

Bug: 792856
Change-Id: Ifad7c7e68a9b7126e1f0fec600edbbf8598305fc
Reviewed-on: https://chromium-review.googlesource.com/822695
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
Reviewed-by: default avatarYaron Friedman <yfriedman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#523481}
parent 362c2549
...@@ -279,6 +279,7 @@ class TtsPlatformImpl { ...@@ -279,6 +279,7 @@ class TtsPlatformImpl {
mVoices = new ArrayList<TtsVoice>(); mVoices = new ArrayList<TtsVoice>();
for (int i = 0; i < locales.length; ++i) { for (int i = 0; i < locales.length; ++i) {
if (!locales[i].getVariant().isEmpty()) continue; if (!locales[i].getVariant().isEmpty()) continue;
try { try {
if (mTextToSpeech.isLanguageAvailable(locales[i]) > 0) { if (mTextToSpeech.isLanguageAvailable(locales[i]) > 0) {
String name = locales[i].getDisplayLanguage(); String name = locales[i].getDisplayLanguage();
...@@ -288,8 +289,13 @@ class TtsPlatformImpl { ...@@ -288,8 +289,13 @@ class TtsPlatformImpl {
TtsVoice voice = new TtsVoice(name, locales[i].toString()); TtsVoice voice = new TtsVoice(name, locales[i].toString());
mVoices.add(voice); mVoices.add(voice);
} }
} catch (java.util.MissingResourceException e) { } catch (Exception e) {
// Just skip the locale if it's invalid. // Just skip the locale if it's invalid.
//
// We used to catch only java.util.MissingResourceException,
// but we need to catch more exceptions to work around a bug
// in Google TTS when we query "bn".
// http://crbug.com/792856
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment