3051 Commits

Author SHA1 Message Date
Amir Hardon
dc470dc12a Convert synthesized Android motion events to long and not to int. (flutter/engine#6103) 2018-08-28 12:12:47 -07:00
Jonah Williams
02d928b047 Unconditionally set resource id to empty string (flutter/engine#6096) 2018-08-27 10:54:07 -07:00
Chinmay Garde
366a898572 Allow embedders to invalidate FBO bindings after present. (flutter/engine#6084) 2018-08-24 16:53:13 -07:00
amirh
00c385f497 Allow passing extra creation parameters for embedded Android views. (flutter/engine#6081)
This allows plugins to pass extra parameters from the Dart side to the
platform view constructor.
2018-08-24 11:15:14 -07:00
Chinmay Garde
20b525fc88 Allow building the embedder API for the target toolchains. (flutter/engine#6069) 2018-08-22 16:42:47 -07:00
Chinmay Garde
86e253fadd Alllow access to Flutter engine, Dart & Skia versions in the Shell API. (flutter/engine#6060) 2018-08-21 08:52:24 -07:00
amirh
eb77c3044d Support LTR/RTL layout directions for embedded Android views. (flutter/engine#6057) 2018-08-20 16:22:38 -07:00
amirh
bf9aa07b49 Delay the removal of the onDrawListener. (flutter/engine#6052)
In Android O removing the ViewTreeObserver.onDrawListener from the
listener call crashes. Instead we post a runnable to remove it.
2018-08-20 12:13:26 -07:00
Jonah Williams
8c942fb413 use setContentDescription for controls on Android (flutter/engine#6050) 2018-08-20 09:30:13 -07:00
amirh
31d1346006 Add views added to the WindowManager into the presentation view tree. (flutter/engine#6043)
The default WindowManager implementation in Android's Presentation is
delegating addView/removeView/updateViewLayout calls to the global
WindowManager.
This can result in a crash when an embedded view is trying to e.g show a
PopupWindow.

This change adds a custom WindowManager that overrides
addView (and removeView/updateViewLayout) and adds the view to the
presentation's view tree.

Note that views might keep a reference to the window manager which
might be an issue when we move a view from one virtual display to
another (due to a resize). For this reason when re-sizing we are not
creating a new window manager for the new presentation, but updating the
window manager's references to be relevant for the new presentation and
re-use it.
2018-08-17 17:01:42 -07:00
James D. Lin
e6e35ee205 Fix potential null pointer dereference in FlutterDartProject (flutter/engine#6035)
If `FlutterDartProject` found an `FLTLibraryPath` entry in an iOS
application's `Info.plist`, it assumed that values that were valid
filesystem paths were paths to bundles.  If the attempt to retrieve
the `NSBundle` fails, `FlutterDartProject` ignored the failure and
then would assign `nil` to a C++ `std::string`, resulting in a null
pointer dereference.

Add some failure checks to prevent this.
2018-08-16 17:40:33 -07:00
Chinmay Garde
4555fcca31 Re-apply "Log Tonic errors with FML_LOG" (flutter/engine#6026)
This reverts commit 201900fd6354a0f1a9318e31f101e05aeea612bd and updates the tonic SHA.
2018-08-15 14:28:24 -07:00
Martin Kustermann
258a95c9fa Switch all embedders to use platform_strong.dill instead of platform.dill (the flutter_tester binary already does this) (flutter/engine#6024) 2018-08-15 17:45:11 +02:00
Chinmay Garde
201900fd63 Revert "Log Tonic errors with FML_LOG" (flutter/engine#6021)
Reverts flutter/engine#6015

This is causing the Windows bots to fail.
2018-08-14 22:22:28 -07:00
Chinmay Garde
33485e47de Fix Android Vulkan builds to account for resource context management API updates. (flutter/engine#6020) 2018-08-14 22:20:05 -07:00
Jason Simmons
ee9fe6a5fc Log Tonic errors with FML_LOG (flutter/engine#6015) 2018-08-14 17:04:38 -07:00
Jason Simmons
c761e6e2a0 Detach the resource context before shutting down the IO thread (flutter/engine#6009) 2018-08-14 13:15:42 -07:00
Niko Yuwono
9aac5e05f9 Add NSNull check in setSystemChromeSystemUIOverlayStyle (flutter/engine#6011) 2018-08-14 11:45:45 -07:00
James D. Lin
9ad6ac6c4a Don't require FLTLibraryPath and FLTAssetsPath from the main NSBundle (flutter/engine#5986)
We'd like the ability to add Flutter to existing iOS applications
without requiring that they set `FLTLibraryPath` and `FLTAssetsPath`
in the main bundle's `Info.plist`.

1. Modify `-[FlutterDartProject initWithPrecompiledDartBundle:]` to
   support setting the library and assets path from the specified
   `NSBundle` instead.

2. If no `NSBundle` is explicitly specified, look for one with a
   default bundle identifier ("io.flutter.flutter.app") before
   falling back to the main NSBundle.

Also remove `+[FlutterDartProject pathForFlutterAssetsFromBundle:]`
because we don't use it internally, and it isn't exposed in the
header file.
2018-08-14 10:45:05 -07:00
Chinmay Garde
d9d6c2e825 Remove unused argument on Animator, Engine and PlatformView delegates. (flutter/engine#6007)
When these delegate methods were initially added, it was expected that a single
shell would be able to own mutliple platform views, engines and animators. This
plan was abandoned in favor of creating multiple shells with their own platform
views, engines, etc.. The arguments were meant to ease the disambiguate the
instances of the variaous objects managed by the shell. This is no longer
necessary.
2018-08-13 16:16:10 -07:00
Chinmay Garde
cef3ee517c Check the kernel header magic to determine if a mapping may be a valid kernel blob. (flutter/engine#5997) 2018-08-10 15:12:48 -07:00
nathanrogersgoogle
df71c78332 Add a delay to Animator::BeginFrame's NotifyIdle call (flutter/engine#5972)
This change adds a delay before Animator::BeginFrame calls its
delegate's OnAnimatorNotifyIdle.  This is because under certain
workloads, such as our parent view resizing us, which is communicated
via viewport change events, we won't have a frame scheduled yet in the
animator, despite the fact that we will go on to schedule a frame once
the viewport event arrives.

In Fuchsia's resizing performance test, on our reference high end x86-64
hardware, the previous logic was resulting in a ~45ms garbage collection
right after the first frame of an animation.
2018-08-10 13:28:09 -07:00
Stanislav Baranov
b4ce259bcf Fix codepush breakage caused by #5954. (flutter/engine#5996) 2018-08-10 13:23:51 -07:00
amirh
af25774b82 Cast MotionEvent timestamps to Number. (flutter/engine#5994)
Dart might choose to marshall the timestamps to a Java Long or Integer.
Casting directly to int was crashing when the timestamp wass a Long.
2018-08-10 12:46:49 -07:00
Todd Volkert
306464cb6f Reference platform_strong.dill, not platform.dill (flutter/engine#5992) 2018-08-10 11:55:36 -07:00
Ben Konyi
3b80ac90f5 Fixed invalid call site of runWithEntrypointAndCallback (flutter/engine#5984) 2018-08-09 12:42:59 -07:00
Ben Konyi
b5aa93de7c Removed callback for HeadlessDartRunner (flutter/engine#5983) 2018-08-09 11:21:51 -07:00
Alexander Aprelev
5de4538b21 Fix IsolateStart event kind. (flutter/engine#5978) 2018-08-08 15:45:26 -07:00
Keerti Parthasarathy
96656470a0 Annotate deprecated methods with @Deprecated (flutter/engine#5976) 2018-08-08 13:02:41 -07:00
Jonah Williams
f9378b453c make ios text affinity behavior match android (flutter/engine#5971) 2018-08-08 10:54:29 -07:00
amirh
8eb80d3e3d Complete the AndroidView resize call only after a new frame is ready. (flutter/engine#5968)
This allows the framework to know that a frame with the resized view is
ready and to behave deterministically to workaround the jank issue
described in flutter/flutter/19572
2018-08-07 18:56:34 -07:00
amirh
9d38d63147 Allow freezing a texture. (flutter/engine#5938)
This is needed to avoid jank when resizing an embedded Android view.
See
https://github.com/flutter/flutter/issues/19572#issuecomment-410400724
2018-08-07 14:43:19 -07:00
Ben Konyi
10e272f154 Persist DartCallbackCache contents across launches (flutter/engine#5947)
* Updated DartCallbackCache to write callback cache to disk which is
restored on engine startup
* Ensure cache isn't moved off disk in iOS
2018-08-07 14:37:19 -07:00
Todd Volkert
21c7a646ca Don't implicitly fall through in switch statement (flutter/engine#5964) 2018-08-07 13:18:26 -07:00
Jonah Williams
3b5e35f4b9 Apply translation to accessibility tree when in landscape (flutter/engine#5950) 2018-08-07 13:09:18 -07:00
Ben Konyi
6d5fce84ae Reland "Updated background execution implementation for Android" (flutter/engine#5954)
* Reland "Updated background execution implementation for Android" w/ JNI fixes for merge breakages

This reverts commit 4a12df930a9d0dc8db3410cd557f35f4a584dbd0.
2018-08-07 12:42:22 -07:00
Alexander Markov
4a12df930a Revert "Updated background execution implementation for Android" (flutter/engine#5949)
This reverts commit e9e6e8a2bf81e394a5903e7cc573644225bf8b95.
2018-08-06 14:10:23 -07:00
Jonah Williams
9d5862edbb Add hasImplicitScrolling SemanticFlag and support in Android bridge (flutter/engine#5941) 2018-08-06 13:57:00 -07:00
Ben Konyi
e9e6e8a2bf Updated background execution implementation for Android 2018-08-06 12:27:57 -07:00
amirh
3cc77fae93 Flush all embedded Android views on hot restart. (flutter/engine#5929)
* Flush all embedded Android view on hot restart.

Adds an OnEngineRestarted method to PlatformView, this is currently only
implemented for Android where we need to use it for embedded views.

* review comments followup

* rename to OnPreEngineRestart, call before Clone
2018-08-03 08:54:12 -07:00
amirh
c5dfa3a45c Don't drop MotionEvents with unknown tool type. (flutter/engine#5931)
Instead, send them with the new unknown PointerDeviceKind.

We hit this when running `adb shell input tap` in tests which sends events with
an unknown tool type.

This also fills in a missing conversion for TOOL_TYPE_ERASER.
2018-08-02 16:05:55 -07:00
James D. Lin
922785f8a8 Add an explicit -[FlutterViewController init] implementation (flutter/engine#5924)
* Add an explicit `-[FlutterViewController init]` implementation

`-[FlutterViewController init]` currently works because it inherits
the `-[UIViewController init]` convenience initializer that invokes
the `-[UIViewController initWithNibName:bundle:]` designated
initializer that `FlutterViewController` overrides.

However, this doesn't seem to be explicitly documented, so it's a bit
confusing (or at least non-obvious), and it seems potentially
brittle.  Add an explicit implementation of `-[FlutterViewController
init]` instead.
2018-08-02 14:03:42 -07:00
Michael Goderbauer
53e707207e Switch to minimal ICU data config for flutter (flutter/engine#5922) 2018-08-01 17:24:07 -07:00
Jonah Williams
3a3f6ca0ee Initial support for more finely-grained a11y features on Window (flutter/engine#5901) 2018-07-31 18:18:19 -07:00
James D. Lin
650df92607 Deprecate -[FlutterDartProject initFromDefaultSourceForConfiguration] (#18886) (flutter/engine#5858)
* Deprecate -[FlutterDartProject initFromDefaultSourceForConfiguration] (#18886)

`-[FlutterDartProject initFromDefaultSourceForConfiguration]` no
longer seems very useful.  It calls `-initWithPrecompiledDartBundle:`
or `-initWithFlutterAssets:dartMain:packages:`, but since it now
passes `nil` for all arguments, both paths end up doing the same
thing.

Additionally, `-initFromDefaultSourceForConfiguration` is awkward to
use in Swift.  The automatically generated Swift interface is:

    public convenience init!(fromDefaultSourceForConfiguration: ())

and it's not obvious how to call that.

Let's deprecate `-initFromDefaultSourceForConfiguration` and instead
expect callers to use the existing `-init` method. (We can make
`-init` do different things for different build configurations later
if necessary.)

Bonus: Rename some parameters to make it more obvious when they may
be `nil`.
2018-07-31 11:49:57 -07:00
Jonah Williams
7fe563529c Add word movement granularities to android (flutter/engine#5902) 2018-07-30 17:53:17 -07:00
nathanrogersgoogle
c0c383fb44 Remove the "VSYNC" trace event on Fuchsia (flutter/engine#5907)
Don't emit a "VSYNC" event when running on Fuchsia, as traces on Fuchsia
are typically recorded across the whole system, causing the events to
collide with each other.
2018-07-30 15:40:41 -07:00
Jason Simmons
332832d84c Clear the EGL context only if our context is currently active (flutter/engine#5895)
Fixes https://github.com/flutter/flutter/issues/19566
2018-07-30 09:52:39 -07:00
Jason Simmons
d1cc979466 Return proper JSON-RPC error responses from service protocol failures (flutter/engine#5889)
Fixes https://github.com/flutter/flutter/issues/19571
2018-07-30 09:52:12 -07:00
amirh
30940056b0 Fix wrong conversion of MotionEvent to Flutter's PointerEvent kind. (flutter/engine#5894)
We were sending the toolType values as-is which is wrong, e.g touch
events showed in Flutter as mouse events.
2018-07-27 16:12:26 -07:00