do some inits on app create instead of in the services

This commit is contained in:
Helium314 2025-02-19 23:33:51 +01:00
parent 0899245ae7
commit 35083e6515
8 changed files with 21 additions and 50 deletions

View file

@ -85,7 +85,6 @@ public final class AndroidSpellCheckerService extends SpellCheckerService
onSharedPreferenceChanged(prefs, Settings.PREF_USE_CONTACTS);
final boolean blockOffensive = prefs.getBoolean(Settings.PREF_BLOCK_POTENTIALLY_OFFENSIVE, Defaults.PREF_BLOCK_POTENTIALLY_OFFENSIVE);
mSettingsValuesForSuggestion = new SettingsValuesForSuggestion(blockOffensive, false);
SubtypeSettings.INSTANCE.init(this);
}
public float getRecommendedThreshold() {
@ -194,7 +193,6 @@ public final class AndroidSpellCheckerService extends SpellCheckerService
// creating a keyboard reads SettingsValues from Settings instance
// maybe it would be "more correct" to create an instance of SettingsValues and use that one instead
// but creating a global one if not existing should be fine too
Settings.init(this);
final EditorInfo editorInfo = new EditorInfo();
editorInfo.inputType = InputType.TYPE_CLASS_TEXT;
Settings.getInstance().loadSettings(this, locale, new InputAttributes(editorInfo, false, getPackageName()));