1592 Commits

Author SHA1 Message Date
chunhtai
8ebb318401
Revert "Issues/39832 reland (#13642)" (#13720)
This reverts commit 1bfb928e071674a21779cee94908fbcae1c2e657.
2019-11-06 11:41:36 -08:00
Chinmay Garde
d59b1583b0
Ensure that the device pixel ratio is taken into account with window metrics in physical pixels. (#13708)
This was originally patched in https://github.com/flutter/engine/pull/13193 but
the unit-tests were written under the mistaken assumption (that has been
documented already) that the Flutter window metrics used logical pixel
coordinates. That mistake has been corrected and additional tests to verify
rendering intent has been added.

Fixes https://github.com/flutter/flutter/issues/43906
Fixes https://b.corp.google.com/issues/143529469
2019-11-06 11:16:18 -08:00
Jason Simmons
47579164ad
Fix NPE in splash screen lookup (#13719) 2019-11-06 10:31:41 -08:00
Matt Carroll
e924d71627
Fix splash screen lookup. (#44131) (#13660) 2019-11-06 04:37:48 +00:00
Greg Spencer
572e3d16c0
Fix editing selection and deletion on macOS (#13702)
This fixes the selection and deletion during text editing on macOS so that it can handle selections that have a base (selection start) that is after the extent (selection end) in the string.

Apparently the insertText:replacementRange on macOS can supply an NSRange object that has negative values for the length (even though the length is an unsigned NSUInteger). This change checks for that case, and fixes the range of characters replaced in the text to have the right bounds.

Also, I added an additional updateEditState after the state is set from the framework, since there is a timing problem: when the delete key is pressed, it sends an insertText message, which updates the framework state after the framework has already sent its state update to delete the selected region. This additional updateEditState puts the engine and framework back in sync again. Ideally, we would just avoid sending the insertText message, but there's really no way for the engine to know if the pressed key is part of an edit sequence or not.
2019-11-05 19:17:52 -08:00
Filip Filmar
6c763bb551 [fuchsia] Temporarily disable intl provider (#13696)
The intention of the property provider is to try to connect, not
bail out if connection is not possible.

This code tried to connect unconditionally, which is not what we wanted.
Removing this initialization code to enable a roll, and will fix in a
followup.
2019-11-05 18:51:37 -08:00
Matt Carroll
58a6d6554f
Fix plugin registrant reflection path. (#44161) (#13698) 2019-11-05 23:36:35 +00:00
Darren Austin
3ea4005844
Added Semantic header support on Android. (#13262)
Added Semantic header support on Android.
2019-11-05 15:27:25 -08:00
Darren Austin
05ab04dbe8
Fixed the scroll direction for iOS horizontal accessibility scroll events. (#13651)
* Fixed the scroll direction for horizonatal accessibilty scroll events.

* Updated the comment describing the scroll direction mapping.
2019-11-05 15:25:18 -08:00
chunhtai
1bfb928e07
Issues/39832 reland (#13642)
* Reland "Added new lifecycle enum (#11913)"
2019-11-05 14:52:16 -08:00
Jason Simmons
76312eefdd
Fix Class.forName unchecked call warning (#13695) 2019-11-05 13:45:57 -08:00
chunhtai
fe0838e948
Revert "Added new lifecycle enum (#11913)" (#13632)
This reverts commit 02a479007420b05df8e075978ecdd15442ea520f.
2019-11-04 13:40:20 -08:00
chunhtai
02a4790074
Added new lifecycle enum (#11913) 2019-11-04 12:33:41 -08:00
xster
7aa40556a4
Release shim bindings when detaching (#13432) 2019-11-01 17:53:15 -07:00
George Wright
f7d52fab07 Add fuchsia.intl.PropertyProvider to our services on Fuchsia (#13486)
This resolves the following error on Fuchsia: Component fuchsia-pkg://fuchsia.com/flutter_aot_product_runner#meta/flutter_aot_product_runner.cmx is not allowed to connect to fuchsia.intl.PropertyProvider because this service is not present in the component's sandbox.
2019-11-01 16:13:12 -07:00
Filip Filmar
693ca2d0cb [dart] Makes the intl services available (#13460)
This registers that the dart runner requires
`fuchsia.intl.PropertyProvider` service.  It is a way for the runner
to discover the system locale.
2019-11-01 16:04:49 -07:00
Dan Field
ced6c63d1e
Request a reattach when creating the text input plugin on Android (#13474) 2019-11-01 15:29:33 -07:00
Dan Field
0a8bd9dd6f
Fix mDNS for iOS13 (#13451) 2019-11-01 15:29:15 -07:00
Amir Hardon
8997f34819
Fix stale platform view gr context on iOS (#13469)
When gr context is changed (this happens when sending the app to the background and then to the foreground) we need to update it for all the platform view overlay surfaces.

The update logic was caching the previous gr context to figure if it had to be updated, but after updating it for a given overlay we were updating the cached context. In apps with multiple platform views this will result in overlays with a stale gr context.

This fixes flutter/flutter#36437
And I believe it should fix flutter/flutter#36999 as well (though I don't have repro code to verify).
2019-10-31 16:51:11 -07:00
Jason Simmons
c604fd4395
Pass the automaticallyRegisterPlugins flag to the FlutterEngine constructor in FlutterActivityTest (#13468) 2019-10-31 16:06:37 -07:00
Matt Carroll
c882439cb3
Automatically register plugins in FlutterEngine. (#43855) (#13455) 2019-10-31 14:10:45 -07:00
Josh
3a32d9fe5c Force orientation change when current orientation not allowed on iOS (#13170) 2019-10-31 12:20:24 -07:00
Amir Hardon
c63aefd28b
Fix iOS crash when multiple platform views are in the scene (#13449)
Having 2 or more platform views simultaneously in the layer tree was crashing immediately on iOS with GL backend.

This regressed in #11070 which passed gl_context to a function in a loop using std::move (which meant on the second iteration the caller is no longer the owner of the field).

I added a scenarios_app test, though this test doesn't run on a physical device on CI so it would have only caught the problem when running locally (flutter/flutter#43852).
2019-10-31 10:30:15 -07:00
Dan Field
4b76fadbf4
Fizzle onConfigurationChanged if no FlutterView (#13445) 2019-10-30 15:49:02 -07:00
Matt Carroll
97807b5341
Automatically destroy FlutterEngine when created by FlutterActivity or FlutterFragment. (#13423) 2019-10-30 15:01:57 -07:00
Michael Klimushyn
e609577d12
Revert "Turn on RasterCache based on view hierarchy (#13360)" (#13442)
This caused EmbedderTest.VerifyB143464703 to fail after merging into
master.

```
../../flutter/shell/platform/embedder/tests/embedder_unittests.cc:3111: Failure
Value of: ImageMatchesFixture("verifyb143464703.png", renderered_scene)
  Actual: false
Expected: true
[  FAILED  ] EmbedderTest.VerifyB143464703 (2507 ms)
```

This reverts commit 3ad3bc76a5825210603d4afd12013de8ba7d7668.
2019-10-30 11:25:29 -07:00
Michael Klimushyn
3ad3bc76a5
Turn on RasterCache based on view hierarchy (#13360)
Previously the cache was disabled on whether or not PlatformViews were
globally enabled. Instead track their existence in the view hierarchy
and only disable RasterCache if a PlatformView is actually present.
2019-10-30 10:45:15 -07:00
Dan Field
90771188f8
Set the install name at link time for darwin dylibs (#13428) 2019-10-29 20:30:13 -07:00
Mehmet Fidanboylu
4092b0c4fe
Add isRunningInRobolectricTest back (#13424) 2019-10-29 19:46:21 -07:00
Chinmay Garde
e3aff2c982
Make sure root surface transformations survive resetting the matrix directly in Flow. (#13405)
This used to only be handled correctly for non-root layer backing stores. This
was mostly a side effect of the fact that we used recording canvases instead of
rendering directly into the backing store. We now use recording canvases
consistently.

Fixes b/143464703
Fixes https://github.com/flutter/flutter/issues/43732
2019-10-29 17:44:57 -07:00
gaaclarke
f8a7ce5655
Made it so we clean up gl resources when view controllers get deleted. (#13396) 2019-10-29 16:09:14 -07:00
gaaclarke
ac2fb36cdb
Added back in empty lifecycle events so we don't break people that used to call super. (#13421) 2019-10-29 16:04:59 -07:00
Kaushik Iska
46c757be07
[dart_runner] Common libs need to exist for aot runner (#13419)
This is to account for failures like:

```
00067.522] 13245:13247>
[00067.522] 13245:13247> ------------------------------------------------
[00067.522] 13245:13247> RUNNING TEST: /pkgfs/packages/goodbye_dart_test/0/test/goodbye_dart_test
[00067.522] 13245:13247>
[00067.754] 05775:06330> dlsvc: could not open 'ld.so.1'
[00067.758] 01149:01207> [component_manager] WARN: Failed to launch process 'dart_aot_runner.cmx' in job 163427: Failed to load dynamic linker from fuchsia.ldsvc.Loader: NOT_FOUND
[00067.759] 05775:05777> [ERROR:src/sys/appmgr/realm.cc(155)] Cannot run executable dart_aot_runner.cmx due to error -1 (ZX_ERR_INTERNAL): fuchsia.process.Launcher failed
[00067.759] 05775:05777> [ERROR:src/sys/appmgr/runner_holder.cc(41)] Runner (fuchsia-pkg://fuchsia.com/dart_aot_runner#meta/dart_aot_runner.cmx) terminating, reason: failed to create component (UNKNOWN)
[00067.760] 13245:13247> fuchsia-pkg://fuchsia.con/goodbye_dart_aot#meta/goodbye_dart_aot.cmx: failed to create component (UNKNOWN)
[00067.761] 13245:13247> goodbye_dart_aot --now failed
[00067.772] 13245:13247> FAILURE: /pkgfs/packages/goodbye_dart_test/0/test/goodbye_dart_test exited with nonzero status: 1
[00067.886] 13245:13247>
[00067.887] 13245:13247> ------------------------------------------------
```

logs: https://logs.chromium.org/logs/fuchsia/buildbucket/cr-buildbucket.appspot.com/8898242024940777936/+/steps/launch_collect/0/steps/1/0/steps/collect/0/logs/task_stdout_stderr:_QEMU/0
2019-10-29 14:50:11 -07:00
Jason Simmons
7069025a32
Reformat BUILD.gn files to comply with the format checker presubmit script (#13401) 2019-10-29 09:49:16 -07:00
Jason Simmons
c081ee7f2c
Use DartExecutor.getBinaryMessenger in FlutterNativeView instead of deprecated send methods (#13403) 2019-10-29 09:48:54 -07:00
Matt Carroll
e96f8603f0
Converted ActivityAware and ServiceAware Lifecycles to opaque objects (#43670) (#13402) 2019-10-28 21:41:07 -07:00
Matt Carroll
55e9ad77ec
Remove multiplexed Flutter Android Lifecycle. (#43663) (#13394) 2019-10-28 16:22:11 -07:00
Chinmay Garde
e3c5f4827d
Switch the MacOS Desktop embedder to using a thread configuration where the platform and render task runners are the same. (#13300)
Also creates a new test harness for the desktop embedder framework target and adds a test that launches a headless engine in this new thread configuration.

Fixes https://github.com/flutter/flutter/issues/17579
2019-10-28 12:47:05 -07:00
Matt Carroll
3ebf006904
Deprecated DartExecutor as BinaryMessenger and added a getBinaryMessenger() method. (#43202) (#13349) 2019-10-25 20:07:13 -07:00
Kaushik Iska
f082b32236
[flutter_runner] Remove the checks for libdart profiler symbols (#13364)
Since the runner binaries are statically linked, we do not need
to look for the libdart profiler symbols separately.
2019-10-25 16:25:15 -07:00
Chris Bracken
4f300e618f
Expose platform view ID on embedder semantics node (#13345)
This exposes platform_view_id on the embedder API's FlutterSemanticNode.

In bd0f9085e5bdbac74cc6e611f758768f15ad5415 (#8055), platformViewId was
added to SemanticsNode. This field is non-zero when the SemanticsNode
represents a platform view and is typically used by embedders as a means
of identifying locations where a platform view's 'native' accessibility
tree should be injected into the platform-specific accessibility tree
constructed by the embedder.

Due to the intended use of this field, the Flutter framework is meant to
enforce that this node has a child count of zero.
2019-10-24 19:42:32 -07:00
Chris Bracken
29b1725bdd
Remove TODO on embedder a11y unit tests (#13346)
Removes a TODO implying that the embedder accessibility unittests were
disabled due to flakiness.

The tests were originally disabled in
https://github.com/flutter/engine/pull/9482.

The issue tracking re-enabling the tests was
https://github.com/flutter/flutter/issues/35218.

This issue was resolved, and the tests re-enabled, in
https://github.com/flutter/engine/pull/9585.
2019-10-24 19:42:16 -07:00
Matt Carroll
74d18bce34
Android embedding API updates for plugin ecosystem - plugin facade, split Lifecycle, save state callbacks to plugins (#43241, #43242, #43295) (#13280) 2019-10-24 19:10:05 -07:00
Filip Filmar
400e3b00fb Wires the locale provided by Fuchsia. (#13045)
The FIDL service `fuchsia.intl.PropertyProvider` is a service that
the flutter runner can use to obtain information on system preferred
locales.

This change sends a platform message "setLocale" on the channel
"flutter/localization", based on the values provided by the above
mentioned FIDL service.

Credit: most of this was initially written by @kpozin; I ported it
to out-of-tree flutter engine.

Tested:

1. Compile and publish the unit tests package as shown in
   the script below.
2. In a Fuchsia repository (pointed to by `$FUCHSIA_DIR`), run
   `fx serve`
3. `fx shell run fuchsia-pkg://fuchsia.com/flutter_runner_tests#meta/flutter_runner_tests.cmx`

The script used to update the unit tests.

```bash

set -x

FLUTTER_ENGINE_DIR="${FLUTTER_ENGINE_DIR:-$HOME/fx/flutter/engine/src}"
readonly OUT_DIR="${FLUTTER_ENGINE_DIR}/out"

(
  cd ${FLUTTER_ENGINE_DIR}
  ./flutter/tools/gn --fuchsia --fuchsia-cpu x64 --unoptimized
  ninja -j 100 -C "${OUT_DIR}/fuchsia_debug_unopt_x64"
  cp "${OUT_DIR}/compile_commands.json" "${FLUTTER_ENGINE_DIR}"

  echo "Publishing the tests package"
  "${FLUTTER_ENGINE_DIR}/fuchsia/sdk/linux/tools/pm" publish \
    -a -r $FUCHSIA_DIR/out/release/amber-files \
    -f "${FLUTTER_ENGINE_DIR}/out/fuchsia_debug_unopt_x64/flutter_runner_tests-0.far"
)
```
2019-10-23 15:05:19 -07:00
Chinmay Garde
1663ac9e0d
Add FlutterEngineRunsAOTCompiledDartCode to the embedder API. (#13319)
For embedder code that is configured for both AOT and JIT mode Dart execution
based on the Flutter engine being linked to, this runtime check may be used to
appropriately configure the `FlutterProjectArgs`. In JIT mode execution, the
kernel snapshots must be present in the Flutter assets directory specified in
the `FlutterProjectArgs`. For AOT execution, the fields `vm_snapshot_data`,
`vm_snapshot_instructions`, `isolate_snapshot_data` and
`isolate_snapshot_instructions` (along with their size fields) must be specified
in `FlutterProjectArgs`.
2019-10-23 14:49:56 -07:00
Justin McCandless
7071dc7061
NO_SUGGESTIONS keyboard flag in Android (#13099)
Add the enableSuggestions parameter to control Android's keyboard suggestions
2019-10-23 10:47:19 -07:00
Francisco Magdaleno
ef32890466
Send flag modified events to the framework (#13269) 2019-10-22 19:01:00 -07:00
Chinmay Garde
b5a33d4d6a
Allow embedders to update preferrred locales. (#13238)
This was previously only possible by sending an undocumented payload over an engine managed channel.
2019-10-22 17:50:01 -07:00
Chinmay Garde
97f5ad4a90
Avoid accessing the Cocoa view on the GPU or IO task runners. (#13295)
The view was being accessed from a background thread so its OpenGL context could be accessed. This tripped thread safety assertions in Cocoa. Now the OpenGL context is stashed in the FlutterEngine instance itself.
2019-10-22 14:21:49 -07:00
Ryan Macnak
f6900001eb
Roll Dart to 6a65ea9cad4b014f88d2f1be1b321db493725a1c. (#13294)
Remove dead shared snapshot arguments to Dart_CreateIsolateGroup.

6a65ea9cad4b [vm] Remove shared snapshot and reused instructions features.
db8370e36147 [gardening] Fix frontend-server dartdevc windows test.
4601bd7bffea Modified supertype check error message to be more descriptive.
0449905e2de6 [CFE] Add a serialization-and-unserialization step to strong test
c8b903c2f94f Update CHANGELOG.md
2a12a13d9684 [Test] Skips emit_aot_size_info_flag_test on crossword.
b26127fe01a5 [cfe] Add reachability test skeleton
2019-10-22 13:14:20 -07:00