1405 Commits

Author SHA1 Message Date
Jason Simmons
e4a2320fdd Simplify loading of app bundles on Android (flutter/engine#9360)
* Remove deprecated runBundle APIs
* Remove code related to dynamic patching (including support for multiple
  bundle paths)
* Change FlutterRunArugments.bundlePath to be the Android AssetManager path
  where the app's assets are located
2019-06-25 14:17:50 -07:00
Chris Bracken
15fcb8aeca Add --observatory-host switch (flutter/engine#9485)
Adds --observatory-host, which allows callers to specify the localhost
IP binding directly. Allows users to set 0.0.0.0 or the host IP address
as is possible in the standalone VM, rather than restricting users to
loopback.

We retain the default behaviour of binding to loopback since the vast
majority of observatory use-cases involve local access (e.g. host tests
on flutter_tester) or port-forwarded local access (e.g. flutter driver
device tests). However, some scenarios, such as QA test labs, may
benefit from binding to a publicly-accessible IP address.
2019-06-25 13:20:39 -07:00
Chris Bracken
52ceaee505 Revert "IOS Platform view transform/clipping (#9075)" (flutter/engine#9480)
This reverts commit 5625d01b324f5a0d94aaa916d9e08fd038e363b3.

Seeing the following breakage on host build:
```
../../flutter/flow/scene_update_context.cc:205:36: error: non-const lvalue reference to type 'flutter::MutatorsStack' cannot bind to a value of unrelated type 'const flutter::Stopwatch'
                                   frame.context().raster_time(),
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../flutter/flow/scene_update_context.cc:207:36: error: no viable conversion from 'flutter::TextureRegistry' to 'const flutter::Stopwatch'
                                   frame.context().texture_registry(),
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../flutter/flow/instrumentation.h:55:32: note: candidate constructor not viable: no known conversion from 'flutter::TextureRegistry' to 'const flutter::Stopwatch &' for 1st argument
  FML_DISALLOW_COPY_AND_ASSIGN(Stopwatch);
                               ^
../../flutter/fml/macros.h:28:3: note: expanded from macro 'FML_DISALLOW_COPY_AND_ASSIGN'
  TypeName(const TypeName&) = delete;          \
  ^
../../flutter/flow/scene_update_context.cc:208:36: error: non-const lvalue reference to type 'flutter::TextureRegistry' cannot bind to a temporary of type 'flutter::RasterCache *'
                                   &frame.context().raster_cache(),
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../flutter/flow/scene_update_context.cc:209:36: error: cannot initialize a member subobject of type 'const flutter::RasterCache *' with an rvalue of type 'bool'
                                   false};
                                   ^~~~~
```
2019-06-25 10:48:37 -07:00
Amir Hardon
e49d31bbec fix NPE when a touch event is sent to an unknown Android platform view (flutter/engine#9476) 2019-06-25 09:45:20 -07:00
Chris Yang
5625d01b32 IOS Platform view transform/clipping (flutter/engine#9075) 2019-06-25 09:33:50 -07:00
Matt Carroll
59bd2aecc0 Removed unused imports in new embedding. (flutter/engine#9463) 2019-06-25 01:59:33 -07:00
Matt Carroll
71e9854a33 Fixed logLevel filter bug so that filter now works as expected. (flutter/engine#9460) 2019-06-24 23:03:42 -07:00
Amir Hardon
110c63afaf Don't hang to a platform view's input connection after it's disposed (flutter/engine#9423)
Addresses the crash reported in https://github.com/flutter/flutter/issues/19718#issuecomment-504174596
2019-06-24 13:13:00 -07:00
liyuqian
ac90c31ae4 Remove unused/unimplemented shell constructor (flutter/engine#9459) 2019-06-24 12:59:54 -07:00
liyuqian
8bd7715e9c Send timings of the first frame without batching (flutter/engine#9424)
For https://github.com/flutter/flutter/issues/34867

Test added:
* ReportTimingsIsCalledImmediatelyAfterTheFirstFrame
2019-06-24 12:40:38 -07:00
Chris Bracken
009ba77bda Eliminate unused import in FlutterView (flutter/engine#9439)
Eliminates an unused import in FlutterView.java. Fixes import ordering.
2019-06-24 11:17:18 -07:00
liyuqian
7606eb25fb Generate weak pointers only in the platform thread (flutter/engine#9431) 2019-06-24 10:33:34 -07:00
Matt Carroll
084284d533 Resolves embedding log chattyness by gating verbose, debug, and info logs by level (#34876). (flutter/engine#9425) 2019-06-21 16:40:32 -07:00
Amir Hardon
2203181ff2 delegate checkInputConnectionProxy to the relevant platform view (flutter/engine#9426)
The previous logic allowed proxying for any view that belonged to one of the platform views' virtual displays which may lead to us allowing proxying for a view that the platform view isn't allowing proxying for, previous logic also didn't account for unattached views.

This change instead delegates the decision to the platform view.

We use the fact that each virtual display has its unique context to associate any view with its relevant virtual display.

A nice side effect of calling the platform view's checkInputConnectionProxy for webviews is that the plugin now has a way to get a handle to the ThreadedInputConnectionProxyView, which may be useful for getting keyboard working on webview's prior to Android N.
2019-06-21 14:30:58 -07:00
gaaclarke
5ff4512832 Added unit tests for the ios code. (flutter/engine#9388)
* Added unit tests for the ios code.

* Moved the tests to live next to the source.

* Added mocking library.

* Fixed formatting and removed third_party from the format check.

* fixed formatting 2

* Removed ocmock from third_party.

* Added ocmock to third_party, compile from source.

* removed ocmock from license checking

* updated licenses_flutter

* updated tool_signature
2019-06-20 17:37:03 -07:00
Matt Carroll
78bd3aa73b Android Embedding Refactor PR35: Ensure all JNI methods are in FlutterJNI (#34751). (flutter/engine#9391) 2019-06-20 17:13:58 -07:00
Simon Lightfoot
2b66f64511 Avoid a full screen overlay within virtual displays (flutter/engine#9343)
Add views that are added directly to a platform view's window as siblings to the platform view's container view, rather than as children of a full screen container.

This prevents a false-negative for a visibility check from a specific ads SDK (Teads), which [reported the following warning](https://github.com/flutter/flutter/issues/12114#issuecomment-500906158):
```
W/teads#Visibility(17978): The Teads AdView is visible at 0%, hidded by 1 View(s):
W/teads#Visibility(17978):   -  View of class io.flutter.plugin.platform.SingleViewPresentation$FakeWindowViewGroup, with id: -1, with contentDescription: null, with a size of: [width: 1050, height: 875] is hidding 100% of the ad
```
2019-06-20 16:46:26 -07:00
Jason Simmons
0e29357616 Remove build flags for dynamic patching (flutter/engine#9394) 2019-06-20 15:25:04 -07:00
Chris Yang
725e33773d Workaround fix the platform view dismiss crash related to gl (flutter/engine#9377) 2019-06-20 11:52:52 -07:00
Francisco Magdaleno
900692eb09 [glfw] Implement SystemNavigator.pop (flutter/engine#9365)
* [glfw] Implement SystemNavigator.pop

* Exit the program

* Add success result
2019-06-20 09:55:12 -07:00
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