1137 Commits

Author SHA1 Message Date
Matt Carroll
95c350dcd2 Bugfix: Prevent crash when responding to a platform message after FlutterJNI detaches from native (#28651). (flutter/engine#8170) 2019-03-14 21:13:03 -07:00
Chinmay Garde
9ada55b844 Add frame and target time metadata to vsync events and connect platform vsync events using flows. (flutter/engine#8172)
This will allow us to easily visualize the time the platform informed the engine of a vsync event, its arguments, and when the engine began its UI thread workload using this information.
2019-03-14 16:48:01 -07:00
Matt Carroll
8aeb94ed24 Android Embedding PR 19: Add accessibility to new FlutterView. (flutter/engine#8109) 2019-03-14 14:24:49 -07:00
Chinmay Garde
8fc02f5b1d Add an allocator specific check to ensure that strings passed to the timeline are not heap allocated. (flutter/engine#8168)
Verified that the tests fail on issues like https://github.com/flutter/engine/pull/8166. Unfortunately, there is no x-platform way to perform this check but this should gate incorrect traces being added to the engine.
2019-03-14 14:15:46 -07:00
liyuqian
c267787209 Add dump-shader-skp switch to help ShaderWarmUp (flutter/engine#8148)
Allow Flutter to automatically dump the skp that triggers new shader compilations. This is useful for writing custom ShaderWarmUp to reduce jank. By default, it's not enabled to reduce the overhead. This is only available in profile or debug build.

Later, we can add service protocol support to pull the skp from the client to the host. Currently, it works fine for Android-based devices (including our urgent internal clients) where we can `adb shell` into the cache directory.
2019-03-14 12:58:09 -07:00
Jason Simmons
ff7d13c6ed Suppress deprecation warning for use of Build.CPU_ABI (flutter/engine#8154) 2019-03-13 14:36:35 -07:00
Jason Simmons
c204de1fde Encode scroll motion events in the Android touch processor (flutter/engine#8149) 2019-03-13 11:30:42 -07:00
Jason Simmons
ee38cddf85 Look up ICU symbols based on the path to libflutter.so as a fallback (flutter/engine#8139)
The ICU data is packaged within libflutter.so, and the engine uses
dlsym(RTLD_DEFAULT) to look up the ICU data symbols in the libraries
loaded by the process.

This approach apparently fails on some Xiaomi devices.  If RTLD_DEFAULT
can not find the symbols, then the platform will pass the path to the
libflutter.so library so the engine can use that to resolve the symbols.

Fixes https://github.com/flutter/flutter/issues/28208
2019-03-12 18:33:33 -07:00
Matt Carroll
53f65f1bf1 Bugfix #29203: NPE in getAccessibilityProvider in old FlutterView. (flutter/engine#8126) 2019-03-11 23:45:03 -07:00
Matt Carroll
e8b329d24b Integrated AndroidTouchProcessor within the old FlutterView (flutter/engine#8095) 2019-03-11 16:04:44 -07:00
Michael Goderbauer
40e0467f60 Adds a platfromViewId to SemanticsNode (flutter/engine#8055) 2019-03-11 11:30:35 -07:00
Dan Field
a068a0b631 Fix the Windows build (flutter/engine#8106)
* Make macro for logging embedder errors build on Windows
2019-03-10 10:46:27 -07:00
Chinmay Garde
c19f28cd22 Log non-kSuccess returns from embedder API calls. (flutter/engine#8096)
Embedders don’t realize that some calls to the API return an error and don’t handle the same. Log such erroneous returns.
2019-03-09 20:04:16 -08:00
Jonah Williams
37f8c39523 Guard initialization of touch exploration listener (flutter/engine#8103) 2019-03-09 15:07:26 -08:00
Dan Field
132088ef5b Fix typo (flutter/engine#8102)
programatically -> programmatically
2019-03-09 08:58:07 -08:00
Chinmay Garde
1079e83608 Clarify arguments to FlutterEngineOnVsync (flutter/engine#8093) 2019-03-08 18:09:17 -08:00
Matt Carroll
af6deb0357 Android Embedding PR 17: Clarify AccessibilityBridge and move logic out of FlutterView. (flutter/engine#8061) 2019-03-08 18:09:04 -08:00
Matt Carroll
d29f5a6f87 Android Embedding PR 16: Add touch support to FlutterView. (flutter/engine#8034) 2019-03-08 18:08:26 -08:00
Chinmay Garde
d7a0ec6eca Allow embedders to post tasks onto the render thread. (flutter/engine#8089)
Some embedders may have to wait on fences asynchronously before committing
contents. This allows them to post a task onto the engine managed thread used
for rendering.
2019-03-08 16:30:48 -08:00
Michael Klimushyn
3bf53be79c Guard against NewAPI failures (flutter/engine#8048)
Adds minimum SDK checks around minimum APIs.

flutter/flutter#28848
2019-03-08 13:33:58 -08:00
liyuqian
8545cec8d6 Add read-only persistent cache (flutter/engine#8049)
Some clients (e.g., embedded devices) prefer generating persistent cache files for the specific device beforehand, and ship them as readonly files in OTA packages.
2019-03-08 12:15:45 -08:00
Core
e879c975e1 Fix deleting text when the last character is some special characters on IOS (flutter/engine#7982) 2019-03-08 10:47:06 -08:00
Chris Bracken
3469631eb6 Update a11y word forward/back enum names (flutter/engine#8073)
This updates the FlutterSemanticsAction enumerator identifiers for the
'move cursor forward/back one word' actions (added in
flutter/engine#8033) for consistency with the 'move cusor forward/back
on character' identifiers.

ABI compatibility is unaffected, but this with require the following
change in any embedder making use of these fields:

Rename:
    kFlutterSemanticsActionMoveCursorForwardByWordIndex
to:
    kFlutterSemanticsActionMoveCursorForwardByWord

Rename:
    kFlutterSemanticsActionMoveCursorBackwardByWordIndex
to:
    kFlutterSemanticsActionMoveCursorBackwardByWord
2019-03-07 16:46:44 -08:00
Chinmay Garde
cff370118a Delay the vsync callback till the frame start time specified by embedder. (flutter/engine#8072)
The current assumption is that the embedder will wait till the vsync event and
then fire the callback. However, some embedders have that information upfront.
Since the time point has already been specified by the embedder, there is no
reason to burden the embedder with having to setup a wait either.
2019-03-07 16:28:22 -08:00
Dan Field
321b66f228 Mark const extern (flutter/engine#8077)
* Mark const extern

* fix build
2019-03-07 16:10:03 -08:00
Jonah Williams
4996907fe5 Revert "add signal to pointer kinds" (flutter/engine#8066) 2019-03-06 20:55:34 -08:00
Dan Field
0f3face00a A11y callback (flutter/engine#8005)
* implement callback for a11y readiness
* use FlutterSemanticsUpdateNotification from header, move to VC header
2019-03-06 16:53:14 -08:00
Gary Qian
1d587c84cb Re-land "Buffer lifecycle in WindowData" (flutter/engine#8032) 2019-03-06 15:38:34 -08:00
stuartmorgan
3d41b8b415 Send scroll events from the macOS shell (flutter/engine#8056)
Adds scroll event handling to the macOS shell, sending them using the
new embedding API.

Currently, trackpad scrolling is just handled like scrollwheel
scrolling, since the trackpad-gesture-based scroll handling in Flutter
is still in progress.

Adds code to synthesize Add events if mouse tracking isn't enabled,
so that it doesn't rely on Flutter being lenient about handling events
from pointers that have never been added.
2019-03-06 13:15:01 -08:00
Chinmay Garde
93fda103c5 Fix weak pointer use violations in shell and platform view. (flutter/engine#8046) 2019-03-05 15:21:06 -08:00
stuartmorgan
5745c57f0c Add engine support for scrollwheel events (flutter/engine#7494)
Adds support for pointer signals, in a way that will support both discrete events (e.g., scroll wheels, flutter/flutter#22762) and continuous gestures (e.g., trackpad scroll, flutter/flutter#21953).

Also exposes these new event options to the embedder. Does not include code to send the
new events from the platform shells.
2019-03-05 14:12:07 -08:00
Chris Yang
4d1b6afe1b remove extra statement (flutter/engine#8041)
Remove an extra statement introduced in 992e22c9d1
2019-03-05 11:12:00 -08:00
Chris Bracken
e23839700a Add missing values to semantics action enums (flutter/engine#8033)
This brings the Dart and C++ semantics flag enums back in sync.

In #5902, the ability to move the cursor forward and backward one word
were added to dart:ui, and to the Android embedder, but not to the
SemanticsAction enum on the C++ side.
2019-03-05 07:58:26 -08:00
Chris Bracken
e560943579 Add missing kHasImplicitScrolling enum value (flutter/engine#8030)
This brings the Dart and C++ semantics flag enums back in sync.

In #5941, implicit scrolling support was added to SemanticsFlag in
dart:ui, and to the Android embedder, but not to the SemanticsFlags enum
on the C++ side.

This also clarifies/corrects the documentation for this value in dart:ui
and in the embedder API.
2019-03-04 22:00:54 -08:00
Matt Carroll
f24fe312b8 Android Embedding PR 14: Almost done with FlutterFragment. (flutter/engine#8000) 2019-03-04 18:02:24 -08:00
Matt Carroll
8f11547f61 Android Embedding PR15: Add Viewport Metrics to FlutterView (flutter/engine#8029) 2019-03-04 17:12:52 -08:00
Chris Yang
992e22c9d1 [platform_views] Fix duplicated touch event pass down to flutter view from platform view. (flutter/engine#8026)
Fix for flutter/flutter#27700 and flutter/flutter#24207

There are 2 fixes included in this PR.

The intercepting views sometime pass up the touches events to flutter view, even after the forward gesture recognizer pass the event to the flutter view. We only want the event to be passed to the flutter view once. So we let the intercepting view 'consumes' the event in this PR to fix the problem.

When a touch sequence has multiple touch points participated(e.g. Pinch gesture), the touchesBegan and touchesEnded can be triggered multiple times if the touches do not happen simultaneously. One example would be: when performing a pinch gesture with 2 fingers, I put down one finger, keep the finger on the screen, then put down another finger, perform pinch, lift up both finger at the same time. In this sequence, touchesBegan is called twice with each touch in one of the calls and touchesEnded is called once and has 2 touches in the callback. To handle this issue, we added a count to count the touches in one touch sequence. We only set the state to fail when the count reaches 0(That is all the touches has began in the current sequence is ended).
2019-03-04 15:55:32 -08:00
Dan Field
9383838e9f Start of linting Android embedding (flutter/engine#8023)
* Add a tool for running Android SDK lint on Android embedding
2019-03-04 13:55:53 -08:00
Dan Field
2c06341258 Add overloads for lookup that lets you specify a bundle (flutter/engine#8007)
* Add overloads for lookup that lets you specify a bundle

* check bundle with defaultBundleIdentifier before main bundle
2019-03-02 10:01:51 -08:00
Gary Qian
d689b45ab1 Revert "Buffer lifecycle in WindowData (#7999)" (flutter/engine#8010)
This reverts commit 03bec0d1b68ff57b6bf31d7cb8586837443b05fd.
2019-03-01 15:14:20 -08:00
Greg Spencer
55f7ab72d8 Guard against using Android API not defined in API level 16 & 17 (flutter/engine#8006)
This adds a guard around the call to MotionEvent.isFromSource, which is not implemented in API 16 and 17.

Fixes flutter/flutter#28640
2019-03-01 14:53:22 -08:00
Gary Qian
03bec0d1b6 Buffer lifecycle in WindowData (flutter/engine#7999) 2019-03-01 10:43:09 -08:00
Chris Bracken
362096c282 Fix incorrect transformation matrix (flutter/engine#8001)
Previously the transformation matrix returned on semantics nodes was
fetched by matrix col,row (incorrectly). This uses the SkMatrix
constants instead and adds a test.
2019-02-28 19:19:06 -08:00
Matt Carroll
0f8d5d618b Android Embedding PR 12: Add lifecycle methods to FlutterActivity. (flutter/engine#7974) 2019-02-28 16:51:17 -08:00
Matt Carroll
15584ba38d Android Embedding PR 13: Integrated text input, keyevent input, and some other channel comms in FlutterView. (flutter/engine#7979) 2019-02-28 15:02:56 -08:00
Matt Carroll
a0f16c7b4a Android Embedding PR 9: Introduce an AndroidTouchProcessor to convert MotionEvents to Flutter touch data. (flutter/engine#7947) 2019-02-28 14:44:28 -08:00
Chris Bracken
7c4f8d8116 Fix two typos in embedder.h (flutter/engine#7993)
occured -> occurred
preceeded -> preceded
2019-02-27 21:10:08 -08:00
Matt Carroll
73e65066f2 Android Embedding PR 11: Add FlutterEngine to FlutterFragment. (flutter/engine#7972) 2019-02-27 21:09:28 -08:00
Chris Bracken
0d1a8035df Provide batching for semantics updates (flutter/engine#7988)
Some embedders prefer to minimise the number of semantics node/custom
action updates sent back to the host platform -- for example due to
expensive serialisation mechanisms, etc.

This patch provides a 'batch end' signal that provides embedders with an
indication of when a self-consistent set of semantics node or custom action
updates have been sent.

We overload the node/action ID with information that conveys a batch end
by using an ID (-1) that is never allotted to semantics nodes by the
framework.
2019-02-27 12:12:45 -08:00
Jason Simmons
906d49c751 Check for a null pressure range for motion events (flutter/engine#7986)
Fixes https://github.com/flutter/flutter/issues/28490
2019-02-27 11:27:19 -08:00