Fix crash when clicking Spell Checker

Some variants do not have the default Spell Checker (GBoard)
pre-installed (typically Mainland China variants). Disable the
Spell Checker settings for such variants, to avoid crashes.

Bug: 310751714
Test: Manual
Change-Id: I1fb5a9959cffd26f3921e32226605a38636871b6
This commit is contained in:
Pingzhi Wang
2023-11-14 11:34:17 +01:00
committed by David Magno
parent 6a04355cb3
commit 42a7e4784a
2 changed files with 4 additions and 0 deletions

View File

@@ -47,6 +47,9 @@ class SpellCheckerPreference extends CustomListPreference {
super(context, null);
mScis = scis;
setWidgetLayoutResource(R.layout.preference_widget_gear);
if (scis == null) {
return;
}
CharSequence[] labels = new CharSequence[scis.length];
CharSequence[] values = new CharSequence[scis.length];
for (int i = 0 ; i < scis.length; i++) {