Repository: flutter
Issue: Incorrect gesture received on native side via platform views.
Labels: platform-android,framework,f: gestures,a: platform-views,has reproducible steps,P2,found in release: 2.8,found in release: 2.9,team-android,triaged-android

<!-- Thank you for using Flutter!

     If you are looking for support, please check out our documentation
     or consider asking a question on Stack Overflow:
      * https://flutter.dev/
      * https://api.flutter.dev/
      * https://stackoverflow.com/questions/tagged/flutter?sort=frequent

     If you have found a bug or if our documentation doesn't have an answer
     to what you're looking for, then fill out the template below. Please read
     our guide to filing a bug first: https://flutter.dev/docs/resources/bug-reports
-->

## Steps to Reproduce

<!-- Please include full steps to reproduce so that we can reproduce the problem. -->

1. Execute `flutter run` in the code sample's example folder, and two native android `Button`s will be shown.
2. Tap down and hold "Button1" with one finger.
3. Tap down and hold "Button2" with another finger.
4. Move the first finger away from "Button1".
5. Tap down and hold "Button1".
6. Move the finger away from "Button1" again.

**Expected results:** <!-- what did you want to see? -->
The first 4 steps behave normally. However, step 5 should make "Button1" get pressed, and step 6 should make "Button1" released.

**Actual results:** <!-- what did you see? -->
On step 5, when my finger is tapping on "Button1", "Button1" is not tapped!  And on step 6, when my finger moves away from "Button1", "Button2" is released! As shown clearly in the gif below:

