3051 Commits

Author SHA1 Message Date
Dan Field
a9728ab07a Make IOManager own resource context (flutter/engine#7272)
* Make IOManager own resource context
2019-01-14 13:46:38 -08:00
Chris Bracken
8689c7f8e6 Stop pumping frames in applicationWillResignActive (flutter/engine#7450)
According to Apple's [OpenGL ES Programming guide][1], applications
should pause any animations in applicationWillResignActive. Any GL calls
after applicationDidEnterBackground will cause the app to be terminated
immedidately by iOS.

The surfaceUpdated:YES call is moved to the handler for the
applicationDidBecomeActive notification to handle cases where the
application becomes inactive then active again without being
backgrounded (e.g. home button double-tap then return to app directly).

[1]: https://developer.apple.com/library/archive/documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/ImplementingaMultitasking-awareOpenGLESApplication/ImplementingaMultitasking-awareOpenGLESApplication.html#//apple_ref/doc/uid/TP40008793-CH5-SW1
2019-01-12 09:14:23 -08:00
Justin McCandless
67fb5e4ec6 Match the ios number input type behavior to what is said in the docs (flutter/engine#7281) 2019-01-11 10:24:00 -08:00
木士羽
c7de795701 Fix settings.advisory_script_uri in iOS createShell (flutter/engine#7235) 2019-01-10 12:09:37 -08:00
Stanislav Baranov
e82ebbd3c5 Simplify rollback of dynamic patches (flutter/engine#7432) 2019-01-09 17:29:04 -08:00
Stanislav Baranov
e4a7d30fcb Download dynamic patch to separate file, then rename it to install. (flutter/engine#7428)
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.
2019-01-09 16:26:24 -08:00
Chinmay Garde
1aa19e022b Wire up support for external OpenGL textures for the embedder. (flutter/engine#7087) 2019-01-09 15:21:39 -08:00
Chris Bracken
bf7d09f9ca Eliminate unused import of ZipException (flutter/engine#7429)
Use of this class was eliminated in https://github.com/flutter/engine/pull/7398.
2019-01-09 15:08:43 -08:00
Chinmay Garde
074da7fd65 Allow embedders to add per shell idle notification callbacks. (flutter/engine#7427) 2019-01-09 14:33:56 -08:00
Stanislav Baranov
077b1ebf23 Refactor dynamic patching to use clearer naming and structure. (flutter/engine#7426)
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.
2019-01-09 14:21:36 -08:00
Stanislav Baranov
089ea4bf10 Refactor shared code into separate function to simplify further work. (flutter/engine#7410)
This should be a no-op change that behaves identical to as before.
2019-01-08 12:44:07 -08:00
David Guralnick
d6a1bcc917 Add onStart hook to FlutterFragmentActivity (flutter/engine#6719)
Seems like this file was missed when onStart hooks were added recently in this pull request: https://github.com/flutter/engine/pull/5177
2019-01-07 17:16:06 -05:00
Dan Field
7c43b20b1d Announce in/out of list (flutter/engine#6918)
* Support in/out of list announcements on Android
2019-01-07 13:36:20 -08:00
Todd Volkert
66ab3f16bc Replace Java code with equivalent, more concise code. (flutter/engine#7398) 2019-01-07 11:28:00 -08:00
Stanislav Baranov
f63f447b47 Give more control over when dynamic patches get downloaded and installed. (flutter/engine#7327)
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.
2019-01-02 10:40:37 -08:00
Stanislav Baranov
5cc717fe86 Minor refactoring of dynamic patching code. (flutter/engine#7325)
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.
2018-12-28 13:23:38 -08:00
Stanislav Baranov
733d65dd7b Support loading flutter assets from dynamic patch (flutter/engine#7308)
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.
2018-12-28 10:34:47 -08:00
Amir Hardon
04b9885368 Recreate the overlay rendering surfaces if the GrContext was changed. (flutter/engine#7317)
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.

fixes flutter/flutter#24900
2018-12-27 16:02:00 -08:00
Amir Hardon
568b03145e Reland "Only reject gestures to embedded UIViews when the framework sa… (flutter/engine#7315)
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.
2018-12-27 13:23:36 -08:00
Stanislav Baranov
b1cf6809d1 Allow dynamic patches without a patch number. (flutter/engine#7309)
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.
2018-12-27 11:56:56 -08:00
Amir Hardon
cb964ad34f Revert "Only reject gestures to embedded UIViews when the framework says so. (#7307)" (flutter/engine#7313)
This reverts commit 94b7921b81bbebad9a90cea0bcc95c7e0a9ade60.
2018-12-27 10:22:51 -08:00
Amir Hardon
94b7921b81 Only reject gestures to embedded UIViews when the framework says so. (flutter/engine#7307)
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.
2018-12-26 22:11:10 -08:00
matthew-carroll
712911f505 Android embedding refactor PR1: JNI Extraction to FlutterJNI.java (flutter/engine#7098)
Android embedding refactor: JNI Extraction to FlutterJNI.java
2018-12-21 01:07:04 -05:00
Jason Simmons
2e112a7904 Add a system message channel for controlling the Skia resource cache size (flutter/engine#7257)
See https://github.com/flutter/flutter/issues/25244
2018-12-19 17:40:16 -08:00
Jason Simmons
4f52895770 Update usage of some Android APIs that are deprecated in API level 28 (flutter/engine#7261) 2018-12-19 17:39:53 -08:00
Jason Simmons
3c3ddb0a37 Remove unused GrContext in AndroidSurfaceGL (flutter/engine#7258) 2018-12-19 15:06:58 -08:00
Stanislav Baranov
c85ef14c19 Update dynamic patching terminilogy to match that of the flutter tool (flutter/engine#7248) 2018-12-19 10:31:54 -08:00
Dan Field
e12c087f9e Fix javadoc for Android-28 (flutter/engine#7254)
* Fix javadoc for Android-28

* build javadoc as part of pre-submit
2018-12-19 09:24:02 -08:00
Dan Field
5a59304379 Roll buildroot to support Android SDK 28 (flutter/engine#7245)
* Roll to buildroot and support Android SDK 28

* Ubuntu 16 for android build test
2018-12-18 19:38:28 -08:00
Jason Simmons
9eae3293a3 Update iOS unit test for the removal of hex string encoding of uint64 data (flutter/engine#7246) 2018-12-18 11:16:38 -08:00
Todd Volkert
70a7f91e86 Fix linter errors in ResourceUpdater (flutter/engine#7240) 2018-12-18 07:40:57 -08:00
Todd Volkert
cf3c281533 Allow inferred types using diamond syntax (flutter/engine#7237) 2018-12-17 16:35:10 -08:00
Todd Volkert
2d383262d7 Simplify nested try-with-resources statements (flutter/engine#7239) 2018-12-17 16:34:54 -08:00
Jason Simmons
1449f3af36 Fix destruction of the child object list in the iOS accessibility bridge (flutter/engine#7108)
Fixes https://github.com/flutter/flutter/issues/22206
2018-12-17 16:05:23 -08:00
Jason Simmons
5463140ef4 Simplify conversion of numeric types in the message codec on iOS (flutter/engine#7097)
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
2018-12-17 15:54:57 -08:00
Chris Bracken
fff4720f2c Verify RunConfiguration is valid before running (flutter/engine#6922)
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.
2018-12-16 14:07:42 -08:00
Jimmy Casey
0e73c0f16d Correct spelling in doc comments (flutter/engine#7179)
Applies spelling corrections to accessibility-related doc comments and in the
license tool.
2018-12-16 12:51:00 -08:00
Chris Bracken
8a0cc94b1a Compile embedder unit test Dart to kernel (flutter/engine#7231)
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.
2018-12-16 12:23:18 -08:00
Chris Bracken
566db0ecb8 Revert "Compile embedder unit test Dart to kernel (#7227)" (flutter/engine#7230)
This reverts commit 4e4fb4608da95d198b0e796478462285ab974a3c.

This broke dynamic release mode builds of
//flutter/runtime:runtime_fixtures_kernel (likely all product-mode
builds).
2018-12-15 14:43:26 -08:00
Chris Bracken
4e4fb4608d Compile embedder unit test Dart to kernel (flutter/engine#7227)
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.
2018-12-15 13:59:58 -08:00
Ian Hickson
59f0587095 Undeprecated BigInteger support, but document what it actually does. (flutter/engine#6903) 2018-12-15 08:32:20 -08:00
Anthony Bullard
28d536a39a Support real fonts in 'flutter test' (flutter/engine#6913)
* 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
2018-12-14 10:05:41 -08:00
jslavitz
0abb1665f5 Adds force cursor support (flutter/engine#6945)
* engine force cursor support
2018-12-13 18:45:38 -08:00
Chris Bracken
23db336526 [Fuchsia] Depend on libtrace when that is what's really meant (flutter/engine#7214)
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.
2018-12-13 13:13:38 -08:00
Stanislav Baranov
255b2e2f89 Downloading and installation of dynamic updates on Android (flutter/engine#7207) 2018-12-13 10:17:37 -08:00
Justin McCandless
4e82db460b Update marked text before selection so textInRange is never called with (flutter/engine#6989)
invalid input
2018-12-12 15:32:36 -08:00
liyuqian
efc116e72c Support querying display refresh rate in engine (flutter/engine#7002)
The current implementation only deals with Android devices and we'll add iOS devices support soon.
2018-12-12 10:28:44 -08:00
Brian Salomon
8d1c545b53 Remove unnecessary includes of Ganesh headers (flutter/engine#7189) 2018-12-12 10:58:14 -05:00
Rafael Ring
5755e8b956 Fix keyboard not showing for targetSdk 28 (flutter/engine#6985)
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>
2018-12-10 21:01:12 -08:00
Chris Bracken
1954a183a9 Eliminate obsolete FlutterDartProject initializers (flutter/engine#6967)
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.
2018-12-10 17:07:00 -08:00