I am using Android TextToSpeech class. Everything is working fine. However, there are languages / locales that are not installed by default, but are supported by the TTS mechanism, and I cannot fix the state of the missing speech data.
When connected to the Internet, when I try to set the language to a new locale that its speech data has not been downloaded, it will just download the voice data and execute the conversation method normally / successfully.
However, when I turn off the Internet, when I try to install LanguageLanguage in a new locale that its voice data has not been downloaded, it tries to download voice data. But without the Internet, it simply indicates a “download” on the “TTS voice data” settings screen in the “Language and input” section for the selected language, without any success. And, as expected, the conversation method does not work because voice data is not loading. When this happens, I think the TTS setLanguage / isLanguageAvailable methods will return LANG_MISSING_DATA to me to capture this state, however it just returns LANG_COUNTRY_AVAILABLE. The situation is shown in this image: 
I want to be able to detect when the speech data of the selected locale is not loaded / missing, and also give a toast message or direct user to download it. I have seen several posts suggesting using isLanguageAvailable, like this one . I also looked at the Android documentation and it seems that the returned isLanguageAvailable values should fix the state of the missing voice data using LANG_MISSING_DATA.
I also tried sending the intent with ACTION_CHECK_TTS_DATA, as another way to check for missing data, as suggested in the Android documentation that I linked. However, resultCode again did not commit / indicate that there is no voice data (CHECK_VOICE_DATA_FAIL), but CHECK_VOICE_DATA_PASS is returned instead.
In this case, how should I display the language / locale status, available / supported, in the absence of voice data? I am also wondering why CHECK_VOICE_DATA_PASS and LANG_MISSING_DATA are not return values. When no voice data is available, should these values be returned? Thank you The following is the return value when I try to use setLanguage and isLanguageAvailable on locales that haven’t downloaded its voice data (0 and 1 is the return value of the method shown in the logs, -1 is the one that corresponds to the missing voice data): 
android android-intent text-to-speech
Charles Li
source share