@@ -397,52 +397,10 @@ public void inputConnection_finishComposingTextUpdatesIMM() throws JSONException
397
397
}
398
398
}
399
399
400
- @ Test
401
- public void inputConnection_samsungFinishComposingTextSetsSelection () throws JSONException {
402
- ShadowBuild .setManufacturer ("samsung" );
403
- InputMethodSubtype inputMethodSubtype =
404
- new InputMethodSubtype (0 , 0 , /*locale=*/ "en" , "" , "" , false , false );
405
- Settings .Secure .putString (
406
- RuntimeEnvironment .application .getContentResolver (),
407
- Settings .Secure .DEFAULT_INPUT_METHOD ,
408
- "com.sec.android.inputmethod/.SamsungKeypad" );
409
- TestImm testImm =
410
- Shadow .extract (
411
- RuntimeEnvironment .application .getSystemService (Context .INPUT_METHOD_SERVICE ));
412
- testImm .setCurrentInputMethodSubtype (inputMethodSubtype );
413
- FlutterJNI mockFlutterJni = mock (FlutterJNI .class );
414
- View testView = new View (RuntimeEnvironment .application );
415
- DartExecutor dartExecutor = spy (new DartExecutor (mockFlutterJni , mock (AssetManager .class )));
416
- TextInputPlugin textInputPlugin =
417
- new TextInputPlugin (testView , dartExecutor , mock (PlatformViewsController .class ));
418
- textInputPlugin .setTextInputClient (
419
- 0 ,
420
- new TextInputChannel .Configuration (
421
- false ,
422
- false ,
423
- true ,
424
- TextInputChannel .TextCapitalization .NONE ,
425
- new TextInputChannel .InputType (TextInputChannel .TextInputType .TEXT , false , false ),
426
- null ,
427
- null ,
428
- null ,
429
- null ));
430
- // There's a pending restart since we initialized the text input client. Flush that now.
431
- textInputPlugin .setTextInputEditingState (
432
- testView , new TextInputChannel .TextEditState ("" , 0 , 0 ));
433
- InputConnection connection = textInputPlugin .createInputConnection (testView , new EditorInfo ());
434
-
435
- testImm .setTrackSelection (true );
436
- connection .finishComposingText ();
437
- testImm .setTrackSelection (false );
438
-
439
- List <Integer > expectedSelectionValues =
440
- Arrays .asList (0 , 0 , -1 , -1 , -1 , -1 , -1 , -1 , 0 , 0 , -1 , -1 );
441
- assertEquals (testImm .getSelectionUpdateValues (), expectedSelectionValues );
442
- }
443
-
444
400
@ Test
445
401
public void autofill_onProvideVirtualViewStructure () {
402
+ if (Build .VERSION .SDK_INT < Build .VERSION_CODES .O ) return ;
403
+
446
404
FlutterView testView = new FlutterView (RuntimeEnvironment .application );
447
405
TextInputPlugin textInputPlugin =
448
406
new TextInputPlugin (
@@ -509,6 +467,8 @@ public void autofill_onProvideVirtualViewStructure() {
509
467
510
468
@ Test
511
469
public void autofill_onProvideVirtualViewStructure_single () {
470
+ if (Build .VERSION .SDK_INT < Build .VERSION_CODES .O ) return ;
471
+
512
472
FlutterView testView = new FlutterView (RuntimeEnvironment .application );
513
473
TextInputPlugin textInputPlugin =
514
474
new TextInputPlugin (
0 commit comments