Repository navigation
Fix crash on multi-finger gesture (#69431) - #78874
ThexXTURBOXx wants to merge 1 commit into
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat. If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
|
In which file should the test be added? It is not very trivial to hit the new Or rather: Does this PR even need a test? Line 573 in the same file is not tested either on |
|
This should definitely have a test. Ideally we should also add a test for any other lines in that file lacking coverage. |
|
|
||
| // These arrays must have same length, otherwise below 'AndroidMotionEvent' constructor | ||
| // will throw an exception. | ||
| if (pointers.length != pointerProperties.length || pointers.length != pointerPositions.length) { |
There was a problem hiding this comment.
If these arrays must have the same length, we should assert that here, rather than ignoring them when they don't, and then we should go into the relevant engine code (flutter/engine repo) and make sure we never generate lists with inconsistent lengths.
|
@Hixie So, I found two other possible approaches to this problem. I am not sure, if these are the right way to tackle this, but they also get the job done. Please let me know if one of these is better than the current approach. Approach 1The fault seems to be, that if (pointerProperties[event.pointer] != null) {
// or pointerProperties.keys.contains(event.pointer), don't know what's better
...
}There is however one downside to this approach: Since the // A pointer event seems to have been cancelled and therefore, no motion event
// can be created.
if (downTimeMillis == null) {
return null;
}Approach 2Since the final List<int> pointers = pointerProperties.keys.toList();However, also in this case the Approach 3See this PR's commit |
|
This is the wrong repo to fix this. It should be fixed in the Android-specific code in the flutter/engine repo. The framework is supposed to be able to rely on a coherent set of messages from the engine. |
|
I tried looking into the engine, but I don't have enough faith in my knowledge with this kind of native stuff. So, sadly my journey ends here and anyone else has to look into this, but thank you! :/ |
After debugging and looking at the log output, I don't think it's the engine problem, but the system Rom problem. The changed code of
|
|
As far as I can see, this is nothing new as I already debugged this and described the behavior in the issue itself. Thank you anyways for debugging and veifiying that the underlying issue is the same on your device. |
The reason for the detailed log instructions is to explain to Ian Hickson that this is not an engine error, but the phone manufacturer changed the system, which caused the three finger operation did not send out the correct event, so flutter should incorporate this modified code to solve the compatibility problem. Of course, other solutions can also be adopted. Anyway, I hope this problem can be solved as soon as possible. |


This PR fixes crashes on certain devices when doing a multi-finger gesture.
Fixes #69431
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.