TextEditingDelta support for Android (flutter/engine#28175)

* Add new channel updateEditingStateWithDelta

* Fix formatting

* Fix formatting

* Fix formatting

* Add equality case

* formatting

* Implement TextEditingDelta class to encapsulate delta logic

* Formatting

* Also send new composing/selection along with delta

* Utilize an ArrayList of TextEditingDeltas to take into account batch editing

* clear batch deltas when editing state is updated by framework, we don't want to collect deltas from the framework because they have already been applied to the value on the framework side

* fix formatting

* formatting

* formatting

* Add enableDeltaModel flag to choose between updateEditingValue and updateEditingValueWithDeltas

* Add autofill support for delta model

* formatting

* update

* Fix issues with composing region

* formatting

* Remove

* Fix out of bounds error when textfield is initialized with text

* Clean up logs

* formatting

* update licenses

* Fix deletion issues

* formatting

* delta -> deltaType

* updates

* formatting

* formatting

* Fix logs

* Add tests for TextEditingDelta

* formatting fixes

* remove unused imports

* Fix return type for getDeltaType

* Fix tests

* Fix ListenableEditingStateTest

* formatting

* Fix typo

* Add test for deltas when setComposingText

* formatting

* Updates to test

* fix typo

* formatting

* Verify all properties of delta for test

* formatting

* Add VisibleForTesting import

* fix test

* fix formatting

* fix tests

* fix tests

* fix tests

* updates for tests

* remove ide made file

* Fix more tests

* Fix TextEditingDelta tests

* Add test for verifying delta is generated on setComposingText

* Add TextInputPlugin tests for replacement and deletion deltas

* formatting

* formatting

* Capture delta on setSpan and clear deltas when generated from the framework and when we skip updating the framework

* fix formatting

* update tests to reflect new clear batch delta calls

* Make deletion inline with platform

* fix tests

* Address reviewer comments

* formatting

* fix tests

* fix tests

* move delta inference to framework

* update tests

* formatting

* fix tests

* Formatting

* get -> extract

* More tests and address reviewer comments

* clean up logs

* Address reviewer comments

* formatting

* formatting

* Remove testing constructor

* send as deltas
This commit is contained in:
Renzo Olivares
2021-09-15 13:41:21 -07:00
committed by GitHub
parent 21226c68e5
commit b2b2f705de
11 changed files with 985 additions and 8 deletions

View File

@@ -900,6 +900,7 @@ FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/editing/FlutterT
FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/editing/ImeSyncDeferringInsetsCallback.java
FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/editing/InputConnectionAdaptor.java
FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/editing/ListenableEditingState.java
FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/editing/TextEditingDelta.java
FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/editing/TextInputPlugin.java
FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/localization/LocalizationPlugin.java
FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/mouse/MouseCursorPlugin.java

View File

@@ -233,6 +233,7 @@ android_java_sources = [
"io/flutter/plugin/editing/ImeSyncDeferringInsetsCallback.java",
"io/flutter/plugin/editing/InputConnectionAdaptor.java",
"io/flutter/plugin/editing/ListenableEditingState.java",
"io/flutter/plugin/editing/TextEditingDelta.java",
"io/flutter/plugin/editing/TextInputPlugin.java",
"io/flutter/plugin/localization/LocalizationPlugin.java",
"io/flutter/plugin/mouse/MouseCursorPlugin.java",

View File

@@ -12,6 +12,8 @@ import io.flutter.embedding.engine.dart.DartExecutor;
import io.flutter.plugin.common.JSONMethodCodec;
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugin.editing.TextEditingDelta;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
@@ -186,6 +188,18 @@ public class TextInputChannel {
state.put("composingExtent", composingEnd);
return state;
}
private static HashMap<Object, Object> createEditingDeltaJSON(
ArrayList<TextEditingDelta> batchDeltas) {
HashMap<Object, Object> state = new HashMap<>();
JSONArray deltas = new JSONArray();
for (TextEditingDelta delta : batchDeltas) {
deltas.put(delta.toJSON());
}
state.put("deltas", deltas);
return state;
}
/**
* Instructs Flutter to update its text input editing state to reflect the given configuration.
*/
@@ -220,6 +234,21 @@ public class TextInputChannel {
channel.invokeMethod("TextInputClient.updateEditingState", Arrays.asList(inputClientId, state));
}
public void updateEditingStateWithDeltas(
int inputClientId, ArrayList<TextEditingDelta> batchDeltas) {
Log.v(
TAG,
"Sending message to update editing state with deltas: \n"
+ "Number of deltas: "
+ batchDeltas.size());
final HashMap<Object, Object> state = createEditingDeltaJSON(batchDeltas);
channel.invokeMethod(
"TextInputClient.updateEditingStateWithDeltas", Arrays.asList(inputClientId, state));
}
public void updateEditingStateWithTag(
int inputClientId, HashMap<String, TextEditState> editStates) {
Log.v(
@@ -428,6 +457,7 @@ public class TextInputChannel {
json.optBoolean("autocorrect", true),
json.optBoolean("enableSuggestions"),
json.optBoolean("enableIMEPersonalizedLearning"),
json.optBoolean("enableDeltaModel"),
TextCapitalization.fromValue(json.getString("textCapitalization")),
InputType.fromJson(json.getJSONObject("inputType")),
inputAction,
@@ -583,6 +613,7 @@ public class TextInputChannel {
public final boolean autocorrect;
public final boolean enableSuggestions;
public final boolean enableIMEPersonalizedLearning;
public final boolean enableDeltaModel;
@NonNull public final TextCapitalization textCapitalization;
@NonNull public final InputType inputType;
@Nullable public final Integer inputAction;
@@ -595,6 +626,7 @@ public class TextInputChannel {
boolean autocorrect,
boolean enableSuggestions,
boolean enableIMEPersonalizedLearning,
boolean enableDeltaModel,
@NonNull TextCapitalization textCapitalization,
@NonNull InputType inputType,
@Nullable Integer inputAction,
@@ -605,6 +637,7 @@ public class TextInputChannel {
this.autocorrect = autocorrect;
this.enableSuggestions = enableSuggestions;
this.enableIMEPersonalizedLearning = enableIMEPersonalizedLearning;
this.enableDeltaModel = enableDeltaModel;
this.textCapitalization = textCapitalization;
this.inputType = inputType;
this.inputAction = inputAction;

View File

@@ -41,6 +41,7 @@ class ListenableEditingState extends SpannableStringBuilder {
private int mChangeNotificationDepth = 0;
private ArrayList<EditingStateWatcher> mListeners = new ArrayList<>();
private ArrayList<EditingStateWatcher> mPendingListeners = new ArrayList<>();
private ArrayList<TextEditingDelta> mBatchTextEditingDeltas = new ArrayList<>();
private String mToStringCache;
@@ -70,6 +71,17 @@ class ListenableEditingState extends SpannableStringBuilder {
};
}
public ArrayList<TextEditingDelta> extractBatchTextEditingDeltas() {
ArrayList<TextEditingDelta> currentBatchDeltas =
new ArrayList<TextEditingDelta>(mBatchTextEditingDeltas);
mBatchTextEditingDeltas.clear();
return currentBatchDeltas;
}
public void clearBatchDeltas() {
mBatchTextEditingDeltas.clear();
}
/// Starts a new batch edit during which change notifications will be put on hold until all batch
/// edits end.
///
@@ -142,7 +154,13 @@ class ListenableEditingState extends SpannableStringBuilder {
} else {
Selection.removeSelection(this);
}
setComposingRange(newState.composingStart, newState.composingEnd);
// Updates from the framework should not have a delta created for it as they have already been
// applied on the framework side.
clearBatchDeltas();
endBatchEdit();
}
@@ -179,6 +197,8 @@ class ListenableEditingState extends SpannableStringBuilder {
Log.e(TAG, "editing state should not be changed in a listener callback");
}
final CharSequence oldText = toString();
boolean textChanged = end - start != tbend - tbstart;
for (int i = 0; i < end - start && !textChanged; i++) {
textChanged |= charAt(start + i) != tb.charAt(tbstart + i);
@@ -193,6 +213,17 @@ class ListenableEditingState extends SpannableStringBuilder {
final int composingEnd = getComposingEnd();
final SpannableStringBuilder editable = super.replace(start, end, tb, tbstart, tbend);
mBatchTextEditingDeltas.add(
new TextEditingDelta(
oldText,
start,
end,
tb,
getSelectionStart(),
getSelectionEnd(),
getComposingStart(),
getComposingEnd()));
if (mBatchEditNestDepth > 0) {
return editable;
}
@@ -240,6 +271,20 @@ class ListenableEditingState extends SpannableStringBuilder {
return BaseInputConnection.getComposingSpanEnd(this);
}
@Override
public void setSpan(Object what, int start, int end, int flags) {
super.setSpan(what, start, end, flags);
// Setting a span does not involve mutating the text value in the editing state. Here we create
// a non text update delta with any updated selection and composing regions.
mBatchTextEditingDeltas.add(
new TextEditingDelta(
toString(),
getSelectionStart(),
getSelectionEnd(),
getComposingStart(),
getComposingEnd()));
}
@Override
public String toString() {
return mToStringCache != null ? mToStringCache : (mToStringCache = super.toString());

View File

@@ -0,0 +1,127 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package io.flutter.plugin.editing;
import androidx.annotation.VisibleForTesting;
import io.flutter.Log;
import org.json.JSONException;
import org.json.JSONObject;
/// A representation of the change that occured to an editing state, along with the resulting
/// composing and selection regions.
public final class TextEditingDelta {
private CharSequence oldText;
private CharSequence deltaText;
private int deltaStart;
private int deltaEnd;
private int newSelectionStart;
private int newSelectionEnd;
private int newComposingStart;
private int newComposingEnd;
private static final String TAG = "TextEditingDelta";
public TextEditingDelta(
CharSequence oldEditable,
int replacementDestinationStart,
int replacementDestinationEnd,
CharSequence replacementSource,
int selectionStart,
int selectionEnd,
int composingStart,
int composingEnd) {
newSelectionStart = selectionStart;
newSelectionEnd = selectionEnd;
newComposingStart = composingStart;
newComposingEnd = composingEnd;
setDeltas(
oldEditable,
replacementSource.toString(),
replacementDestinationStart,
replacementDestinationEnd);
}
// Non text update delta constructor.
public TextEditingDelta(
CharSequence oldText,
int selectionStart,
int selectionEnd,
int composingStart,
int composingEnd) {
newSelectionStart = selectionStart;
newSelectionEnd = selectionEnd;
newComposingStart = composingStart;
newComposingEnd = composingEnd;
setDeltas(oldText, "", -1, -1);
}
@VisibleForTesting
public CharSequence getOldText() {
return oldText;
}
@VisibleForTesting
public CharSequence getDeltaText() {
return deltaText;
}
@VisibleForTesting
public int getDeltaStart() {
return deltaStart;
}
@VisibleForTesting
public int getDeltaEnd() {
return deltaEnd;
}
@VisibleForTesting
public int getNewSelectionStart() {
return newSelectionStart;
}
@VisibleForTesting
public int getNewSelectionEnd() {
return newSelectionEnd;
}
@VisibleForTesting
public int getNewComposingStart() {
return newComposingStart;
}
@VisibleForTesting
public int getNewComposingEnd() {
return newComposingEnd;
}
private void setDeltas(CharSequence oldText, CharSequence newText, int newStart, int newExtent) {
this.oldText = oldText;
deltaText = newText;
deltaStart = newStart;
deltaEnd = newExtent;
}
public JSONObject toJSON() {
JSONObject delta = new JSONObject();
try {
delta.put("oldText", oldText.toString());
delta.put("deltaText", deltaText.toString());
delta.put("deltaStart", deltaStart);
delta.put("deltaEnd", deltaEnd);
delta.put("selectionBase", newSelectionStart);
delta.put("selectionExtent", newSelectionEnd);
delta.put("composingBase", newComposingStart);
delta.put("composingExtent", newComposingEnd);
} catch (JSONException e) {
Log.e(TAG, "unable to create JSONObject: " + e);
}
return delta;
}
}

View File

@@ -30,6 +30,7 @@ import io.flutter.embedding.android.KeyboardManager;
import io.flutter.embedding.engine.systemchannels.TextInputChannel;
import io.flutter.embedding.engine.systemchannels.TextInputChannel.TextEditState;
import io.flutter.plugin.platform.PlatformViewsController;
import java.util.ArrayList;
import java.util.HashMap;
/** Android implementation of the text input plugin. */
@@ -624,6 +625,9 @@ public class TextInputPlugin implements ListenableEditingState.EditingStateWatch
final int selectionEnd = mEditable.getSelectionEnd();
final int composingStart = mEditable.getComposingStart();
final int composingEnd = mEditable.getComposingEnd();
final ArrayList<TextEditingDelta> batchTextEditingDeltas =
mEditable.extractBatchTextEditingDeltas();
final boolean skipFrameworkUpdate =
// The framework needs to send its editing state first.
mLastKnownFrameworkTextEditingState == null
@@ -634,16 +638,25 @@ public class TextInputPlugin implements ListenableEditingState.EditingStateWatch
&& composingEnd == mLastKnownFrameworkTextEditingState.composingEnd);
if (!skipFrameworkUpdate) {
Log.v(TAG, "send EditingState to flutter: " + mEditable.toString());
textInputChannel.updateEditingState(
inputTarget.id,
mEditable.toString(),
selectionStart,
selectionEnd,
composingStart,
composingEnd);
if (configuration.enableDeltaModel) {
textInputChannel.updateEditingStateWithDeltas(inputTarget.id, batchTextEditingDeltas);
mEditable.clearBatchDeltas();
} else {
textInputChannel.updateEditingState(
inputTarget.id,
mEditable.toString(),
selectionStart,
selectionEnd,
composingStart,
composingEnd);
}
mLastKnownFrameworkTextEditingState =
new TextEditState(
mEditable.toString(), selectionStart, selectionEnd, composingStart, composingEnd);
} else {
// Don't accumulate deltas if they are not sent to the framework.
mEditable.clearBatchDeltas();
}
}
@@ -817,7 +830,6 @@ public class TextInputPlugin implements ListenableEditingState.EditingStateWatch
editingValues.put(autofill.uniqueIdentifier, newState);
}
}
textInputChannel.updateEditingStateWithTag(inputTarget.id, editingValues);
}
// -------- End: Autofill -------

View File

@@ -37,6 +37,7 @@ import io.flutter.plugin.common.StandardMessageCodecTest;
import io.flutter.plugin.common.StandardMethodCodecTest;
import io.flutter.plugin.editing.InputConnectionAdaptorTest;
import io.flutter.plugin.editing.ListenableEditingStateTest;
import io.flutter.plugin.editing.TextEditingDeltaTest;
import io.flutter.plugin.editing.TextInputPluginTest;
import io.flutter.plugin.localization.LocalizationPluginTest;
import io.flutter.plugin.mouse.MouseCursorPluginTest;
@@ -99,6 +100,7 @@ import test.io.flutter.embedding.engine.PluginComponentTest;
SmokeTest.class,
StandardMessageCodecTest.class,
StandardMethodCodecTest.class,
TextEditingDeltaTest.class,
TextInputChannelTest.class,
TextInputPluginTest.class,
})

View File

@@ -228,6 +228,31 @@ public class ListenableEditingStateTest {
assertEquals(editingState.length(), editingState.getComposingEnd());
}
@Test
public void testClearBatchDeltas() {
final ListenableEditingState editingState =
new ListenableEditingState(null, new View(RuntimeEnvironment.application));
editingState.replace(0, editingState.length(), "text");
editingState.delete(0, 1);
editingState.insert(0, "This is t");
editingState.clearBatchDeltas();
assertEquals(0, editingState.extractBatchTextEditingDeltas().size());
}
@Test
public void testExtractBatchTextEditingDeltas() {
final ListenableEditingState editingState =
new ListenableEditingState(null, new View(RuntimeEnvironment.application));
// Creating some deltas.
editingState.replace(0, editingState.length(), "test");
editingState.delete(0, 1);
editingState.insert(0, "This is a t");
ArrayList<TextEditingDelta> batchDeltas = editingState.extractBatchTextEditingDeltas();
assertEquals(3, batchDeltas.size());
}
// -------- Start: Test InputMethods actions -------
@Test
public void inputMethod_batchEditingBeginAndEnd() {

View File

@@ -0,0 +1,79 @@
package io.flutter.plugin.editing;
import static org.junit.Assert.assertEquals;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.MockitoAnnotations;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
@Config(manifest = Config.NONE)
@RunWith(RobolectricTestRunner.class)
public class TextEditingDeltaTest {
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
}
@Test
public void testConstructorTextEditingDelta() {
final CharSequence oldText = "hell";
final CharSequence textAfterChange = "hello";
final int oldComposingStart = 0;
final int oldComposingEnd = 4;
final int startOfReplacementText = 0;
final int endOfReplacementText = textAfterChange.length();
final int newSelectionStart = 5;
final int newSelectionEnd = 5;
final int newComposingStart = 0;
final int newComposingEnd = 5;
final TextEditingDelta delta =
new TextEditingDelta(
oldText,
oldComposingStart,
oldComposingEnd,
textAfterChange,
newSelectionStart,
newSelectionEnd,
newComposingStart,
newComposingEnd);
assertEquals(oldText, delta.getOldText());
assertEquals(textAfterChange, delta.getDeltaText());
assertEquals(oldComposingStart, delta.getDeltaStart());
assertEquals(oldComposingEnd, delta.getDeltaEnd());
assertEquals(newSelectionStart, delta.getNewSelectionStart());
assertEquals(newSelectionEnd, delta.getNewSelectionEnd());
assertEquals(newComposingStart, delta.getNewComposingStart());
assertEquals(newComposingEnd, delta.getNewComposingEnd());
}
@Test
public void testNonTextUpdateConstructorTextEditingDelta() {
final CharSequence oldText = "hello";
final int newSelectionStart = 3;
final int newSelectionEnd = 3;
final int newComposingStart = 0;
final int newComposingEnd = 5;
final TextEditingDelta delta =
new TextEditingDelta(
oldText, newSelectionStart, newSelectionEnd, newComposingStart, newComposingEnd);
assertEquals(oldText, delta.getOldText());
assertEquals("", delta.getDeltaText());
assertEquals(-1, delta.getDeltaStart());
assertEquals(-1, delta.getDeltaEnd());
assertEquals(newSelectionStart, delta.getNewSelectionStart());
assertEquals(newSelectionEnd, delta.getNewSelectionEnd());
assertEquals(newComposingStart, delta.getNewComposingStart());
assertEquals(newComposingEnd, delta.getNewComposingEnd());
}
}

View File

@@ -157,6 +157,7 @@ public class TextInputPluginTest {
false,
true,
true,
false,
TextInputChannel.TextCapitalization.NONE,
null,
null,
@@ -180,6 +181,628 @@ public class TextInputPluginTest {
.updateEditingState(anyInt(), any(), anyInt(), anyInt(), anyInt(), anyInt());
}
@Test
public void setTextInputEditingState_doesNotInvokeUpdateEditingStateWithDeltas() {
// Initialize a general TextInputPlugin.
InputMethodSubtype inputMethodSubtype = mock(InputMethodSubtype.class);
TestImm testImm =
Shadow.extract(
RuntimeEnvironment.application.getSystemService(Context.INPUT_METHOD_SERVICE));
testImm.setCurrentInputMethodSubtype(inputMethodSubtype);
View testView = new View(RuntimeEnvironment.application);
TextInputChannel textInputChannel = spy(new TextInputChannel(mock(DartExecutor.class)));
TextInputPlugin textInputPlugin =
new TextInputPlugin(testView, textInputChannel, mock(PlatformViewsController.class));
textInputPlugin.setTextInputClient(
0,
new TextInputChannel.Configuration(
false,
false,
true,
true,
true, // Enable delta model.
TextInputChannel.TextCapitalization.NONE,
null,
null,
null,
null,
null));
textInputPlugin.setTextInputEditingState(
testView,
new TextInputChannel.TextEditState("receiving initial input from framework", 0, 0, -1, -1));
assertTrue(
textInputPlugin.getEditable().toString().equals("receiving initial input from framework"));
verify(textInputChannel, times(0)).updateEditingStateWithDeltas(anyInt(), any());
textInputPlugin.setTextInputEditingState(
testView,
new TextInputChannel.TextEditState(
"receiving more updates from the framework", 1, 2, -1, -1));
assertTrue(
textInputPlugin
.getEditable()
.toString()
.equals("receiving more updates from the framework"));
verify(textInputChannel, times(0)).updateEditingStateWithDeltas(anyInt(), any());
}
@Test
public void textEditingDelta_TestUpdateEditingValueWithDeltasIsNotInvokedWhenDeltaModelDisabled()
throws NullPointerException {
// Initialize a general TextInputPlugin.
InputMethodSubtype inputMethodSubtype = mock(InputMethodSubtype.class);
TestImm testImm =
Shadow.extract(
RuntimeEnvironment.application.getSystemService(Context.INPUT_METHOD_SERVICE));
testImm.setCurrentInputMethodSubtype(inputMethodSubtype);
View testView = new View(RuntimeEnvironment.application);
EditorInfo outAttrs = new EditorInfo();
outAttrs.inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_MULTI_LINE;
TextInputChannel textInputChannel = spy(new TextInputChannel(mock(DartExecutor.class)));
TextInputPlugin textInputPlugin =
new TextInputPlugin(testView, textInputChannel, mock(PlatformViewsController.class));
CharSequence newText = "I do not fear computers. I fear the lack of them.";
// Change InputTarget to FRAMEWORK_CLIENT.
textInputPlugin.setTextInputClient(
0,
new TextInputChannel.Configuration(
false,
false,
true,
true,
false, // Delta model is disabled.
TextInputChannel.TextCapitalization.NONE,
new TextInputChannel.InputType(TextInputChannel.TextInputType.TEXT, false, false),
null,
null,
null,
null));
// There's a pending restart since we initialized the text input client. Flush that now.
textInputPlugin.setTextInputEditingState(
testView, new TextInputChannel.TextEditState("", 0, 0, -1, -1));
verify(textInputChannel, times(0)).updateEditingStateWithDeltas(anyInt(), any());
verify(textInputChannel, times(0))
.updateEditingState(anyInt(), any(), anyInt(), anyInt(), anyInt(), anyInt());
assertEquals(
0,
((ListenableEditingState) textInputPlugin.getEditable())
.extractBatchTextEditingDeltas()
.size());
InputConnection inputConnection =
textInputPlugin.createInputConnection(testView, mock(KeyboardManager.class), outAttrs);
inputConnection.beginBatchEdit();
verify(textInputChannel, times(0)).updateEditingStateWithDeltas(anyInt(), any());
verify(textInputChannel, times(0))
.updateEditingState(anyInt(), any(), anyInt(), anyInt(), anyInt(), anyInt());
inputConnection.setComposingText(newText, newText.length());
verify(textInputChannel, times(0)).updateEditingStateWithDeltas(anyInt(), any());
verify(textInputChannel, times(0))
.updateEditingState(anyInt(), any(), anyInt(), anyInt(), anyInt(), anyInt());
inputConnection.endBatchEdit();
assertEquals(
0,
((ListenableEditingState) textInputPlugin.getEditable())
.extractBatchTextEditingDeltas()
.size());
verify(textInputChannel, times(0)).updateEditingStateWithDeltas(anyInt(), any());
verify(textInputChannel, times(1))
.updateEditingState(anyInt(), any(), anyInt(), anyInt(), anyInt(), anyInt());
inputConnection.beginBatchEdit();
verify(textInputChannel, times(0)).updateEditingStateWithDeltas(anyInt(), any());
verify(textInputChannel, times(1))
.updateEditingState(anyInt(), any(), anyInt(), anyInt(), anyInt(), anyInt());
inputConnection.endBatchEdit();
assertEquals(
0,
((ListenableEditingState) textInputPlugin.getEditable())
.extractBatchTextEditingDeltas()
.size());
verify(textInputChannel, times(0)).updateEditingStateWithDeltas(anyInt(), any());
verify(textInputChannel, times(1))
.updateEditingState(anyInt(), any(), anyInt(), anyInt(), anyInt(), anyInt());
inputConnection.beginBatchEdit();
verify(textInputChannel, times(0)).updateEditingStateWithDeltas(anyInt(), any());
verify(textInputChannel, times(1))
.updateEditingState(anyInt(), any(), anyInt(), anyInt(), anyInt(), anyInt());
// Selection changes so this will trigger an update to the framework through
// updateEditingStateWithDeltas after the batch edit has completed and notified all listeners
// of the editing state.
inputConnection.setSelection(3, 4);
assertEquals(Selection.getSelectionStart(textInputPlugin.getEditable()), 3);
assertEquals(Selection.getSelectionEnd(textInputPlugin.getEditable()), 4);
verify(textInputChannel, times(0)).updateEditingStateWithDeltas(anyInt(), any());
verify(textInputChannel, times(1))
.updateEditingState(anyInt(), any(), anyInt(), anyInt(), anyInt(), anyInt());
verify(textInputChannel, times(0)).updateEditingStateWithDeltas(anyInt(), any());
verify(textInputChannel, times(1))
.updateEditingState(anyInt(), any(), anyInt(), anyInt(), anyInt(), anyInt());
inputConnection.endBatchEdit();
verify(textInputChannel, times(0)).updateEditingStateWithDeltas(anyInt(), any());
verify(textInputChannel, times(2))
.updateEditingState(anyInt(), any(), anyInt(), anyInt(), anyInt(), anyInt());
}
@Test
public void textEditingDelta_TestUpdateEditingValueIsNotInvokedWhenDeltaModelEnabled()
throws NullPointerException {
// Initialize a general TextInputPlugin.
InputMethodSubtype inputMethodSubtype = mock(InputMethodSubtype.class);
TestImm testImm =
Shadow.extract(
RuntimeEnvironment.application.getSystemService(Context.INPUT_METHOD_SERVICE));
testImm.setCurrentInputMethodSubtype(inputMethodSubtype);
View testView = new View(RuntimeEnvironment.application);
EditorInfo outAttrs = new EditorInfo();
outAttrs.inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_MULTI_LINE;
TextInputChannel textInputChannel = spy(new TextInputChannel(mock(DartExecutor.class)));
TextInputPlugin textInputPlugin =
new TextInputPlugin(testView, textInputChannel, mock(PlatformViewsController.class));
CharSequence newText = "I do not fear computers. I fear the lack of them.";
final TextEditingDelta expectedDelta =
new TextEditingDelta("", 0, 0, newText, newText.length(), newText.length(), 0, 49);
// Change InputTarget to FRAMEWORK_CLIENT.
textInputPlugin.setTextInputClient(
0,
new TextInputChannel.Configuration(
false,
false,
true,
true,
true, // Enable delta model.
TextInputChannel.TextCapitalization.NONE,
new TextInputChannel.InputType(TextInputChannel.TextInputType.TEXT, false, false),
null,
null,
null,
null));
// There's a pending restart since we initialized the text input client. Flush that now.
textInputPlugin.setTextInputEditingState(
testView, new TextInputChannel.TextEditState("", 0, 0, -1, -1));
verify(textInputChannel, times(0)).updateEditingStateWithDeltas(anyInt(), any());
verify(textInputChannel, times(0))
.updateEditingState(anyInt(), any(), anyInt(), anyInt(), anyInt(), anyInt());
assertEquals(
0,
((ListenableEditingState) textInputPlugin.getEditable())
.extractBatchTextEditingDeltas()
.size());
InputConnection inputConnection =
textInputPlugin.createInputConnection(testView, mock(KeyboardManager.class), outAttrs);
inputConnection.beginBatchEdit();
verify(textInputChannel, times(0)).updateEditingStateWithDeltas(anyInt(), any());
verify(textInputChannel, times(0))
.updateEditingState(anyInt(), any(), anyInt(), anyInt(), anyInt(), anyInt());
inputConnection.setComposingText(newText, newText.length());
final ArrayList<TextEditingDelta> actualDeltas =
((ListenableEditingState) textInputPlugin.getEditable()).extractBatchTextEditingDeltas();
assertEquals(2, actualDeltas.size());
final TextEditingDelta delta = actualDeltas.get(1);
verify(textInputChannel, times(0)).updateEditingStateWithDeltas(anyInt(), any());
verify(textInputChannel, times(0))
.updateEditingState(anyInt(), any(), anyInt(), anyInt(), anyInt(), anyInt());
inputConnection.endBatchEdit();
assertEquals(
0,
((ListenableEditingState) textInputPlugin.getEditable())
.extractBatchTextEditingDeltas()
.size());
// Verify delta is what we expect.
assertEquals(expectedDelta.getOldText(), delta.getOldText());
assertEquals(expectedDelta.getDeltaText(), delta.getDeltaText());
assertEquals(expectedDelta.getDeltaStart(), delta.getDeltaStart());
assertEquals(expectedDelta.getDeltaEnd(), delta.getDeltaEnd());
assertEquals(expectedDelta.getNewSelectionStart(), delta.getNewSelectionStart());
assertEquals(expectedDelta.getNewSelectionEnd(), delta.getNewSelectionEnd());
assertEquals(expectedDelta.getNewComposingStart(), delta.getNewComposingStart());
assertEquals(expectedDelta.getNewComposingEnd(), delta.getNewComposingEnd());
verify(textInputChannel, times(1)).updateEditingStateWithDeltas(anyInt(), any());
verify(textInputChannel, times(0))
.updateEditingState(anyInt(), any(), anyInt(), anyInt(), anyInt(), anyInt());
inputConnection.beginBatchEdit();
verify(textInputChannel, times(1)).updateEditingStateWithDeltas(anyInt(), any());
verify(textInputChannel, times(0))
.updateEditingState(anyInt(), any(), anyInt(), anyInt(), anyInt(), anyInt());
inputConnection.endBatchEdit();
assertEquals(
0,
((ListenableEditingState) textInputPlugin.getEditable())
.extractBatchTextEditingDeltas()
.size());
verify(textInputChannel, times(1)).updateEditingStateWithDeltas(anyInt(), any());
verify(textInputChannel, times(0))
.updateEditingState(anyInt(), any(), anyInt(), anyInt(), anyInt(), anyInt());
inputConnection.beginBatchEdit();
verify(textInputChannel, times(1)).updateEditingStateWithDeltas(anyInt(), any());
verify(textInputChannel, times(0))
.updateEditingState(anyInt(), any(), anyInt(), anyInt(), anyInt(), anyInt());
// Selection changes so this will trigger an update to the framework through
// updateEditingStateWithDeltas after the batch edit has completed and notified all listeners
// of the editing state.
inputConnection.setSelection(3, 4);
assertEquals(Selection.getSelectionStart(textInputPlugin.getEditable()), 3);
assertEquals(Selection.getSelectionEnd(textInputPlugin.getEditable()), 4);
verify(textInputChannel, times(1)).updateEditingStateWithDeltas(anyInt(), any());
verify(textInputChannel, times(0))
.updateEditingState(anyInt(), any(), anyInt(), anyInt(), anyInt(), anyInt());
verify(textInputChannel, times(1)).updateEditingStateWithDeltas(anyInt(), any());
verify(textInputChannel, times(0))
.updateEditingState(anyInt(), any(), anyInt(), anyInt(), anyInt(), anyInt());
inputConnection.endBatchEdit();
verify(textInputChannel, times(2)).updateEditingStateWithDeltas(anyInt(), any());
verify(textInputChannel, times(0))
.updateEditingState(anyInt(), any(), anyInt(), anyInt(), anyInt(), anyInt());
}
@Test
public void textEditingDelta_TestDeltaIsCreatedWhenComposingTextSetIsInserting()
throws NullPointerException {
// Initialize a general TextInputPlugin.
InputMethodSubtype inputMethodSubtype = mock(InputMethodSubtype.class);
TestImm testImm =
Shadow.extract(
RuntimeEnvironment.application.getSystemService(Context.INPUT_METHOD_SERVICE));
testImm.setCurrentInputMethodSubtype(inputMethodSubtype);
View testView = new View(RuntimeEnvironment.application);
EditorInfo outAttrs = new EditorInfo();
outAttrs.inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_MULTI_LINE;
TextInputChannel textInputChannel = spy(new TextInputChannel(mock(DartExecutor.class)));
TextInputPlugin textInputPlugin =
new TextInputPlugin(testView, textInputChannel, mock(PlatformViewsController.class));
CharSequence newText = "I do not fear computers. I fear the lack of them.";
final TextEditingDelta expectedDelta =
new TextEditingDelta("", 0, 0, newText, newText.length(), newText.length(), 0, 49);
// Change InputTarget to FRAMEWORK_CLIENT.
textInputPlugin.setTextInputClient(
0,
new TextInputChannel.Configuration(
false,
false,
true,
true,
true, // Enable delta model.
TextInputChannel.TextCapitalization.NONE,
new TextInputChannel.InputType(TextInputChannel.TextInputType.TEXT, false, false),
null,
null,
null,
null));
// There's a pending restart since we initialized the text input client. Flush that now.
textInputPlugin.setTextInputEditingState(
testView, new TextInputChannel.TextEditState("", 0, 0, -1, -1));
verify(textInputChannel, times(0)).updateEditingStateWithDeltas(anyInt(), any());
assertEquals(
0,
((ListenableEditingState) textInputPlugin.getEditable())
.extractBatchTextEditingDeltas()
.size());
InputConnection inputConnection =
textInputPlugin.createInputConnection(testView, mock(KeyboardManager.class), outAttrs);
inputConnection.beginBatchEdit();
verify(textInputChannel, times(0)).updateEditingStateWithDeltas(anyInt(), any());
inputConnection.setComposingText(newText, newText.length());
final ArrayList<TextEditingDelta> actualDeltas =
((ListenableEditingState) textInputPlugin.getEditable()).extractBatchTextEditingDeltas();
assertEquals(2, actualDeltas.size());
final TextEditingDelta delta = actualDeltas.get(1);
verify(textInputChannel, times(0)).updateEditingStateWithDeltas(anyInt(), any());
inputConnection.endBatchEdit();
assertEquals(
0,
((ListenableEditingState) textInputPlugin.getEditable())
.extractBatchTextEditingDeltas()
.size());
// Verify delta is what we expect.
assertEquals(expectedDelta.getOldText(), delta.getOldText());
assertEquals(expectedDelta.getDeltaText(), delta.getDeltaText());
assertEquals(expectedDelta.getDeltaStart(), delta.getDeltaStart());
assertEquals(expectedDelta.getDeltaEnd(), delta.getDeltaEnd());
assertEquals(expectedDelta.getNewSelectionStart(), delta.getNewSelectionStart());
assertEquals(expectedDelta.getNewSelectionEnd(), delta.getNewSelectionEnd());
assertEquals(expectedDelta.getNewComposingStart(), delta.getNewComposingStart());
assertEquals(expectedDelta.getNewComposingEnd(), delta.getNewComposingEnd());
verify(textInputChannel, times(1)).updateEditingStateWithDeltas(anyInt(), any());
inputConnection.beginBatchEdit();
verify(textInputChannel, times(1)).updateEditingStateWithDeltas(anyInt(), any());
inputConnection.endBatchEdit();
assertEquals(
0,
((ListenableEditingState) textInputPlugin.getEditable())
.extractBatchTextEditingDeltas()
.size());
verify(textInputChannel, times(1)).updateEditingStateWithDeltas(anyInt(), any());
inputConnection.beginBatchEdit();
verify(textInputChannel, times(1)).updateEditingStateWithDeltas(anyInt(), any());
// Selection changes so this will trigger an update to the framework through
// updateEditingStateWithDeltas after the batch edit has completed and notified all listeners
// of the editing state.
inputConnection.setSelection(3, 4);
assertEquals(Selection.getSelectionStart(textInputPlugin.getEditable()), 3);
assertEquals(Selection.getSelectionEnd(textInputPlugin.getEditable()), 4);
verify(textInputChannel, times(1)).updateEditingStateWithDeltas(anyInt(), any());
verify(textInputChannel, times(1)).updateEditingStateWithDeltas(anyInt(), any());
inputConnection.endBatchEdit();
verify(textInputChannel, times(2)).updateEditingStateWithDeltas(anyInt(), any());
}
@Test
public void textEditingDelta_TestDeltaIsCreatedWhenComposingTextSetIsDeleting()
throws NullPointerException {
// Initialize a general TextInputPlugin.
InputMethodSubtype inputMethodSubtype = mock(InputMethodSubtype.class);
TestImm testImm =
Shadow.extract(
RuntimeEnvironment.application.getSystemService(Context.INPUT_METHOD_SERVICE));
testImm.setCurrentInputMethodSubtype(inputMethodSubtype);
View testView = new View(RuntimeEnvironment.application);
EditorInfo outAttrs = new EditorInfo();
outAttrs.inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_MULTI_LINE;
TextInputChannel textInputChannel = spy(new TextInputChannel(mock(DartExecutor.class)));
TextInputPlugin textInputPlugin =
new TextInputPlugin(testView, textInputChannel, mock(PlatformViewsController.class));
CharSequence newText = "I do not fear computers. I fear the lack of them.";
final TextEditingDelta expectedDelta =
new TextEditingDelta(
newText, 0, 49, "I do not fear computers. I fear the lack of them", 48, 48, 0, 48);
// Change InputTarget to FRAMEWORK_CLIENT.
textInputPlugin.setTextInputClient(
0,
new TextInputChannel.Configuration(
false,
false,
true,
true,
true, // Enable delta model.
TextInputChannel.TextCapitalization.NONE,
new TextInputChannel.InputType(TextInputChannel.TextInputType.TEXT, false, false),
null,
null,
null,
null));
// There's a pending restart since we initialized the text input client. Flush that now.
textInputPlugin.setTextInputEditingState(
testView, new TextInputChannel.TextEditState(newText.toString(), 49, 49, 0, 49));
verify(textInputChannel, times(0)).updateEditingStateWithDeltas(anyInt(), any());
assertEquals(
0,
((ListenableEditingState) textInputPlugin.getEditable())
.extractBatchTextEditingDeltas()
.size());
InputConnection inputConnection =
textInputPlugin.createInputConnection(testView, mock(KeyboardManager.class), outAttrs);
inputConnection.beginBatchEdit();
verify(textInputChannel, times(0)).updateEditingStateWithDeltas(anyInt(), any());
inputConnection.setComposingText("I do not fear computers. I fear the lack of them", 48);
final ArrayList<TextEditingDelta> actualDeltas =
((ListenableEditingState) textInputPlugin.getEditable()).extractBatchTextEditingDeltas();
final TextEditingDelta delta = actualDeltas.get(1);
System.out.println(delta.getDeltaText());
verify(textInputChannel, times(0)).updateEditingStateWithDeltas(anyInt(), any());
inputConnection.endBatchEdit();
assertEquals(
0,
((ListenableEditingState) textInputPlugin.getEditable())
.extractBatchTextEditingDeltas()
.size());
// Verify delta is what we expect.
assertEquals(expectedDelta.getOldText(), delta.getOldText());
assertEquals(expectedDelta.getDeltaText(), delta.getDeltaText());
assertEquals(expectedDelta.getDeltaStart(), delta.getDeltaStart());
assertEquals(expectedDelta.getDeltaEnd(), delta.getDeltaEnd());
assertEquals(expectedDelta.getNewSelectionStart(), delta.getNewSelectionStart());
assertEquals(expectedDelta.getNewSelectionEnd(), delta.getNewSelectionEnd());
assertEquals(expectedDelta.getNewComposingStart(), delta.getNewComposingStart());
assertEquals(expectedDelta.getNewComposingEnd(), delta.getNewComposingEnd());
verify(textInputChannel, times(1)).updateEditingStateWithDeltas(anyInt(), any());
inputConnection.beginBatchEdit();
verify(textInputChannel, times(1)).updateEditingStateWithDeltas(anyInt(), any());
inputConnection.endBatchEdit();
assertEquals(
0,
((ListenableEditingState) textInputPlugin.getEditable())
.extractBatchTextEditingDeltas()
.size());
verify(textInputChannel, times(1)).updateEditingStateWithDeltas(anyInt(), any());
inputConnection.beginBatchEdit();
verify(textInputChannel, times(1)).updateEditingStateWithDeltas(anyInt(), any());
// Selection changes so this will trigger an update to the framework through
// updateEditingStateWithDeltas after the batch edit has completed and notified all listeners
// of the editing state.
inputConnection.setSelection(3, 4);
assertEquals(Selection.getSelectionStart(textInputPlugin.getEditable()), 3);
assertEquals(Selection.getSelectionEnd(textInputPlugin.getEditable()), 4);
verify(textInputChannel, times(1)).updateEditingStateWithDeltas(anyInt(), any());
verify(textInputChannel, times(1)).updateEditingStateWithDeltas(anyInt(), any());
inputConnection.endBatchEdit();
verify(textInputChannel, times(2)).updateEditingStateWithDeltas(anyInt(), any());
}
@Test
public void textEditingDelta_TestDeltaIsCreatedWhenComposingTextSetIsReplacing()
throws NullPointerException {
// Initialize a general TextInputPlugin.
InputMethodSubtype inputMethodSubtype = mock(InputMethodSubtype.class);
TestImm testImm =
Shadow.extract(
RuntimeEnvironment.application.getSystemService(Context.INPUT_METHOD_SERVICE));
testImm.setCurrentInputMethodSubtype(inputMethodSubtype);
View testView = new View(RuntimeEnvironment.application);
EditorInfo outAttrs = new EditorInfo();
outAttrs.inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_MULTI_LINE;
TextInputChannel textInputChannel = spy(new TextInputChannel(mock(DartExecutor.class)));
TextInputPlugin textInputPlugin =
new TextInputPlugin(testView, textInputChannel, mock(PlatformViewsController.class));
CharSequence newText = "helfo";
final TextEditingDelta expectedDelta = new TextEditingDelta(newText, 0, 5, "hello", 5, 5, 0, 5);
// Change InputTarget to FRAMEWORK_CLIENT.
textInputPlugin.setTextInputClient(
0,
new TextInputChannel.Configuration(
false,
false,
true,
true,
true, // Enable delta model.
TextInputChannel.TextCapitalization.NONE,
new TextInputChannel.InputType(TextInputChannel.TextInputType.TEXT, false, false),
null,
null,
null,
null));
// There's a pending restart since we initialized the text input client. Flush that now.
textInputPlugin.setTextInputEditingState(
testView, new TextInputChannel.TextEditState(newText.toString(), 5, 5, 0, 5));
verify(textInputChannel, times(0)).updateEditingStateWithDeltas(anyInt(), any());
assertEquals(
0,
((ListenableEditingState) textInputPlugin.getEditable())
.extractBatchTextEditingDeltas()
.size());
InputConnection inputConnection =
textInputPlugin.createInputConnection(testView, mock(KeyboardManager.class), outAttrs);
inputConnection.beginBatchEdit();
verify(textInputChannel, times(0)).updateEditingStateWithDeltas(anyInt(), any());
inputConnection.setComposingText("hello", 5);
final ArrayList<TextEditingDelta> actualDeltas =
((ListenableEditingState) textInputPlugin.getEditable()).extractBatchTextEditingDeltas();
final TextEditingDelta delta = actualDeltas.get(1);
System.out.println(delta.getDeltaText());
verify(textInputChannel, times(0)).updateEditingStateWithDeltas(anyInt(), any());
inputConnection.endBatchEdit();
assertEquals(
0,
((ListenableEditingState) textInputPlugin.getEditable())
.extractBatchTextEditingDeltas()
.size());
// Verify delta is what we expect.
assertEquals(expectedDelta.getOldText(), delta.getOldText());
assertEquals(expectedDelta.getDeltaText(), delta.getDeltaText());
assertEquals(expectedDelta.getDeltaStart(), delta.getDeltaStart());
assertEquals(expectedDelta.getDeltaEnd(), delta.getDeltaEnd());
assertEquals(expectedDelta.getNewSelectionStart(), delta.getNewSelectionStart());
assertEquals(expectedDelta.getNewSelectionEnd(), delta.getNewSelectionEnd());
assertEquals(expectedDelta.getNewComposingStart(), delta.getNewComposingStart());
assertEquals(expectedDelta.getNewComposingEnd(), delta.getNewComposingEnd());
verify(textInputChannel, times(1)).updateEditingStateWithDeltas(anyInt(), any());
inputConnection.beginBatchEdit();
verify(textInputChannel, times(1)).updateEditingStateWithDeltas(anyInt(), any());
inputConnection.endBatchEdit();
assertEquals(
0,
((ListenableEditingState) textInputPlugin.getEditable())
.extractBatchTextEditingDeltas()
.size());
verify(textInputChannel, times(1)).updateEditingStateWithDeltas(anyInt(), any());
inputConnection.beginBatchEdit();
verify(textInputChannel, times(1)).updateEditingStateWithDeltas(anyInt(), any());
// Selection changes so this will trigger an update to the framework through
// updateEditingStateWithDeltas after the batch edit has completed and notified all listeners
// of the editing state.
inputConnection.setSelection(3, 4);
assertEquals(Selection.getSelectionStart(textInputPlugin.getEditable()), 3);
assertEquals(Selection.getSelectionEnd(textInputPlugin.getEditable()), 4);
verify(textInputChannel, times(1)).updateEditingStateWithDeltas(anyInt(), any());
verify(textInputChannel, times(1)).updateEditingStateWithDeltas(anyInt(), any());
inputConnection.endBatchEdit();
verify(textInputChannel, times(2)).updateEditingStateWithDeltas(anyInt(), any());
}
@Test
public void inputConnectionAdaptor_RepeatFilter() throws NullPointerException {
// Initialize a general TextInputPlugin.
@@ -203,6 +826,7 @@ public class TextInputPluginTest {
false,
true,
true,
false,
TextInputChannel.TextCapitalization.NONE,
new TextInputChannel.InputType(TextInputChannel.TextInputType.TEXT, false, false),
null,
@@ -292,6 +916,7 @@ public class TextInputPluginTest {
false,
true,
true,
false,
TextInputChannel.TextCapitalization.NONE,
null,
null,
@@ -330,6 +955,7 @@ public class TextInputPluginTest {
false,
true,
true,
false,
TextInputChannel.TextCapitalization.NONE,
null,
null,
@@ -377,6 +1003,7 @@ public class TextInputPluginTest {
false,
true,
true,
false,
TextInputChannel.TextCapitalization.NONE,
new TextInputChannel.InputType(TextInputChannel.TextInputType.TEXT, false, false),
null,
@@ -478,6 +1105,7 @@ public class TextInputPluginTest {
false,
true,
true,
false,
TextInputChannel.TextCapitalization.NONE,
null,
null,
@@ -521,6 +1149,7 @@ public class TextInputPluginTest {
false,
true,
true,
false,
TextInputChannel.TextCapitalization.NONE,
new TextInputChannel.InputType(TextInputChannel.TextInputType.TEXT, false, false),
null,
@@ -588,6 +1217,7 @@ public class TextInputPluginTest {
false,
true,
true,
false,
TextInputChannel.TextCapitalization.NONE,
new TextInputChannel.InputType(TextInputChannel.TextInputType.TEXT, false, false),
null,
@@ -624,6 +1254,7 @@ public class TextInputPluginTest {
false,
true,
true,
false,
TextInputChannel.TextCapitalization.NONE,
new TextInputChannel.InputType(TextInputChannel.TextInputType.NONE, false, false),
null,
@@ -654,6 +1285,7 @@ public class TextInputPluginTest {
false,
true,
true,
false,
TextInputChannel.TextCapitalization.NONE,
new TextInputChannel.InputType(TextInputChannel.TextInputType.NONE, false, false),
null,
@@ -685,6 +1317,7 @@ public class TextInputPluginTest {
false,
true,
true,
false,
TextInputChannel.TextCapitalization.NONE,
null,
null,
@@ -699,6 +1332,7 @@ public class TextInputPluginTest {
false,
true,
true,
false,
TextInputChannel.TextCapitalization.NONE,
null,
null,
@@ -740,6 +1374,7 @@ public class TextInputPluginTest {
false,
true,
true,
false,
TextInputChannel.TextCapitalization.NONE,
null,
null,
@@ -778,6 +1413,7 @@ public class TextInputPluginTest {
false,
true,
true,
false,
TextInputChannel.TextCapitalization.NONE,
null,
null,
@@ -826,6 +1462,7 @@ public class TextInputPluginTest {
false,
true,
true,
false,
TextInputChannel.TextCapitalization.NONE,
null,
null,
@@ -838,6 +1475,7 @@ public class TextInputPluginTest {
false,
true,
true,
false,
TextInputChannel.TextCapitalization.NONE,
null,
null,
@@ -852,6 +1490,7 @@ public class TextInputPluginTest {
false,
true,
true,
false,
TextInputChannel.TextCapitalization.NONE,
null,
null,
@@ -906,6 +1545,7 @@ public class TextInputPluginTest {
false,
true,
true,
false,
TextInputChannel.TextCapitalization.NONE,
null,
null,
@@ -963,6 +1603,7 @@ public class TextInputPluginTest {
false,
true,
true,
false,
TextInputChannel.TextCapitalization.NONE,
null,
null,
@@ -975,6 +1616,7 @@ public class TextInputPluginTest {
false,
true,
true,
false,
TextInputChannel.TextCapitalization.NONE,
null,
null,
@@ -990,6 +1632,7 @@ public class TextInputPluginTest {
false,
true,
true,
false,
TextInputChannel.TextCapitalization.NONE,
null,
null,
@@ -1033,6 +1676,7 @@ public class TextInputPluginTest {
false,
true,
true,
false,
TextInputChannel.TextCapitalization.NONE,
null,
null,
@@ -1090,6 +1734,7 @@ public class TextInputPluginTest {
false,
true,
true,
false,
TextInputChannel.TextCapitalization.NONE,
null,
null,
@@ -1102,6 +1747,7 @@ public class TextInputPluginTest {
false,
true,
true,
false,
TextInputChannel.TextCapitalization.NONE,
null,
null,
@@ -1115,6 +1761,7 @@ public class TextInputPluginTest {
false,
true,
true,
false,
TextInputChannel.TextCapitalization.NONE,
null,
null,
@@ -1182,6 +1829,7 @@ public class TextInputPluginTest {
false,
true,
true,
false,
TextInputChannel.TextCapitalization.NONE,
null,
null,
@@ -1194,6 +1842,7 @@ public class TextInputPluginTest {
false,
true,
true,
false,
TextInputChannel.TextCapitalization.NONE,
null,
null,
@@ -1207,6 +1856,7 @@ public class TextInputPluginTest {
false,
true,
true,
false,
TextInputChannel.TextCapitalization.NONE,
null,
null,

View File

@@ -52,6 +52,7 @@
<src file="../../../flutter/shell/platform/android/test/io/flutter/plugin/common/StandardMethodCodecTest.java" />
<src file="../../../flutter/shell/platform/android/test/io/flutter/plugin/editing/ListenableEditingStateTest.java" />
<src file="../../../flutter/shell/platform/android/test/io/flutter/plugin/editing/TextInputPluginTest.java" />
<src file="../../../flutter/shell/platform/android/test/io/flutter/plugin/editing/TextEditingDeltaTest.java" />
<src file="../../../flutter/shell/platform/android/test/io/flutter/plugin/editing/InputConnectionAdaptorTest.java" />
<src file="../../../flutter/shell/platform/android/test/io/flutter/plugin/localization/LocalizationPluginTest.java" />
<src file="../../../flutter/shell/platform/android/test/io/flutter/view/AccessibilityBridgeTest.java" />
@@ -172,6 +173,7 @@
<src file="../../../flutter/shell/platform/android/io/flutter/plugin/common/MethodCall.java" />
<src file="../../../flutter/shell/platform/android/io/flutter/plugin/common/EventChannel.java" />
<src file="../../../flutter/shell/platform/android/io/flutter/plugin/common/MethodChannel.java" />
<src file="../../../flutter/shell/platform/android/io/flutter/plugin/editing/TextEditingDelta.java" />
<src file="../../../flutter/shell/platform/android/io/flutter/plugin/editing/TextInputPlugin.java" />
<src file="../../../flutter/shell/platform/android/io/flutter/plugin/editing/ListenableEditingState.java" />
<src file="../../../flutter/shell/platform/android/io/flutter/plugin/editing/InputConnectionAdaptor.java" />