Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature multi locale #586

Draft
wants to merge 19 commits into
base: master
Choose a base branch
from
Draft

Feature multi locale #586

wants to merge 19 commits into from

Conversation

MajeurAndroid
Copy link
Member

No description provided.

Helium314 and others added 19 commits March 12, 2022 17:03
revert switch between main and secondary locale
tune suggestion weights for each locale based on mConfidence
more preparations for making secondary dictionary selectable
isValidSpellingWord now uses both dictionaries (called only by spell checker)
Fix crash when getting available dictionaries
Update feature-multi-locale
@Helium314
Copy link
Contributor

When restarting my phone, I get the following crash:

AndroidRuntime: FATAL EXCEPTION: main
AndroidRuntime: Process: org.dslul.openboard.inputmethod.latin, PID: 880
AndroidRuntime: java.lang.RuntimeException: Unable to create service org.dslul.openboard.inputmethod.latin.LatinIME: java.lang.IllegalStateException: SharedPreferences in credential encrypted storage are not available until after user is unlocked
AndroidRuntime: 	at android.app.ActivityThread.handleCreateService(ActivityThread.java:3582)
AndroidRuntime: 	at android.app.ActivityThread.access$1300(ActivityThread.java:200)
AndroidRuntime: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1672)
AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:106)
AndroidRuntime: 	at android.os.Looper.loop(Looper.java:193)
AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:6718)
AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:491)
AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
AndroidRuntime: Caused by: java.lang.IllegalStateException: SharedPreferences in credential encrypted storage are not available until after user is unlocked
AndroidRuntime: 	at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:419)
AndroidRuntime: 	at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:404)
AndroidRuntime: 	at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:174)
AndroidRuntime: 	at org.dslul.openboard.inputmethod.latin.BinaryDictionaryGetter$DictPackSettings.<init>(BinaryDictionaryGetter.java:120)
AndroidRuntime: 	at org.dslul.openboard.inputmethod.latin.BinaryDictionaryGetter.getDictionaryFiles(BinaryDictionaryGetter.java:246)
AndroidRuntime: 	at org.dslul.openboard.inputmethod.latin.DictionaryFactory.createMainDictionaryFromManager(DictionaryFactory.java:56)
AndroidRuntime: 	at org.dslul.openboard.inputmethod.latin.DictionaryFacilitatorImpl.resetDictionaries(DictionaryFacilitatorImpl.java:426)
AndroidRuntime: 	at org.dslul.openboard.inputmethod.latin.LatinIME.resetDictionaryFacilitator(LatinIME.java:739)
AndroidRuntime: 	at org.dslul.openboard.inputmethod.latin.LatinIME.loadSettings(LatinIME.java:681)
AndroidRuntime: 	at org.dslul.openboard.inputmethod.latin.LatinIME.onCreate(LatinIME.java:632)
AndroidRuntime: 	at android.app.ActivityThread.handleCreateService(ActivityThread.java:3570)
AndroidRuntime: 	... 8 more

The crash does not happen on my test phone, or if I have secondary locale set to none (secondary dictionary is loaded in DictionaryFacilitatorImpl.java:426).

I don't really understand what is going on, as DictionaryFactory.createMainDictionaryFromManager seems to work for the main dictionary (started in DictionaryFacilitatorImpl.java:408)

@NoahAndrews
Copy link

Sounds like there's some new code that isn't compatible with Direct Boot. See this PR: #346

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants