diff options
author | Narayan Kamath <narayan@google.com> | 2011-11-04 16:12:27 +0000 |
---|---|---|
committer | Narayan Kamath <narayan@google.com> | 2011-11-04 16:48:20 +0000 |
commit | fdd94d87dea6ced2ce30a84f6b8486895bd6855e (patch) | |
tree | 1550873481bf07f0bcb165ff3b4f97318c0dbf10 /src/com/android/settings/tts | |
parent | 8fd5e45052567335529c1db887794ac1404d4e23 (diff) | |
download | packages_apps_settings-fdd94d87dea6ced2ce30a84f6b8486895bd6855e.zip packages_apps_settings-fdd94d87dea6ced2ce30a84f6b8486895bd6855e.tar.gz packages_apps_settings-fdd94d87dea6ced2ce30a84f6b8486895bd6855e.tar.bz2 |
Fix two bug in the TTS settings.
(a) The TTS API doesn't mandate that unavailable voices should
be set and null, so deal with it correctly.
(b) The android manifest contained a reference to the old
TTS class.
bug:5525023
Change-Id: I1c16dbc75893288e5fa221c73a7284fca7ab25c5
Diffstat (limited to 'src/com/android/settings/tts')
-rw-r--r-- | src/com/android/settings/tts/TtsEngineSettingsFragment.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/com/android/settings/tts/TtsEngineSettingsFragment.java b/src/com/android/settings/tts/TtsEngineSettingsFragment.java index 1d7b519..3f740d7 100644 --- a/src/com/android/settings/tts/TtsEngineSettingsFragment.java +++ b/src/com/android/settings/tts/TtsEngineSettingsFragment.java @@ -95,12 +95,15 @@ public class TtsEngineSettingsFragment extends SettingsPreferenceFragment implem ArrayList<String> unavailable = voiceDataDetails.getStringArrayListExtra( TextToSpeech.Engine.EXTRA_UNAVAILABLE_VOICES); - if (available == null || unavailable == null){ + if (available == null){ Log.e(TAG, "TTS data check failed (available == null)."); + final CharSequence[] empty = new CharSequence[0]; + mLocalePreference.setEntries(empty); + mLocalePreference.setEntryValues(empty); return; } - if (unavailable.size() > 0) { + if (unavailable != null && unavailable.size() > 0) { mInstallVoicesPreference.setEnabled(true); getPreferenceScreen().addPreference(mInstallVoicesPreference); } else { |