系统层修改:
1.frameworks/base/packages/SettingsProvider/res/values/defaults.xml
<string name="def_tts"></string>
2.frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
loadStringSetting(stmt, Settings.Secure.TTS_DEFAULT_SYNTH,R.string.def_tts);
3.vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/tts/TextToSpeechSettings.java
private void checkDefaultLocale() {Locale defaultLocale = mTts.getDefaultLanguage();if (defaultLocale == null) {Log.e(TAG, "Failed to get default language from engine " + mCurrentEngine);updateWidgetState(false);return;//Log.e(TAG, "Failed to get default language from engine " + mCurrentEngine);//updateWidgetState(false);//return;defaultLocale =Locale.getDefault();}// ISO-3166 alpha 3 country codes are out of spec. If we won't normalize,}mLocalePreference.setSummary(mLocalePreference.getEntries()[selectedLocaleIndex]);mSelectedLocaleIndex = selectedLocaleIndex;if(mTts==null){final TextToSpeechViewModel ttsViewModel =ViewModelProviders.of(this).get(TextToSpeechViewModel.class);final Pair<TextToSpeech, Boolean> ttsAndNew = ttsViewModel.getTtsAndWhetherNew(mInitListener);mTts = ttsAndNew.first;}
更多了解请连续作者!