TtsService.java: also report TextToSpeech.LANG_MISSING_DATA if the base resources are not found or the data can be upgraded.

This commit is contained in:
Reece H. Dunn
2013-02-11 01:00:06 +00:00
parent 1e52512637
commit 9d0a23bb1c
@@ -114,15 +114,13 @@ public class TtsService extends TextToSpeechService {
@Override
protected int onIsLanguageAvailable(String language, String country, String variant) {
if (!mEngineInitialized) {
Context context = getApplicationContext();
if (!mEngineInitialized ||
!CheckVoiceData.hasBaseResources(context) ||
CheckVoiceData.canUpgradeResources(context)) {
return TextToSpeech.LANG_MISSING_DATA;
}
if (mAvailableVoices == null) {
Log.e(TAG, "Attempted to check language availability before loading voices!");
return TextToSpeech.LANG_NOT_SUPPORTED;
}
final Locale query = new Locale(language, country, variant);
Voice languageVoice = null;