1385 Commits

Author SHA1 Message Date
Matt Carroll
1959c3d907 Android Embedding Refactor PR34: Fill in missing nullability annotations. (flutter/engine#9384) 2019-06-19 23:44:15 -07:00
Chinmay Garde
9788d1289a Update Metal backend to account for Skia updates. (flutter/engine#9383)
Also makes it so that folks don't have to patch the buildroot manually when
building for Metal.
2019-06-19 15:24:26 -07:00
Dan Field
4d5f19b50b Wire intent args for observatory port (flutter/engine#9378) 2019-06-19 13:13:13 -07:00
gaaclarke
ebb4e8ac18 Revert "Surrogate binary messenger (#9347)" (flutter/engine#9375)
This reverts commit 002159e772f4f6e136ce2b7608a2234e95060a09.

This was crashing the integration test `- (void)testDualFlutterView`.
2019-06-19 12:29:08 -07:00
chunhtai
9fe6a47ab6 Introduce read only text field semantics (flutter/engine#9281) 2019-06-19 09:42:23 -07:00
Jason Simmons
1cd5ed308a Do not remove the DartServiceIsolate status callback during FlutterMain destruction (flutter/engine#9368)
FlutterMain and the DartServiceIsolate callback list are both globals, and the
callback list state may have already been destructed when FlutterMain's
destructor runs.
2019-06-18 22:34:04 -07:00
Amir Hardon
4ad78e92cd request FlutterView focus when setting a platform view text client (flutter/engine#9366) 2019-06-18 19:05:36 -07:00
gaaclarke
002159e772 Surrogate binary messenger (flutter/engine#9347)
Created FlutterSurrogateBinaryMessenger to make sure that channels are
holding onto engines and not viewcontrollers.  This doesn't change the
public API but makes clients do what we want them to be doing, using
Engine for FlutterBinaryMessenger.
2019-06-18 17:58:45 -07:00
Francisco Magdaleno
8eb78e2baa [glfw] Implement clipboard support from GLFW api (flutter/engine#9361) 2019-06-18 16:57:01 -07:00
Matt Carroll
adb4934a15 Add APIs for querying FlutterView for a FlutterEngine and listening for attachment/detachment (#29114). (flutter/engine#9356) 2019-06-18 16:34:30 -07:00
Matt Carroll
ffa6ad4bf0 Android Embedding Refactor PR32: Clean up logs in new embedding (#33544, #33102). (flutter/engine#9351) 2019-06-18 15:52:22 -07:00
Matt Carroll
ee7442f238 Android Embedding Refactor PR33: Clean up FlutterJNI (#25533). (flutter/engine#9354) 2019-06-18 15:35:22 -07:00
liyuqian
222bbd856c Fix test name typo (flutter/engine#9362)
Had change locally but forgot to `git commit -a` before `git push`...
2019-06-18 12:38:26 -07:00
ojhunt
ddf4dc8452 Update component manifests for ambient replace-as-executable (flutter/engine#9350)
Bug: SEC-314

dding this feature all fuchsia components as a pre-flight step
as we restrict the ability for arbitrary processes to make
VMOs executable.
2019-06-17 18:48:13 -07:00
Jason Simmons
054cb2d952 Use the DartServiceIsolate status callback to publish the observatory URI to the Android embedder (flutter/engine#9337)
The Android embedder had been using a JNI call to get the observatory URI from
DartServiceIsolate.  This call was not thread safe and was redundant with the
server status callback mechanism used on iOS.
2019-06-17 16:17:29 -07:00
Jason Simmons
450c59a900 Send the isolate service ID from the engine to the embedder (flutter/engine#9324)
Applications can use an embedder API to obtain the isolate ID and then use it
in calls to the Dart service protocol.
2019-06-17 16:02:26 -07:00
Gary Qian
9b7873533c Check for invalid indexes when performing InputAdpator backspace. (flutter/engine#9322) 2019-06-17 15:13:30 -07:00
stuartmorgan
03dfbfd017 Reorganize darwin for shared ios/macOS (flutter/engine#9255)
When the macOS framework was initially landed, it included some iOS code
using a localized hack. This reorganizes the code structure to clearly
indicate which files are shared between iOS and macOS, vs. those that
are platform-specific.
2019-06-17 11:24:41 -07:00
XieRan.sai
17fd7dbc37 Fix crash on Huawei device with AndroidView (flutter/engine#9192)
Fixes a rare NullPointerException on Huawei devices:
```
Stacktrace:
java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.DisplayAdjustments android.view.Display.getDisplayAdjustments()' on a null object reference
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1793)
...
```
2019-06-17 11:06:27 -07:00
gaaclarke
92c6734ace Removed an unused class definition for iOS code. (flutter/engine#9346) 2019-06-17 10:20:35 -07:00
Chinmay Garde
5f5821e8c1 Replace lock_guard with scoped_lock and use class template argument deduction. (flutter/engine#9338) 2019-06-17 10:08:45 -07:00
Jason Simmons
6336502de9 Handle one-way platform messages in the embedder library (flutter/engine#9331)
Messages sent to the embedder host may be one-way messages with no response
handler.  If the host calls FlutterEngineSendPlatformMessageResponse on a
one-way message, then just delete the message response handle.

Also update the documentation to indicate that
FlutterEngineSendPlatformMessageResponse must be called for all messages.
Previously the docs implied that some FlutterPlatformMessage objects may
have a null response_handle.  The embedder will now set a response_handle for
every message (even if the sender does not expect a response).
2019-06-14 13:58:09 -07:00
Michael Klimushyn
177353d759 Fix a11y in embedded Android views post O (flutter/engine#9321)
This patch works around Android's limitations on reflection. With it embedded
platform views that use virtual node hierarchy trees should be accessible on all
Android versions to date.

The workarounds in this PR are brittle. Ideally the methods would be made public
in Android instead so we wouldn't need to employ tactics like these to work
around the missing methods.

`AccessibilityNodeInfo#getChildId` is blocked from any type of reflection
access, but the underlying private member that the getter accesses,
`mChildNodeIds`, can still be reflected on. On Android versions where we can't
access the getter, this patch falls back on reflectively accessing the field
instead. Unfortunately this field is a
[`LongArray`](https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/util/LongArray.java),
a utility data class private to Android. So in this case we're reflecting to
both access the member and actually read data from it, since we need to use
reflection to call `LongArray.get(index)`.

`AccessibilityNodeInfo#getParent()` doesn't have any lucky available underlying
members. However, `AccessibilityNodeInfo` itself is `Parcelable`, and
`mParentNodeId` is one of the pieces of data that's written to a parcel via
`AccessibilityNodeInfo#writeToParcel`. So the fallback for that is to write the
node to a parcel and then read the parcel for the ID in question. This will
break if the implementation details of `AccessibilityNodeInfo#writeToParcel`
ever change. The details have already changed enough in the past to require two
sets of logic for reading from the parcel.
2019-06-14 11:43:41 -07:00
Todd Volkert
8ad6910047 Fix rawTypes errors in Android embedding classes (flutter/engine#9326) 2019-06-14 00:27:06 -07:00
Jason Simmons
31d498ce5c Build the GLFW shell on Linux host builds but not target builds (flutter/engine#9320)
Linux targets building the embedder library may be targeting environments
that do not support GLFW and GTK.
2019-06-13 16:22:33 -07:00
gaaclarke
686215ac99 Added class docstrings for classes inside of shell/common. (flutter/engine#9303)
Added class docstrings for classes inside of shell/common.
2019-06-13 16:15:10 -07:00
Francisco Magdaleno
344f8e359c [macos] Adds clipboard string read/write support to macOS (flutter/engine#9313) 2019-06-13 15:15:20 -07:00
Jason Simmons
73b80c1efb Only build embedder unit tests for host builds (flutter/engine#9315)
Linux target builds for non-x86/x64 platforms were failing due to the
dependency on SwiftShader
2019-06-13 12:49:10 -07:00
Jenn Magder
23b2997ec0 Decorate UIApplicationDelegate wrappers with matching UIKit deprecation (flutter/engine#9304) 2019-06-13 10:16:42 -07:00
Jason Simmons
520c272514 When running in AOT modes create a flutter_assets directory that can be used as the bundle path (flutter/engine#9306)
The engine RunBundleAndSnapshotFromLibrary API expects a bundle path directory
containing the application's assets.  If the Android embedding is using
AOT ELF library packaging and does not need to extract assets, then create an
empty directory at the bundle path.

Fixes https://github.com/flutter/flutter/issues/34287
2019-06-12 17:34:02 -07:00
Chinmay Garde
c45b5c0dee Wire up Swiftshader based OpenGL ES unit-tests on hosts. (flutter/engine#9264)
Currently, all our host unit-tests that have rendering concerns use the software backend because of OpenGL ES availability and stability issues on the various platforms where we run host tests. Unfortunately, entire subsystems are disabled (and not tested) when rendering with the software backend. This patch pulls in SwiftShader and via pending patches in the buildroot, configures the host unit-tests to optionally use OpenGL ES in a stable manner without relying on the OpenGL drivers being present (and functional).

I have wired up the embedder test fixture in this patch to use the SwiftShader based OpenGL ES driver. I will update the shell and runtime unittests in a subsequent patch as well. The on and offscreen surfaces are configured as 1x1 pbuffer surface because we should be able to write pixel tests using OpenGL directly wihout having to deal with surfaces.
2019-06-12 12:32:09 -07:00
Zachary Anderson
35107c4dca Revert tracing changes (flutter/engine#9296)
* Revert "[fuchsia] Fix alignment of Fuchsia/non-Fuchsia tracing (#9289)"

This reverts commit e7d406fe36790b1a8161d4687a6a4a144ba44254.

* Revert "Align fuchsia and non-fuchsia tracing (#9199)"

This reverts commit 1ccb372e5f8ceaaf90f5b43b42df617d7f18d955.
2019-06-12 10:25:49 -07:00
Dan Field
899cd81833 [iOS] [a11y] Don't allow scroll views to grab a11y focus (flutter/engine#9282) 2019-06-11 18:02:47 -07:00
Matt Carroll
fb2826eb79 Fixed memory leaks within FlutterFragment and FlutterView (#34268, #34269, #34270). (flutter/engine#9288) 2019-06-11 17:01:20 -07:00
liyuqian
fe0db192d9 Report timings faster (100ms) in profile/debug (flutter/engine#9287)
This should satisfy the low-latency need of DevTools.

Test added:
* ReportTimingsIsCalledSoonerInNonReleaseMode
* ReportTimingsIsCalledLaterInReleaseMode
2019-06-11 16:51:20 -07:00
stuartmorgan
87070e4145 Add refresh callback to GLFW shell (flutter/engine#9280)
In some cases, the window needs to be redrawn without a resize. This
adds a callback for that case to trigger a repaint.

Since there's no embedding API for repainting, trigger it with a window
metrics event using the current window size.

Fixes https://github.com/flutter/flutter/issues/30731
2019-06-11 16:16:14 -07:00
Matt Carroll
6aed5635cd Expose a hasRenderedFirstFrame() method in FlutterView (#34275). (flutter/engine#9285) 2019-06-11 15:47:04 -07:00
Matt Carroll
aaee816c89 Fix TextInputPlugin NPE caused by PlatformViewsController ref in new embedding (#34283). (flutter/engine#9283) 2019-06-11 15:21:55 -07:00
stuartmorgan
0c39e8283e Fix crash on minimize with GLFW shell (flutter/engine#9278)
Fixes a divide-by-zero in pixel density computation.
2019-06-11 11:50:19 -07:00
Jason Simmons
888d951d19 Load AOT compiled Dart assets only from ELF libraries (flutter/engine#9260)
Previously AOT compiled Dart code would be packaged as a group of assets
within the APK.  This has been replaced by a single ELF library containing
the same data.
2019-06-11 10:10:45 -07:00
Chinmay Garde
b01f09fea6 Whitelist the —enable_mirrors flag to fix regression in existing embedder. (flutter/engine#9266) 2019-06-11 10:09:16 -07:00
Dan Field
903bb51f0e Unbreak internal rolls (flutter/engine#9270)
Adds back constructor for Rasterizer temporarily
2019-06-11 08:52:41 -07:00
Matt Carroll
b29ba6d09d Removed VIRTUAL_KEYBOARD check in TextInputPlugin because it's blocking Espresso work and its purpose is unknown. (flutter/engine#9238) 2019-06-10 13:30:39 -07:00
liyuqian
43f4c1d3c7 Make flow layers' attributes immutable (flutter/engine#9176)
For https://github.com/flutter/flutter/issues/33807

We still need to make layers' children immutable for full immutability.
That will require us to change the SceneBuilder API to build the layer
bottom up instead of top down (post-order traversal instead of pre-order
traversal).
2019-06-10 13:09:37 -07:00
Amir Hardon
8fcd81b36a Reland "Keyboard support for embedded Android views. (#9203) (flutter/engine#9257)
#9203 broke the keyboard_resize integration test(see more details in flutter/flutter#34085 (comment)).

This re-lands @9203 and fixes the issue the integration test uncovered by always allowing to hide the keyboard.

The difference from the original change is 07d2598
2019-06-10 12:56:35 -07:00
Wu Zhong
cdfbefc864 Correct typo (flutter/engine#9244) 2019-06-09 09:06:43 -07:00
Jonah Williams
162f3b9e38 Revert "Keyboard support for embedded Android views. (#9203)" (flutter/engine#9239) 2019-06-07 18:21:57 -07:00
Dan Field
c64bdc2629 Document AccessibilityBridge.java (flutter/engine#9237) 2019-06-07 16:00:38 -07:00
Ben Konyi
00de8257d5 Remove unnecessary whitelisted flags for --dart-flags (flutter/engine#9233) 2019-06-07 14:43:43 -07:00
Amir Hardon
5f0df6eba8 Keyboard support for embedded Android views. (flutter/engine#9203)
Generally what this PR is doing is setting up a delegation mechanism
for Android's onCreateInputConnection.

It works by letting the framework know when an embedded view gets loses
focus(within the virtual display), the framework maintains a focus node
for each Android view that is kept in sync with the focus state of the
embedded view.

The TextInputPlugin is extended to allow for 2 type of text clients a
"framework client"(what we had before) and a "platform view client".
When the AndroidView's focus node in the framework is focused the
framework sets a "platform view text client" for the TextInputPlugin,
which will result in the TextInputPlugin delegating
createInputConnection to the platform view.

When a platform view is resized, we are detaching it from a virtual
display and attaching it to a new one, as a side affect a platform view
might lose an active input connection, to workaround that we "lock" the
connection when resizing(by caching it and forcing the cached copy until
the resize is done).

Additional things worth calling out in this PR:

To properly answer which views are allowed for input connection
proxying we compare a candidate view's root view to the set of root
views of all virtual displays.
We also preserve a view's focus state across resizes.
Note that this PR only wires text for the io.flutter.view.FlutterView
For the new Android embedding some additional plumbing is necessary.

Corresponding framework PR: flutter/flutter#33901

flutter/flutter#19718
2019-06-06 21:58:04 -07:00