| @Override | @Override | ||||
| protected int onIsLanguageAvailable(String language, String country, String variant) { | 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; | 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); | final Locale query = new Locale(language, country, variant); | ||||
| Voice languageVoice = null; | Voice languageVoice = null; |