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:
@@ -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>
|
||||
|
@@ -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 {
|
||||
|
Reference in New Issue
Block a user