mirror of
https://github.com/Julow/Unexpected-Keyboard.git
synced 2025-06-20 17:57:52 +02:00
Fix crash on devices with only unsupported languages
This only affected Android 12 and up.
This commit is contained in:
parent
02cbe0632f
commit
2e9f69d58c
@ -157,6 +157,8 @@ public class Keyboard2 extends InputMethodService
|
|||||||
// Android might return a random subtype, for example, the first in the
|
// Android might return a random subtype, for example, the first in the
|
||||||
// list alphabetically.
|
// list alphabetically.
|
||||||
InputMethodSubtype current_subtype = imm.getCurrentInputMethodSubtype();
|
InputMethodSubtype current_subtype = imm.getCurrentInputMethodSubtype();
|
||||||
|
if (current_subtype == null)
|
||||||
|
return null;
|
||||||
for (InputMethodSubtype s : enabled_subtypes)
|
for (InputMethodSubtype s : enabled_subtypes)
|
||||||
if (s.getLanguageTag().equals(current_subtype.getLanguageTag()))
|
if (s.getLanguageTag().equals(current_subtype.getLanguageTag()))
|
||||||
return s;
|
return s;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user