Skip to content

Commit 6c07a20

Browse files
committed
Fix a bug in the network TTS api.
bug:5284966 Change-Id: I460bd12c27671ed42681fd4ccad567c08cb8f70f
1 parent 6581043 commit 6c07a20

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

core/java/android/speech/tts/TextToSpeech.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,6 +1089,7 @@ private Bundle getParams(HashMap<String, String> params) {
10891089

10901090
// Copy feature strings defined by the framework.
10911091
copyStringParam(bundle, params, Engine.KEY_FEATURE_NETWORK_SYNTHESIS);
1092+
copyStringParam(bundle, params, Engine.KEY_FEATURE_EMBEDDED_SYNTHESIS);
10921093

10931094
// Copy over all parameters that start with the name of the
10941095
// engine that we are currently connected to. The engine is

core/java/android/speech/tts/TextToSpeechService.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -792,8 +792,13 @@ public int isLanguageAvailable(String lang, String country, String variant) {
792792

793793
public String[] getFeaturesForLanguage(String lang, String country, String variant) {
794794
Set<String> features = onGetFeaturesForLanguage(lang, country, variant);
795-
String[] featuresArray = new String[features.size()];
796-
features.toArray(featuresArray);
795+
String[] featuresArray = null;
796+
if (features != null) {
797+
featuresArray = new String[features.size()];
798+
features.toArray(featuresArray);
799+
} else {
800+
featuresArray = new String[0];
801+
}
797802
return featuresArray;
798803
}
799804

0 commit comments

Comments
 (0)