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

Commit f96fb705 authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change 6432 into donut

* changes:
  In the TTS settings: rely on the default locale rather than default values stored in TextToSpeech.Engine to initialize the default TTS country and variant.
parents eb72bcd6 00d4fbfc
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -191,8 +191,9 @@ public class TextToSpeechSettings extends PreferenceActivity implements
            country = Settings.Secure.getString(resolver, KEY_TTS_DEFAULT_COUNTRY);
            if (country == null) {
                // default country setting not found, initialize it, as well as the variant;
                country  = TextToSpeech.Engine.FALLBACK_TTS_DEFAULT_COUNTRY;
                variant  = TextToSpeech.Engine.FALLBACK_TTS_DEFAULT_VARIANT;
                Locale currentLocale = Locale.getDefault();
                country = currentLocale.getISO3Country();
                variant = currentLocale.getVariant();
                Settings.Secure.putString(resolver, TTS_DEFAULT_COUNTRY, country);
                Settings.Secure.putString(resolver, TTS_DEFAULT_VARIANT, variant);
            }
@@ -203,7 +204,8 @@ public class TextToSpeechSettings extends PreferenceActivity implements
            variant = Settings.Secure.getString(resolver, KEY_TTS_DEFAULT_VARIANT);
            if (variant == null) {
                // default variant setting not found, initialize it
                variant = TextToSpeech.Engine.FALLBACK_TTS_DEFAULT_VARIANT;
                Locale currentLocale = Locale.getDefault();
                variant = currentLocale.getVariant();
                Settings.Secure.putString(resolver, TTS_DEFAULT_VARIANT, variant);
            }
        }