mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-06-02 12:52:15 +00:00
avoid accessing uninitialized RichInputMethodManager, fixes #952
This commit is contained in:
parent
e5b82b53c4
commit
9f37c5505c
2 changed files with 5 additions and 4 deletions
|
@ -360,10 +360,11 @@ public class RichInputMethodManager {
|
|||
mCurrentRichInputMethodSubtype = RichInputMethodSubtype.getRichInputMethodSubtype(subtype);
|
||||
}
|
||||
|
||||
public boolean canSwitchLanguage() {
|
||||
if (Settings.getInstance().getCurrent().mLanguageSwitchKeyToOtherSubtypes && hasMultipleEnabledSubtypesInThisIme(false))
|
||||
public static boolean canSwitchLanguage() {
|
||||
if (!isInitialized()) return false;
|
||||
if (Settings.getInstance().getCurrent().mLanguageSwitchKeyToOtherSubtypes && getInstance().hasMultipleEnabledSubtypesInThisIme(false))
|
||||
return true;
|
||||
if (Settings.getInstance().getCurrent().mLanguageSwitchKeyToOtherImes && mImm.getEnabledInputMethodList().size() > 1)
|
||||
if (Settings.getInstance().getCurrent().mLanguageSwitchKeyToOtherImes && getInstance().mImm.getEnabledInputMethodList().size() > 1)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue