This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
Implement repeat filtering logic in Android Embedder #17509
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 tasks
Contributor
Author
|
cc @jason-simmons Ready for review |
Member
jason-simmons
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| // Used to store the last-sent values via updateEditingState to the framework. | ||
| // These are then compared against to prevent redundant messages with the same | ||
| // data before any valid operations were made to the contents. | ||
| private int mPreviousSelectionStart; |
Member
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider moving the selection start/end, composing start/end, and text fields into a class. updateEditingState would construct an instance of the class from the mEditable and call its equals method to check whether it matches the previous instance.
Contributor
Author
|
LUCI is actually green. Merging. |
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Apr 8, 2020
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Apr 8, 2020
This was referenced Apr 8, 2020
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Apr 9, 2020
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Apr 9, 2020
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Apr 9, 2020
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Apr 9, 2020
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Apr 9, 2020
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Apr 9, 2020
This was referenced Apr 9, 2020
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Apr 10, 2020
goderbauer
pushed a commit
to goderbauer/engine
that referenced
this pull request
Apr 16, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There is a longstanding problem where some keyboards, via calls to endBatchEdit(), inadvertently send multiple copies of the same editing state to the framework. This has caused many issues that stem from the framework treating these repeat invocations as new instances of data or new keypresses.
In this PR, I add filtering to prevent the embedder from sending any state more than once unless it is marked as dirty via making any change to the state. This ensures that only valid changes to the state are sent to the framework.
The extra calls to
updateEdtingState()may be removed for any override that calls the super version of itself since the default android implementation all include calls toendBatchEdit()which includes a gated call toupdateEditingStateas needed.Paired with flutter/flutter#53974 to resolve b/152733348