summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/tts
diff options
context:
space:
mode:
authorPrzemyslaw Szczepaniak <pszczepaniak@google.com>2013-08-13 13:05:48 +0100
committerPrzemyslaw Szczepaniak <pszczepaniak@google.com>2013-08-13 13:05:48 +0100
commit0e01f128ab8a8525a4d3fd72980e468f4de1e56c (patch)
treeeaff1c0cc66ecb107397ccd4706e80fc48db34b9 /src/com/android/settings/tts
parent0782e6293bec6f51e5ecd23525f945823e5b4632 (diff)
downloadpackages_apps_Settings-0e01f128ab8a8525a4d3fd72980e468f4de1e56c.zip
packages_apps_Settings-0e01f128ab8a8525a4d3fd72980e468f4de1e56c.tar.gz
packages_apps_Settings-0e01f128ab8a8525a4d3fd72980e468f4de1e56c.tar.bz2
Fix for TTS settings crash.
Play an example is wrongly enabled before TTS engine is initialized. Bug: 10288565 Change-Id: I9204d8dda7f8de5c67aba2bb73b25589eeac5cef
Diffstat (limited to 'src/com/android/settings/tts')
-rw-r--r--src/com/android/settings/tts/TextToSpeechSettings.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/com/android/settings/tts/TextToSpeechSettings.java b/src/com/android/settings/tts/TextToSpeechSettings.java
index fa48a3f..c697661 100644
--- a/src/com/android/settings/tts/TextToSpeechSettings.java
+++ b/src/com/android/settings/tts/TextToSpeechSettings.java
@@ -140,6 +140,7 @@ public class TextToSpeechSettings extends SettingsPreferenceFragment implements
mPlayExample = findPreference(KEY_PLAY_EXAMPLE);
mPlayExample.setOnPreferenceClickListener(this);
+ mPlayExample.setEnabled(false);
mEnginePreferenceCategory = (PreferenceCategory) findPreference(
KEY_ENGINE_PREFERENCE_SECTION);
@@ -363,6 +364,9 @@ public class TextToSpeechSettings extends SettingsPreferenceFragment implements
private boolean isNetworkRequiredForSynthesis() {
Set<String> features = mTts.getFeatures(mCurrentDefaultLocale);
+ if (features == null) {
+ return false;
+ }
return features.contains(TextToSpeech.Engine.KEY_FEATURE_NETWORK_SYNTHESIS) &&
!features.contains(TextToSpeech.Engine.KEY_FEATURE_EMBEDDED_SYNTHESIS);
}