Jonah Williams d11db4f8c9 [engine] support combined UI/Platform thread for iOS/Android. (flutter/engine#53656)
Experimentally support merging UI and platform thread on Android/iOS. This works by changing the shell holder to set the UI thread to the platform thread. Several shell APIs that post messages from the platform to ui thread were changed to use RunNowOrPostTask to immediately call the UI task if the threads are the same.

Experimentally, this seems to work reasonably well if there are no platform views. On Android with TLHC it works fine either way, while iOS currently takes a big performance hit.

This can be opted into via a Plist:

```
	<key>FLTEnableMergedPlatformUIThread</key>
	<true/>
```

Or via AndroidManifest.xml:

```
 <meta-data
            android:name="io.flutter.embedding.android.EnableMergedPlatformUIThread"
            android:value="true" />
```

https://github.com/flutter/flutter/issues/150525
2024-07-09 19:32:20 +00:00
..