mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-10-31 05:35:35 +00:00
Revert the updating of the language when the system language changes.
This commit is contained in:
@@ -66,7 +66,6 @@ public class TtsService extends TextToSpeechService {
|
||||
private Voice mMatchingVoice = null;
|
||||
|
||||
private BroadcastReceiver mOnLanguagesDownloaded = null;
|
||||
private BroadcastReceiver mOnSystemLocaleChanged = null;
|
||||
|
||||
private String mLanguage = DEFAULT_LANGUAGE;
|
||||
private String mCountry = DEFAULT_COUNTRY;
|
||||
@@ -76,18 +75,6 @@ public class TtsService extends TextToSpeechService {
|
||||
public void onCreate() {
|
||||
initializeTtsEngine();
|
||||
super.onCreate();
|
||||
|
||||
mOnSystemLocaleChanged = new BroadcastReceiver() {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
Locale locale = Locale.getDefault();
|
||||
int ret = onLoadLanguage(locale.getISO3Language(), locale.getISO3Country(), locale.getVariant());
|
||||
Log.i("LocaleChange", "Locale = " + locale + "; status = " + ret);
|
||||
}
|
||||
};
|
||||
|
||||
final IntentFilter filter = new IntentFilter(Intent.ACTION_LOCALE_CHANGED);
|
||||
registerReceiver(mOnSystemLocaleChanged, filter);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -96,9 +83,6 @@ public class TtsService extends TextToSpeechService {
|
||||
if (mOnLanguagesDownloaded != null) {
|
||||
unregisterReceiver(mOnLanguagesDownloaded);
|
||||
}
|
||||
if (mOnSystemLocaleChanged != null) {
|
||||
unregisterReceiver(mOnSystemLocaleChanged);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user