File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
engine/src/flutter/shell/platform/android/io/flutter/embedding/android Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change 109
109
public class FlutterView extends FrameLayout
110
110
implements MouseCursorPlugin .MouseCursorViewDelegate , KeyboardManager .ViewDelegate {
111
111
private static final String TAG = "FlutterView" ;
112
+ private static final String GBOARD_PACKAGE_NAME = "com.google.android.inputmethod.latin" ;
112
113
113
114
// Internal view hierarchy references.
114
115
@ Nullable private FlutterSurfaceView flutterSurfaceView ;
@@ -1445,13 +1446,14 @@ public void removeFlutterEngineAttachmentListener(
1445
1446
if (Build .VERSION .SDK_INT >= API_LEVELS .API_31 ) {
1446
1447
List <SpellCheckerInfo > enabledSpellCheckerInfos =
1447
1448
textServicesManager .getEnabledSpellCheckerInfos ();
1448
- boolean gboardSpellCheckerEnabled =
1449
- enabledSpellCheckerInfos .stream ()
1450
- .anyMatch (
1451
- spellCheckerInfo ->
1452
- spellCheckerInfo
1453
- .getPackageName ()
1454
- .equals ("com.google.android.inputmethod.latin" ));
1449
+ boolean gboardSpellCheckerEnabled = false ;
1450
+
1451
+ for (SpellCheckerInfo spellCheckerInfo : enabledSpellCheckerInfos ) {
1452
+ if (spellCheckerInfo .getPackageName ().equals (GBOARD_PACKAGE_NAME )) {
1453
+ gboardSpellCheckerEnabled = true ;
1454
+ break ;
1455
+ }
1456
+ }
1455
1457
1456
1458
// Checks if enabled spell checker is the one that is suppported by Gboard, which is
1457
1459
// the one Flutter supports by default.
You can’t perform that action at this time.
0 commit comments