Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0e01f128 authored by Przemyslaw Szczepaniak's avatar Przemyslaw Szczepaniak
Browse files

Fix for TTS settings crash.

Play an example is wrongly enabled before TTS engine is initialized.

Bug: 10288565
Change-Id: I9204d8dda7f8de5c67aba2bb73b25589eeac5cef
parent 0782e629
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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);
    }