Merge "Fix two bug in the TTS settings." into ics-mr1
This commit is contained in:
committed by
Android (Google) Code Review
commit
8214d201db
@@ -717,7 +717,7 @@
|
|||||||
<category android:name="android.intent.category.DEFAULT" />
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
<meta-data android:name="com.android.settings.FRAGMENT_CLASS"
|
<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"
|
<meta-data android:name="com.android.settings.TOP_LEVEL_HEADER_ID"
|
||||||
android:resource="@id/language_settings" />
|
android:resource="@id/language_settings" />
|
||||||
</activity>
|
</activity>
|
||||||
|
@@ -95,12 +95,15 @@ public class TtsEngineSettingsFragment extends SettingsPreferenceFragment implem
|
|||||||
ArrayList<String> unavailable = voiceDataDetails.getStringArrayListExtra(
|
ArrayList<String> unavailable = voiceDataDetails.getStringArrayListExtra(
|
||||||
TextToSpeech.Engine.EXTRA_UNAVAILABLE_VOICES);
|
TextToSpeech.Engine.EXTRA_UNAVAILABLE_VOICES);
|
||||||
|
|
||||||
if (available == null || unavailable == null){
|
if (available == null){
|
||||||
Log.e(TAG, "TTS data check failed (available == null).");
|
Log.e(TAG, "TTS data check failed (available == null).");
|
||||||
|
final CharSequence[] empty = new CharSequence[0];
|
||||||
|
mLocalePreference.setEntries(empty);
|
||||||
|
mLocalePreference.setEntryValues(empty);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (unavailable.size() > 0) {
|
if (unavailable != null && unavailable.size() > 0) {
|
||||||
mInstallVoicesPreference.setEnabled(true);
|
mInstallVoicesPreference.setEnabled(true);
|
||||||
getPreferenceScreen().addPreference(mInstallVoicesPreference);
|
getPreferenceScreen().addPreference(mInstallVoicesPreference);
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user