Merge "Fix two bug in the TTS settings." into ics-mr1

This commit is contained in:
Narayan Kamath
2011-11-07 02:26:29 -08:00
committed by Android (Google) Code Review
2 changed files with 6 additions and 3 deletions

View File

@@ -717,7 +717,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 {