![flutter-platform-view-multi-tap-test](https://user-images.githubusercontent.com/13847926/149443220-edbca205-c988-4534-9443-13a5e06a8b67.gif)


So, I know this may be related to the fact that platform views only use OneSequenceGestureRecognizers as they support gesture arena teams. However, I believe the above steps can certainly be considered as a single sequence.

<details>
<summary>Code sample</summary>

<!--
      Please create a minimal reproducible sample that shows the problem
      and attach it below between the lines with the backticks.

      To create it you can use `flutter create bug` command and update the `main.dart` file.

      Alternatively, you can use https://dartpad.dev/
      which is capable of creating and running small Flutter apps.

      Without this we will unlikely be able to progress on the issue, and because of that
      we regretfully will have to close it.
-->

A minimal example can be found in this example plugin: https://github.com/orenwang/flutter_platform_view_multi_tap_test

</details>

<details>
  <summary>Logs</summary>

<!--
      Run your application with `flutter run --verbose` and attach all the
      log output below between the lines with the backticks. If there is an
      exception, please see if the error message includes enough information
      to explain how to solve the issue.
-->

```
[   +7 ms] Connected to _flutterView/0x71e4392a20.
[   +3 ms] Flutter run key commands.
[   +1 ms] r Hot reload. 🔥🔥🔥
[   +1 ms] R Hot restart.
[        ] h List all available interactive commands.
[        ] d Detach (terminate "flutter run" but leave application running).
[        ] c Clear the screen
[        ] q Quit (terminate the application on the device).
[        ] 💪 Running with sound null safety 💪
[        ] An Observatory debugger and profiler on PAR AL00 is available at:
           http://127.0.0.1:60763/D6HrEoR8obg=/
[ +208 ms] D/TextView(23124): get Display Panel Type is : 0
[ +589 ms] The Flutter DevTools debugger and profiler on PAR AL00 is available
at:

http://127.0.0.1:9101?uri=http://127.0.0.1:60763/D6HrEoR8obg=/
[   +1 ms] W/ap_test_exampl(23124): Accessing hidden method
Landroid/media/ImageReader;->newInstance(IIIIJ)Landroid/media/ImageReader; (dark
greylist, linking)
[   +2 ms] W/libEGL  (23124): EGLNativeWindowType 0x71c68a9010 disconnect failed
[        ] D/mali_winsys(23124): EGLint new_window_surface(egl_winsys_display *,
void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
[  +24 ms] D/mali_winsys(23124): EGLint new_window_surface(egl_winsys_display *,
void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
[  +34 ms] E/ion     (23124): ioctl c0044901 failed with code -1: Invalid
argument
[ +105 ms] I/ViewRootImpl(23124): jank_removeInvalidNode jank list is null
[+1751 ms] W/Settings(23124): Setting device_provisioned has moved from
android.provider.Settings.Secure to android.provider.Settings.Global.
[   +1 ms] V/HiTouch_HiTouchSensor(23124): User setup is finished.
[ +487 ms] D/AwareBitmapCacher(23124): handleInit switch not opened pid=23124
[ +757 ms] W/HiTouch_PressGestureDetector(23124): HiTouch Miss: Too large time
interval(TwoFingers), 1248
[ +289 ms] I/ap_test_exampl(23124): Starting profile saver IsSaveProfileNow end.
[ +893 ms] W/HiTouch_PressGestureDetector(23124): Touch pointer move a lot. The
moving distance of X is:305.71692, limit is:60The moving distance of Y
is:15.993164, limit is:60
[+1221 ms] W/HiTouch_PressGestureDetector(23124): HiTouch Miss: Too large time
interval(TwoFingers), 3637
[+3253 ms] W/InputMethodManager(23124): startInputReason = 8
[ +345 ms] D/ZrHung.AppEyeUiProbe(23124): stop checker.
[ +223 ms] D/ViewRootImpl[MainActivity](23124): surface should not be released
[  +29 ms] D/ZrHung.AppEyeUiProbe(23124): Current Activity:false
[        ] D/ZrHung.AppEyeUiProbe(23124): not watching, wait.
[ +251 ms] W/libEGL  (23124): EGLNativeWindowType 0x71c68a8010 disconnect failed
[  +30 ms] V/ActivityThread(23124): Handle window ActivityRecord{836d7fd
token=android.os.BinderProxy@4d67819
{com.example.flutter_platform_view_multi_tap_test_example/com.example.flutter_pl
atform_view_multi_tap_test_example.MainActivity}} visibility: false
[+4440 ms] D/ZrHung.AppEyeUiProbe(23124): notify runnable to start.
[   +1 ms] D/ZrHung.AppEyeUiProbe(23124): restart watching
[   +9 ms] D/mali_winsys(23124): EGLint new_window_surface(egl_winsys_display *,
void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
[  +19 ms] E/BpSurfaceComposerClient(23124): Failed to transact (-1)
[   +2 ms] E/BpSurfaceComposerClient(23124): Failed to transact (-1)
[  +76 ms] I/ViewRootImpl(23124): jank_removeInvalidNode all the node in jank
list is out of time
[  +43 ms] W/InputMethodManager(23124): startInputReason = 1
[+1388 ms] DevFS: Deleting filesystem on the device
(file:///data/user/0/com.example.flutter_platform_view_multi_tap_test_example/co
de_cache/exampleREIRUL/example/)
[  +20 ms] DevFS: Deleted filesystem on the device
(file:///data/user/0/com.example.flutter_platform_view_multi_tap_test_example/co
de_cache/exampleREIRUL/example/)
[  +10 ms] executing: /Users/orenwang/Library/Android/sdk/platform-tools/adb -s
FJH7N18802004159 shell am force-stop
com.example.flutter_platform_view_multi_tap_test_example
[ +397 ms] Application finished.
[  +25 ms] "flutter run" took 61,431ms.
[  +36 ms] Service protocol connection closed.
[  +90 ms] ensureAnalyticsSent: 118ms
[   +1 ms] Running shutdown hooks
[        ] Shutdown hooks complete
[        ] exiting with code 0
```

<!--
     Run `flutter analyze` and attach any output of that command below.
     If there are any analysis errors, try resolving them before filing this issue.
-->

```
Analyzing flutter_platform_view_multi_tap_test...                       
No issues found! (ran in 2.2s)
```

<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
[✓] Flutter (Channel stable, 2.8.1, on macOS 12.0.1 21A559 darwin-arm, locale
    en-CN)
    • Flutter version 2.8.1 at /Users/orenwang/Downloads/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 77d935af4d (4 weeks ago), 2021-12-16 08:37:33 -0800
    • Engine revision 890a5fca2e
    • Dart version 2.15.1

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/orenwang/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • ANDROID_HOME = /Users/orenwang/Library/Android/sdk
    • Java binary at: /Users/orenwang/Downloads/Android
      Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2020.3)
    • Android Studio at /Users/orenwang/Downloads/Android Studio
      Preview.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)

[✓] Android Studio (version 2020.3)
    • Android Studio at /Users/orenwang/Downloads/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[✓] VS Code (version 1.63.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.32.0

[✓] Connected device (3 available)
    • PAR AL00 (mobile)         • FJH7N18802004159 • android-arm64  • Android 9
      (API 28)
    • sdk gphone arm64 (mobile) • emulator-5554    • android-arm64  • Android 11
      (API 30) (emulator)
    • Chrome (web)              • chrome           • web-javascript • Google
      Chrome 97.0.4692.71

• No issues found!
```

</details>


<!--
      Consider also attaching screenshots and/or videos to better
      illustrate the issue.

      You can upload them directly on GitHub.
      Beware that video file size is limited to 10MB.
-->