这是indexloc提供的服务,不要输入任何密码
Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

[Android TextInput] clean up nested batch edits in closeConnection() #26628

Conversation

LongCatIsLooong
Copy link
Contributor

@LongCatIsLooong LongCatIsLooong commented Jun 8, 2021

Fixes flutter/flutter#83213.
Maybe fixes flutter/flutter#80938

We restart the IME when the framework changes the composing region. When this happens during a batch edit the old connection doesn't get to call endBatchEdit so we need to clean that up. Currently if that happens the framework will never be updated (as the batch edit count is always going to be > 0).

Per Android API docs:

public abstract void closeConnection ()
Editor authors: You can clear all the nested batch edit right now and you no longer need to handle subsequent callbacks on this connection, including beginBatchEdit()}. Note that although the system tries to call this method whenever possible, there may be a chance that this method is not called in some exceptional situations.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See testing the engine for instructions on
    writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.
  • The reviewer has submitted any presubmit flakes in this PR using the engine presubmit flakes form before re-triggering the failure.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@chinmaygarde chinmaygarde added the waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land. label Jun 10, 2021
@fluttergithubbot fluttergithubbot merged commit 27ddef5 into flutter:master Jun 10, 2021
@LongCatIsLooong LongCatIsLooong deleted the android-cleanup-on-close-connection branch June 10, 2021 20:29
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jun 10, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jun 10, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jun 11, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jun 11, 2021
jonahwilliams pushed a commit that referenced this pull request Jun 23, 2021
…6890)

* 'Update Dart SDK to bd5cd8a'

* [Android TextInput] clean up nested batch edits in closeConnection() (#26628)

* apply credential fix for cirrus

Co-authored-by: LongCatIsLooong <31859944+LongCatIsLooong@users.noreply.github.com>
christopherfujino added a commit that referenced this pull request Jun 30, 2021
* 'Update Dart SDK to 065872e'
* [Android TextInput] clean up nested batch edits in closeConnection() (#26628)
* update gcloud credentials (#26868)

Co-authored-by: LongCatIsLooong <31859944+LongCatIsLooong@users.noreply.github.com>
Co-authored-by: keyonghan <54558023+keyonghan@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes platform-android waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land.
Projects
None yet
4 participants