This fixes potential race condition when patch gets downloaded on top
of zip file that's currently in active use by resource extractor and/or
asset manager. This change is necessary since download can happen in
the background while normal application operations are in progress.
This is a no-op change, except for fixing a bug where download task
reference wasn't cleared after download was completed.
This change also removes call to output stream flush(), which is not
necessary according to Java spec.
The rest of the change deals with requiring the code to work directly
with ResourceUpdater object instead of having FlutterMain be a facade
that forwards some of ResourceUpdater's methods. This simplifies the
other (more essential) upcoming changes that will be landing in the
followings few PRs.
This change introduces manifest properties that control when dynamic patches are downloaded and installed in the application lifecycle.
Application developer can choose whether between install on restart, install on resume, or immediate forced install of dynamic patches.
Minor refactoring of dynamic patching code.
- Changes naming of manifest properties to be consistent with documentation.
- Moves methods from inner class to outer class to make them more reusable.
This replicates similar logic found in ApkAssetProvider that locates assets by their short name in a sudbirectory inside of an archive file, instead of only at the root of archive.
When the app is sent to the background and then brought to the forward it is possible that the GrContext was changed.
This resulted in overlay surfaces not being updated after being backgrounded and foregrounded.
This change makes sure to re-create the overlay rendering surfaces if the GrContext for the main surface was changed.
fixesflutter/flutter#24900
This re-lands commit 94b7921, with a few fixes:
- Keep the DelayingGestureRecognizer a discrete gesture recognizer, when it was set to a began state embedded WkWebViews wasn't receiving touch events.
- Fix a bug of not retaining the forwardRecognizer pointer when assigning it to a scoped_nsobject.
Unique patch numbers are mainly useful for canary and A-B testing, but otherwise complicate things and can now be omitted.
Also, always append .zip to patch download URL. This obviates the need to configure redirects on the server when not using patch numbers.
Previously the framework could only tell the engine to forward a touch
sequence to an embeded UIView between the time touches has started and
the time touches ended. This couldn't support gesture arena setups where
the gesture is recognized after the touch sequence is complete (e.g a
tap competing with a scroll).
This change makes it so that a touch gesture is only finally rejected by
a platform view when the framework invokes the `rejectGesture` method.
This allows the framework to resolve a gesture conflict after the touch
sequence was ended.
Consistently handle Int32/Int64 types on both 32-bit and 64-bit versions
of iOS. Drop usage of the obsolete hex string encoding for BigInt types.
Fixes https://github.com/flutter/flutter/issues/21313
In cases where a valid IsolateConfiguration cannot be inferred, (e.g.,
settings.kernel_list_asset is missing) RunConfiguration can be created
with a null IsolateConfiguration. In such cases, bail out early with
kInvalidSettings.
Also adds a redundant paranoid check to EmbedderEngine::Run.
As of the migration to Dart 2, it has been necessary to compile Dart to
kernel prior to execution. The embedder currently requires that the
resulting kernel file be named `kernel_blob.bin` and be located at the
root of the assets directory passed to the embedder API.
This patch updates the test_fixtures build rule to perform a kernel
compile using frontend_server, outputting `kernel_blob.bin` to
`fixtures/test_target_name` directory, and updates the embedder
unittests to specify the kernel file rather than the Dart source file.
Since the kernel compiler requires a `main()` function to be defined, it
also updates `simple_main.dart` from runtime_unittests to define
`main()` rather than `simple_main()`.
This also updates all existing sub-targets to be testonly.
This relands commit 4e4fb4608da95d198b0e796478462285ab974a3c, which was
reverted in commit 566db0ecb8f293bb9f7ff1fc39076b08336e0148. Rather than
running as prebuilt_dart_action, we use dart_action to ensure the
frontend snapshot it compatible with the VM on which it's executed.
This reverts commit 4e4fb4608da95d198b0e796478462285ab974a3c.
This broke dynamic release mode builds of
//flutter/runtime:runtime_fixtures_kernel (likely all product-mode
builds).
Compile embedder unit test Dart to kernel
As of the migration to Dart 2, it has been necessary to compile Dart to
kernel prior to execution. The embedder currently requires that the
resulting kernel file be named `kernel_blob.bin` and be located at the
root of the assets directory passed to the embedder API.
This patch updates the test_fixtures build rule to perform a kernel
compile using frontend_server, outputting `kernel_blob.bin` to
`fixtures/test_target_name` directory, and updates the embedder
unittests to specify the kernel file rather than the Dart source file.
Since the kernel compiler requires a `main()` function to be defined, it
also updates `simple_main.dart` from runtime_unittests to define
`main()` rather than `simple_main()`.
This also updates all existing sub-targets to be testonly.
* Support real fonts in 'flutter test'
Change the order of font_managers to query in font_collection
so that dynamic_font_manager fonts will be resolved.
Tested with test case in `flutter/flutter` repo:
`packages/flutter/test/rendering/localized_fonts_test.dart`
Ensured:
- A font loaded with FontLoader will be used
- The default 'Ahem' font is still loaded by default
The test above still cannot be fixed because FontLoader and the
underlying mechanisms don't cover Locale-specific font loading
and therefore a CJK font-family won't be able to be loaded as needed
for that test.
Fixes#17700
* Format fixup
libtrace-provider has libtrace listed as a dependency when really it
does not have any such dependency. This lets trace clients use
libtrace-provider as a dependency when what they really mean is libtrace.
This errant dependency in trace-provider is being fixed, which
means we need to fix these clients.
After bumping the targetSdk of Flutter apps to 28, the keyboard doesn't open anymore when inputting text on an Android Pie devices. The problem is caused by a change on the way the focus in handled: when the call `mImm.showSoftInput(view, 0);` is made, the currently focused view is the `DecorView` from the `Activity` hosting Flutter but the passed view reference (`view` argument) is the `FlutterView`. As the `InputMethodManager` checks if both views are the same before showing the keyboard, it never appears because the `FlutterView` never has focus.
As Flutter doesn't have any input views as far as the Android side is concerned, the focus should always stay on the `FlutterView` itself and thus, this PR changes the `TextInputPlugin` to focus on the `FlutterView` as soon as it's created, fixing the keyboard issue.
Co-authored-by: Igor Borges <igorborges12@gmail.com>
Technically both of these are part of the public API exposed in
Flutter.framework. Neither is used within Flutter itself, and both have
been broken since the removal of Dart 1 support, so eliminating rather
than marking unavailable.