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

Commit 50d4a681 authored by Charles Chen's avatar Charles Chen Committed by Android (Google) Code Review
Browse files

Merge "Fixing a problem with the TextToSpeech settings not reflecting the...

Merge "Fixing a problem with the TextToSpeech settings not reflecting the current engine that the user has selected when displaying the list of engines that are available."
parents 9775dc95 be6e8276
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -122,6 +122,8 @@ public class TextToSpeechSettings extends PreferenceActivity implements
        mEnableDemo = false;
        initClickers();
        initDefaultSettings();

        mTts = new TextToSpeech(this, this);
    }


@@ -677,6 +679,14 @@ public class TextToSpeechSettings extends PreferenceActivity implements

        enginesPref.setEntries(entries.toArray(entriesArray));
        enginesPref.setEntryValues(values.toArray(valuesArray));

        // Set the selected engine based on the saved preference
        String selectedEngine = Settings.Secure.getString(getContentResolver(), TTS_DEFAULT_SYNTH);
        int selectedEngineIndex = enginesPref.findIndexOfValue(selectedEngine);
        if (selectedEngineIndex == -1){
            selectedEngineIndex = enginesPref.findIndexOfValue(SYSTEM_TTS);
        }
        enginesPref.setValueIndex(selectedEngineIndex);
    }

}