Loading core/java/android/speech/tts/TextToSpeech.java +9 −1 Original line number Diff line number Diff line Loading @@ -993,8 +993,16 @@ public class TextToSpeech { return runAction(new Action<Set<String>>() { @Override public Set<String> run(ITextToSpeechService service) throws RemoteException { String[] features = service.getFeaturesForLanguage( String[] features = null; try { features = service.getFeaturesForLanguage( locale.getISO3Language(), locale.getISO3Country(), locale.getVariant()); } catch(MissingResourceException e) { Log.w(TAG, "Couldn't retrieve 3 letter ISO 639-2/T language and/or ISO 3166 " + "country code for locale: " + locale, e); return null; } if (features != null) { final Set<String> featureSet = new HashSet<String>(); Collections.addAll(featureSet, features); Loading core/java/android/speech/tts/TtsEngines.java +26 −19 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ import java.util.Collections; import java.util.Comparator; import java.util.List; import java.util.Locale; import java.util.MissingResourceException; /** * Support class for querying the list of available engines Loading Loading @@ -369,6 +370,7 @@ public class TtsEngines { public String getDefaultLocale() { final Locale locale = Locale.getDefault(); try { // Note that the default locale might have an empty variant // or language, and we take care that the construction is // the same as {@link #getV1Locale} i.e no trailing delimiters Loading @@ -391,6 +393,11 @@ public class TtsEngines { } return defaultLocale; } catch (MissingResourceException e) { // Default locale does not have a ISO 3166 and/or ISO 639-2/T codes. Return the // default "eng-usa" (that would be the result of Locale.getDefault() == Locale.US). return "eng-usa"; } } /** Loading Loading
core/java/android/speech/tts/TextToSpeech.java +9 −1 Original line number Diff line number Diff line Loading @@ -993,8 +993,16 @@ public class TextToSpeech { return runAction(new Action<Set<String>>() { @Override public Set<String> run(ITextToSpeechService service) throws RemoteException { String[] features = service.getFeaturesForLanguage( String[] features = null; try { features = service.getFeaturesForLanguage( locale.getISO3Language(), locale.getISO3Country(), locale.getVariant()); } catch(MissingResourceException e) { Log.w(TAG, "Couldn't retrieve 3 letter ISO 639-2/T language and/or ISO 3166 " + "country code for locale: " + locale, e); return null; } if (features != null) { final Set<String> featureSet = new HashSet<String>(); Collections.addAll(featureSet, features); Loading
core/java/android/speech/tts/TtsEngines.java +26 −19 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ import java.util.Collections; import java.util.Comparator; import java.util.List; import java.util.Locale; import java.util.MissingResourceException; /** * Support class for querying the list of available engines Loading Loading @@ -369,6 +370,7 @@ public class TtsEngines { public String getDefaultLocale() { final Locale locale = Locale.getDefault(); try { // Note that the default locale might have an empty variant // or language, and we take care that the construction is // the same as {@link #getV1Locale} i.e no trailing delimiters Loading @@ -391,6 +393,11 @@ public class TtsEngines { } return defaultLocale; } catch (MissingResourceException e) { // Default locale does not have a ISO 3166 and/or ISO 639-2/T codes. Return the // default "eng-usa" (that would be the result of Locale.getDefault() == Locale.US). return "eng-usa"; } } /** Loading