Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion ci/licenses_golden/licenses_flutter
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,6 @@ FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/common/StringCod
FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/editing/FlutterTextUtils.java
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/TextInputPlugin.java
FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/localization/LocalizationPlugin.java
FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/mouse/MouseCursorPlugin.java
Expand Down
2 changes: 0 additions & 2 deletions shell/platform/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ android_java_sources = [
"io/flutter/plugin/editing/FlutterTextUtils.java",
"io/flutter/plugin/editing/ImeSyncDeferringInsetsCallback.java",
"io/flutter/plugin/editing/InputConnectionAdaptor.java",
"io/flutter/plugin/editing/ListenableEditingState.java",
"io/flutter/plugin/editing/TextInputPlugin.java",
"io/flutter/plugin/localization/LocalizationPlugin.java",
"io/flutter/plugin/mouse/MouseCursorPlugin.java",
Expand Down Expand Up @@ -474,7 +473,6 @@ action("robolectric_tests") {
"test/io/flutter/plugin/common/StandardMessageCodecTest.java",
"test/io/flutter/plugin/common/StandardMethodCodecTest.java",
"test/io/flutter/plugin/editing/InputConnectionAdaptorTest.java",
"test/io/flutter/plugin/editing/ListenableEditingStateTest.java",
"test/io/flutter/plugin/editing/TextInputPluginTest.java",
"test/io/flutter/plugin/localization/LocalizationPluginTest.java",
"test/io/flutter/plugin/mouse/MouseCursorPluginTest.java",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -675,60 +675,17 @@ public static TextEditState fromJson(@NonNull JSONObject textEditState) throws J
return new TextEditState(
textEditState.getString("text"),
textEditState.getInt("selectionBase"),
textEditState.getInt("selectionExtent"),
textEditState.getInt("composingBase"),
textEditState.getInt("composingExtent"));
textEditState.getInt("selectionExtent"));
}

@NonNull public final String text;
public final int selectionStart;
public final int selectionEnd;
public final int composingStart;
public final int composingEnd;

public TextEditState(
@NonNull String text,
int selectionStart,
int selectionEnd,
int composingStart,
int composingEnd)
throws IndexOutOfBoundsException {

if ((selectionStart != -1 || selectionEnd != -1)
&& (selectionStart < 0 || selectionStart > selectionEnd)) {
throw new IndexOutOfBoundsException(
"invalid selection: ("
+ String.valueOf(selectionStart)
+ ", "
+ String.valueOf(selectionEnd)
+ ")");
}

if ((composingStart != -1 || composingEnd != -1)
&& (composingStart < 0 || composingStart >= composingEnd)) {
throw new IndexOutOfBoundsException(
"invalid composing range: ("
+ String.valueOf(composingStart)
+ ", "
+ String.valueOf(composingEnd)
+ ")");
}

if (composingStart > text.length()) {
throw new IndexOutOfBoundsException(
"invalid composing start: " + String.valueOf(composingStart));
}

if (selectionStart > text.length()) {
throw new IndexOutOfBoundsException(
"invalid selection start: " + String.valueOf(selectionStart));
}

public TextEditState(@NonNull String text, int selectionStart, int selectionEnd) {
this.text = text;
this.selectionStart = selectionStart;
this.selectionEnd = selectionEnd;
this.composingStart = composingStart;
this.composingEnd = composingEnd;
}
}
}
Loading