This change reverts https://github.com/flutter/engine/pull/15900. The
design of the expected consumer of the original PR changed, and the
feature ended up going unused. Since the unexpected difference in trace
event routing behavior has mostly ended up as a source of confusion,
change things back to route trace events to Fuchsia system tracing on
all configurations.
## Description
As the related issue refer, the application may be doing too much work on its main thread even in a simple hello_world demo.
That is because the creation of `Engine` on the ui thread takes a noticeable time, and it is blocking the platform thread in order to run `Shell::Setup` synchronously.
The cost of `Engine`'s constructor is mainly about the creating of root isolate. Actually, there used to be another time-consuming process, the default font manager setup, which was resolved by https://github.com/flutter/engine/pull/18225.
Similar to https://github.com/flutter/engine/pull/18225, this pr move the creation of root isolate out from creating `Engine`. After this action, the main thread blocking is quite an acceptable slice.
## Related Issues
https://github.com/flutter/flutter/issues/40563 could be resolved by this pr.
The C++ wrapper makes heavy use of templates to support arbitrary types
in the platform channel classes, but in practice EncodableValue is what
essentially all code will use. This defaults those template types to
reduce boilerplate in plugin code (e.g., allowing the use of
MethodChannel<> instead of MethodChannel<EncodableValue>).
If the InputConnectionAdaptor receives a key event that does not move
the caret or produce a text character (such as the back button), then
the event should be given to the EventResponder which will forward it
to the view.
Fixes https://github.com/flutter/flutter/issues/64864
This re-lands the key event synthesis implementation for Android (Original PR: #19024, Revert PR: #19956). The only difference is sending the synthesized key events to the root view instead of the current view.
Without sending it to the root view, the system doesn't have any chance of handling keys like the back button. The event will still not be sent to the framework twice, since we turn off event propagation while re-dispatching the event.
AccessibilityBridge installs various listeners for Android events
that invoke Flutter engine APIs. These listeners are removed in
AccessibilityBridge.release. However, in some environments there may
be deferred calls to the listener that will still execute even after
the listener has been removed. This change sets a flag during release
and ignores any listener invocations that happen after the flag is set.
See https://github.com/flutter/flutter/issues/63555 and
https://github.com/flutter/engine/pull/17311
This is a Fuchsia-only shell test, confirming that when the timezone
setting is changed on the realm via Fuchsia's FIDL interface
`fuchsia.settings.Intl`, the Dart isolate running in that realm receives
the change and starts reporting the appropriate timestamp.
We already have a [similar test][tst] that verifies the timezones in the
dart VM matches the local timezone at start, but there was no test that
also verified timezone changes.
[tst]: https://github.com/flutter/engine/blob/master/shell/common/shell_unittests.cc#L1166
See issue #61284
The data race: gl_surface_fbo_frame_infos_ in the test context to was appended
to on the raster task runner but read on the platform task runner. This is now
sidestepped by using a callback and pushing that responsibility to the test.
Setting the callback is guarded behind a mutex.
The race condition: The assertions were previously run when the UI thread was
done generating the frames. However, the assertions were run on the results
collected on the raster thread in response the frame requests from UI thread.
Just run the assertions on the raster thread directly.
Fixes https://github.com/flutter/flutter/issues/64344
* Add native stacktrace on iOS
* Add native stacktrace on Android
* format and changing naming to errorWithCode on iOS
* reformat
* Remove stacktrace from decodeEnvelope, not needed.
* Separate encodeErrorEnvelopeWithStacktrace with original encode function
* Add unit tests
* re-format
* change comments for stacktrace
* Remove changes for iOS
Co-authored-by: Ben Li <libe@google.com>