fix spellchecker crash when keyboard has never been initialized, fixes #684

This commit is contained in:
Helium314 2024-04-15 22:59:33 +02:00
parent 87f1092eac
commit 382bdb6ff6
2 changed files with 9 additions and 5 deletions

View file

@ -100,6 +100,7 @@ public final class InputAttributes {
final boolean noMicrophone = mIsPasswordField
|| InputTypeUtils.isEmailVariation(variation)
|| hasNoMicrophoneKeyOption()
|| !RichInputMethodManager.isInitialized() // avoid crash when only using spell checker
|| !RichInputMethodManager.getInstance().hasShortcutIme();
mShouldShowVoiceInputKey = !noMicrophone;