Fix crash on devices with only unsupported languages
Some checks are pending
Check layouts / check_layout.output (push) Waiting to run
Check layouts / Generated files (push) Waiting to run
Check translations / check-translations (push) Waiting to run
Make Apk CI / Build-Apk (push) Waiting to run

This only affected Android 12 and up.
This commit is contained in:
Jules Aguillon 2024-12-23 11:04:39 +01:00
parent 02cbe0632f
commit 2e9f69d58c

View File

@ -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;