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
This commit is contained in:
Narayan Kamath
2011-11-04 16:12:27 +00:00
parent 8fd5e45052
commit fdd94d87de
2 changed files with 6 additions and 3 deletions

View File

@@ -716,7 +716,7 @@
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data android:name="com.android.settings.FRAGMENT_CLASS"
android:value="com.android.settings.TextToSpeechSettings" />
android:value="com.android.settings.tts.TextToSpeechSettings" />
<meta-data android:name="com.android.settings.TOP_LEVEL_HEADER_ID"
android:resource="@id/language_settings" />
</activity>

View File

@@ -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 {