-
Notifications
You must be signed in to change notification settings - Fork 6k
[Android] Reset IME state in TextInputPlugin.clearTextInputClient #49829
[Android] Reset IME state in TextInputPlugin.clearTextInputClient #49829
Conversation
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 👍 Thanks for tracking this down.
One thing to note is that restarting the IME will affect composing text if it happens while composing. However since this change is in clearTextInputClient
it shouldn't affect composing, so this should be fine.
…141759) flutter/engine@bfdc0c5...873449c 2024-01-18 [email protected] [Android] Reset IME state in TextInputPlugin.clearTextInputClient (flutter/engine#49829) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
@justinmc WDYT of reverting this change in order to fix the following regression: flutter/flutter#148673? I can repro this even on Android API 30 so this is not similar to flutter/flutter#148117. We can probably find another way to make it possible to call Another option would be to call it only for some particular |
Discussed offline, but I'm hoping we don't have to revert this since the two bugs fixed here are arguably worse than flutter/flutter#148673. |
## Description This PR restricts the call to `restartInput` which was added in #49829. The restart is called when input action is null, DONE, or NONE. ## Related Issue Fixes flutter/flutter#148673. ## Tests Updates 1 test, adds 3 tests.
## Description This PR reverts two commits #49829 and #53662. The main change was in #49829. #53662 was a follow-up to mitigate the impact of #49829. ## Related Issue Fixes flutter/flutter#148530 Fixes flutter/flutter#152620 Reopens flutter/flutter#70546. Reopens flutter/flutter#51478
Description
This PR calls Android API
InputMethodManager.restartInput
to reset IMEs internal states. Otherwise some IMEs (Gboard for instance) keep reacting based on the previous input configuration until a new configuration is set.restartInput
is called in several places, for instance in https://github.com/AndroidSDKSources/android-sdk-sources-for-api-level-34/blob/f2197987748faef78e869662ae1fd039daa22a63/android/widget/TextView.java#L2458.TextField
is focused (it is mainly called insetTextInputEditingState
).Related Issue
Fixes flutter/flutter#70546.
Fixes flutter/flutter#51478
Tests
Adds 1 test.