-
Notifications
You must be signed in to change notification settings - Fork 6k
Check for invalid indexes when performing InputAdpator backspace. #9322
Conversation
|
I am currently in need of a repro of the bug to ensure this does what I intend it to do. |
|
@justinmc for repro |
|
I couldn't reproduce this with a quick try on 2 phones lying around, but tomorrow I'll try again with the Samsung phone that I got it on before. |
|
Sorry, going to try this again on Monday. I have the Samsung phone but I can't get the engine to compile for it on my Mac :( |
|
I just managed to repro the crash with an arabic keyboard I can continue with this now! Thanks for trying though! |
|
Ah good, no problem! |
|
After exploring this more, this will need additional work to handle RTL, as well as other indexing issues. |
|
This resolves the crash portion of backspacing in Chinese and some RTL keyboards, but I have discovered some (existing, non-crashing) incompatibility when backspacing using the chinese keyboard on mixed RTL/LTR text. I will resolve that behavior in a separate PR. This change should not cause any behavior regressions other than eliminating crashes. |
justinmc
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 👍
Do we have a way to log a warning when the index is out of bounds in clampIndexToEditable? I just figure we might want to know if that happens since it could indicate a bug elsewhere, even if this is able to recover.
shell/platform/android/io/flutter/plugin/editing/InputConnectionAdaptor.java
Outdated
Show resolved
Hide resolved
|
Fixes flutter/flutter#33642 |
flutter/engine@20d3861...05c034e git log 20d3861..05c034e --no-merges --oneline 05c034e Update component manifests for ambient replace-as-executable (flutter/engine#9350) 66022ce Roll src/third_party/skia 55091020435c..4b203ad7ac02 (6 commits) (flutter/engine#9352) fcff2d6 Use the DartServiceIsolate status callback to publish the observatory URI to the Android embedder (flutter/engine#9337) ea7ca98 Send the isolate service ID from the engine to the embedder (flutter/engine#9324) 675033f Check for invalid indexes when performing InputAdpator backspace. (flutter/engine#9322) e5918d1 Roll src/third_party/skia 92b81e14d9c2..55091020435c (6 commits) (flutter/engine#9348) e00ac47 Reorganize darwin for shared ios/macOS (flutter/engine#9255) 9da409c Fix crash on Huawei device with AndroidView (flutter/engine#9192) a0f8554 Removed an unused class definition for iOS code. (flutter/engine#9346) 96a1a84 Replace lock_guard with scoped_lock and use class template argument deduction. (flutter/engine#9338) The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md If the roll is causing failures, please contact the current sheriff (liyuqian@google.com), and stop the roller if necessary.
flutter/engine@20d3861...05c034e git log 20d3861..05c034e --no-merges --oneline 05c034e Update component manifests for ambient replace-as-executable (flutter/engine#9350) 66022ce Roll src/third_party/skia 55091020435c..4b203ad7ac02 (6 commits) (flutter/engine#9352) fcff2d6 Use the DartServiceIsolate status callback to publish the observatory URI to the Android embedder (flutter/engine#9337) ea7ca98 Send the isolate service ID from the engine to the embedder (flutter/engine#9324) 675033f Check for invalid indexes when performing InputAdpator backspace. (flutter/engine#9322) e5918d1 Roll src/third_party/skia 92b81e14d9c2..55091020435c (6 commits) (flutter/engine#9348) e00ac47 Reorganize darwin for shared ios/macOS (flutter/engine#9255) 9da409c Fix crash on Huawei device with AndroidView (flutter/engine#9192) a0f8554 Removed an unused class definition for iOS code. (flutter/engine#9346) 96a1a84 Replace lock_guard with scoped_lock and use class template argument deduction. (flutter/engine#9338) The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md If the roll is causing failures, please contact the current sheriff (liyuqian@google.com), and stop the roller if necessary.
Selection.getSelectionStartcan return -1, which causes an index out of bounds. In the case of a invalid deletion, unspecifiable selections will not be deleted.b/135036951
Fixes flutter/flutter#33642