TextToSpeech: test and fix onIsValidVoiceName

This commit is contained in:
Reece H. Dunn
2014-10-29 19:50:43 +00:00
parent daa9326eb2
commit c9003c50ba
2 changed files with 53 additions and 1 deletions
@@ -217,7 +217,12 @@ public class TtsService extends TextToSpeechService {
@Override
public int onIsValidVoiceName(String name) {
return super.onIsValidVoiceName(name);
for (Voice voice : mAvailableVoices) {
if (voice.name.equals(name)) {
return TextToSpeech.SUCCESS;
}
}
return TextToSpeech.ERROR;
}
@Override