Repository: flutter
Issue: Native didn't receive data that sent from dart by method channel when running dart code as background service.
Labels: platform-android,engine,a: existing-apps,P2,team-android,triaged-android

## Steps to Reproduce

1. Execute `flutter run` on the code sample (Test on Android) <!-- (see "Code sample" section below) -->
2. Tap the "Run" quick settings tile.
3. See the output logs.

**Actual results:** <!-- what did you see? -->
Native invoke dart  ✔️
Dart invoke or response to native  ❌

**Code sample**
[method_channel.zip](https://github.com/flutter/flutter/files/8546402/method_channel.zip)

<details>
  <summary>Logs</summary>

```
√  Built build\app\outputs\flutter-apk\app-debug.apk.
Connecting to VM Service at ws://127.0.0.1:2175/qV7EKhFyCG4=/ws
V/ImeFocusController(22589): onWindowFocus: DecorView@454dfe5[MainActivity] softInputMode=STATE_UNSPECIFIED|ADJUST_RESIZE|IS_FORWARD_NAVIGATION
V/ImeFocusController(22589): Restarting due to isRestartOnNextWindowFocus as true
D/ImeFocusController(22589): onViewFocusChanged, view=DecorView@454dfe5[MainActivity], mServedView=null
V/ImeFocusController(22589): checkFocus: view=null next=DecorView@454dfe5[MainActivity] force=true package=<none>
D/BackgroundTileService(22589): BackgroundTileService::onClick
D/BackgroundTileService(22589): BackgroundService.runTask()
D/BackgroundService(22589): BackgroundService::onCreate
D/BackgroundService(22589): BackgroundService::onStartCommand
D/BackgroundService(22589): waiting dart service initialing...
I/flutter (22589): dart: start dart service
I/flutter (22589): dart: service initialized, notify native...
I/.method_channe(22589): Thread[4,tid=22594,WaitingInMainSignalCatcherLoop,Thread*=0x7317f75f50,peer=0x13200228,"Signal Catcher"]: reacting to signal 3
I/.method_channe(22589):
I/.method_channe(22589): Wrote stack traces to tombstoned
Lost connection to device.
Exited (sigterm)
```

```
flutter analyze
Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
Analyzing method_channel...
No issues found! (ran in 1.8s)
```

<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
flutter doctor -v
Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
[✓] Flutter (Channel stable, 2.10.4, on Microsoft Windows [Version 10.0.22000.613], locale zh-CN)
    • Flutter version 2.10.4 at D:\SDK\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision c860cba910 (4 weeks ago), 2022-03-25 00:23:12 -0500
    • Engine revision 57d3bac3dd
    • Dart version 2.16.2
    • DevTools version 2.9.2
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://storage.flutter-io.cn

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at D:\SDK\Android
    • Platform android-31, build-tools 31.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6842174)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[✗] Visual Studio - develop for Windows
    ✗ Visual Studio not installed; this is necessary for Windows development.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components

[✓] Android Studio (version 4.2)
    • Android Studio at C:\Program Files\Android\Android Studio
    • 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.8+10-b944.6842174)

[✓] VS Code (version 1.66.2)
    • VS Code at C:\Users\xx\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.38.1

[✓] Connected device (4 available)
    • V2055A (mobile)   • 9582057945004TE • android-arm64  • Android 12 (API 31)
    • Windows (desktop) • windows         • windows-x64    • Microsoft Windows [Version 10.0.22000.613]
    • Chrome (web)      • chrome          • web-javascript • Google Chrome 100.0.4896.127
    • Edge (web)        • edge            • web-javascript • Microsoft Edge 100.0.1185.44

[☠] HTTP Host Availability (the doctor check crashed)
    ✗ Due to an error, the doctor check did not complete. If the error message below is not helpful, please let us know about this issue at https://github.com/flutter/flutter/issues.
    ✗ HandshakeException: Connection terminated during handshake
    •

! Doctor found issues in 2 categories.
```

</details>