-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mitigation for Samsung TextInput Hangs #35967
Conversation
This pull request was exported from Phabricator. Differential Revision: D42721684 |
Base commit: a8166bd |
This pull request was exported from Phabricator. Differential Revision: D42721684 |
Summary: Pull Request resolved: facebook#35967 In facebook#35936 we observed that the presence of AbsoluteSizeSpan may lead to hangs when using the Grammarly keyboard on Samsung. This mitigation makes it so that we do not emit this span in the most common cases, when it is sufficient to set `android:textSize`. In simple cases, it causes typing into the TextInput to no longer hang. This does not resolve the issue for TextInputs which meaningfully use layout-effecting spans (or at least font size), such as non-uniform text size within the input. We could potentially do further work to reduce the number of spans emitted in these scenarios, but this may be fighting a losing battle against the platform. Changelog: [Android][Fixed] - Partial Mitigation for Samsung TextInput Hangs (Paper) Reviewed By: cortinico Differential Revision: D42721684 fbshipit-source-id: 1b6935014c8055c3bd547c7ba5294bb9975479c2
da23fdf
to
3dcd5c8
Compare
FYI to anyone observing, I pushed a new version of this which should be better than the first. |
Summary: Pull Request resolved: facebook#35967 In facebook#35936 we observed that the presence of AbsoluteSizeSpan may lead to hangs when using the Grammarly keyboard on Samsung. This mitigation makes it so that we do not emit this span in any case where it is sufficient to rely on already set EditText textSize. In simple cases, tested on two devices, it causes typing into the TextInput to no longer hang. This does not fully resolve the issue for TextInputs which meaningfully use layout-effecting spans (or at least font size), such as non-uniform text size within the input. We instead just try to reduce to minimum AbsoluteSizeSpan possible. Testing the first commit was able to resolve hangs in some simpler inputs tested, by me and cortinico. Changelog: [Android][Fixed] - Mitigation for Samsung TextInput Hangs Reviewed By: cortinico Differential Revision: D42721684 fbshipit-source-id: ec15bf996a6918cadbb53f9d371281e83bb6208e
3dcd5c8
to
d45142a
Compare
This pull request was exported from Phabricator. Differential Revision: D42721684 |
Summary: Pull Request resolved: facebook#35967 In facebook#35936 we observed that the presence of AbsoluteSizeSpan may lead to hangs when using the Grammarly keyboard on Samsung. This mitigation makes it so that we do not emit this span in any case where it is sufficient to rely on already set EditText textSize. In simple cases, tested on two devices, it causes typing into the TextInput to no longer hang. This does not fully resolve the issue for TextInputs which meaningfully use layout-effecting spans (or at least font size), such as non-uniform text size within the input. We instead just try to reduce to minimum AbsoluteSizeSpan possible. Testing the first commit was able to resolve hangs in some simpler inputs tested, by me and cortinico. Changelog: [Android][Fixed] - Mitigation for Samsung TextInput Hangs Reviewed By: cortinico Differential Revision: D42721684 fbshipit-source-id: 000a8ceb0200abb19a2aa77cdb78276d289c3115
This pull request was exported from Phabricator. Differential Revision: D42721684 |
d45142a
to
14adf07
Compare
This pull request has been merged in be69c8b. |
Thank you for trying to fix the multiline ANRs on Samsung devices with Android 13. I built with this patch, however, and our app still hangs after a while of typing. |
Summary: Pull Request resolved: #35967 In #35936 we observed that the presence of AbsoluteSizeSpan may lead to hangs when using the Grammarly keyboard on Samsung. This mitigation makes it so that we do not emit this span in any case where it is sufficient to rely on already set EditText textSize. In simple cases, tested on two devices, it causes typing into the TextInput to no longer hang. This does not fully resolve the issue for TextInputs which meaningfully use layout-effecting spans (or at least font size), such as non-uniform text size within the input. We instead just try to reduce to minimum AbsoluteSizeSpan possible. Testing the first commit was able to resolve hangs in some simpler inputs tested, by me and cortinico. Changelog: [Android][Fixed] - Mitigation for Samsung TextInput Hangs Reviewed By: cortinico Differential Revision: D42721684 fbshipit-source-id: e0388dfb4617f0217bc1d0b71752c733e10261dd
Summary: Pull Request resolved: #35967 In #35936 we observed that the presence of AbsoluteSizeSpan may lead to hangs when using the Grammarly keyboard on Samsung. This mitigation makes it so that we do not emit this span in any case where it is sufficient to rely on already set EditText textSize. In simple cases, tested on two devices, it causes typing into the TextInput to no longer hang. This does not fully resolve the issue for TextInputs which meaningfully use layout-effecting spans (or at least font size), such as non-uniform text size within the input. We instead just try to reduce to minimum AbsoluteSizeSpan possible. Testing the first commit was able to resolve hangs in some simpler inputs tested, by me and cortinico. Changelog: [Android][Fixed] - Mitigation for Samsung TextInput Hangs Reviewed By: cortinico Differential Revision: D42721684 fbshipit-source-id: e0388dfb4617f0217bc1d0b71752c733e10261dd
Summary: Pull Request resolved: #35967 In #35936 we observed that the presence of AbsoluteSizeSpan may lead to hangs when using the Grammarly keyboard on Samsung. This mitigation makes it so that we do not emit this span in any case where it is sufficient to rely on already set EditText textSize. In simple cases, tested on two devices, it causes typing into the TextInput to no longer hang. This does not fully resolve the issue for TextInputs which meaningfully use layout-effecting spans (or at least font size), such as non-uniform text size within the input. We instead just try to reduce to minimum AbsoluteSizeSpan possible. Testing the first commit was able to resolve hangs in some simpler inputs tested, by me and cortinico. Changelog: [Android][Fixed] - Mitigation for Samsung TextInput Hangs Reviewed By: cortinico Differential Revision: D42721684 fbshipit-source-id: e0388dfb4617f0217bc1d0b71752c733e10261dd
Summary: Pull Request resolved: #35967 In #35936 we observed that the presence of AbsoluteSizeSpan may lead to hangs when using the Grammarly keyboard on Samsung. This mitigation makes it so that we do not emit this span in any case where it is sufficient to rely on already set EditText textSize. In simple cases, tested on two devices, it causes typing into the TextInput to no longer hang. This does not fully resolve the issue for TextInputs which meaningfully use layout-effecting spans (or at least font size), such as non-uniform text size within the input. We instead just try to reduce to minimum AbsoluteSizeSpan possible. Testing the first commit was able to resolve hangs in some simpler inputs tested, by me and cortinico. Changelog: [Android][Fixed] - Mitigation for Samsung TextInput Hangs Reviewed By: cortinico Differential Revision: D42721684 fbshipit-source-id: e0388dfb4617f0217bc1d0b71752c733e10261dd
Summary: Pull Request resolved: facebook#35967 In facebook#35936 we observed that the presence of AbsoluteSizeSpan may lead to hangs when using the Grammarly keyboard on Samsung. This mitigation makes it so that we do not emit this span in any case where it is sufficient to rely on already set EditText textSize. In simple cases, tested on two devices, it causes typing into the TextInput to no longer hang. This does not fully resolve the issue for TextInputs which meaningfully use layout-effecting spans (or at least font size), such as non-uniform text size within the input. We instead just try to reduce to minimum AbsoluteSizeSpan possible. Testing the first commit was able to resolve hangs in some simpler inputs tested, by me and cortinico. Changelog: [Android][Fixed] - Mitigation for Samsung TextInput Hangs Reviewed By: cortinico Differential Revision: D42721684 fbshipit-source-id: e0388dfb4617f0217bc1d0b71752c733e10261dd
Summary: Pull Request resolved: facebook#35967 In facebook#35936 we observed that the presence of AbsoluteSizeSpan may lead to hangs when using the Grammarly keyboard on Samsung. This mitigation makes it so that we do not emit this span in any case where it is sufficient to rely on already set EditText textSize. In simple cases, tested on two devices, it causes typing into the TextInput to no longer hang. This does not fully resolve the issue for TextInputs which meaningfully use layout-effecting spans (or at least font size), such as non-uniform text size within the input. We instead just try to reduce to minimum AbsoluteSizeSpan possible. Testing the first commit was able to resolve hangs in some simpler inputs tested, by me and cortinico. Changelog: [Android][Fixed] - Mitigation for Samsung TextInput Hangs Reviewed By: cortinico Differential Revision: D42721684 fbshipit-source-id: e0388dfb4617f0217bc1d0b71752c733e10261dd
Summary
In #35936 we observed that the presence of AbsoluteSizeSpan may lead to hangs when using the Grammarly keyboard on Samsung.
This mitigation makes it so that we do not emit this span in any case where it is sufficient to rely on already set EditText textSize. In simple cases, tested on two devices, it causes typing into the TextInput to no longer hang.
This does not fully resolve the issue for TextInputs which meaningfully use layout-effecting spans (or at least font size), such as non-uniform text size within the input. We instead just try to reduce to minimum AbsoluteSizeSpan possible.
Testing the first commit was able to resolve hangs in some simpler inputs tested, by me and @cortinico.
Test Plan
For Paper and Fabric, debugged the flow through the algorithm over several examples, along with the effect on underlying TextInput spannable (observed indirectly by text updates).
Changelog:
[Android][Fixed] - Mitigation for Samsung TextInput Hangs
Reviewed By: cortinico
Differential Revision: D42721684