556 Commits

Author SHA1 Message Date
Amir Hardon
345ae7d373
Delegate a11y events and action to/from embedded Android platform views. (#8250)
Delegate a11y events and action to/from embedded Android platfrom views.

This handles delegation of:
  * AccessibilityNodeProvider#performAction
  * ViewGroup#requestSendAccessibilityEvent
  * View#onHoverEvent

Additionally updates the currently input accessibility focused node state that is
tracked by the a11y bridge when an embedded view's node is focused.
2019-03-25 14:26:49 -07:00
Jason Simmons
68bd4f2c64
Do not drop the DartExecutor's message handler when a FlutterNativeView is detached from the FlutterView (#8254)
An activity can use ViewFactory.retainNativeFlutterView to reuse a
FlutterNativeView across multiple instances of the activity.  In this
scenario, the FlutterNativeView should continue to handle incoming messages
sent from Dart.
2019-03-21 18:08:58 -07:00
Amir Hardon
06635d38a9
Mirror Android platform views a11y tree in the Flutter a11y tree. (#8237)
This PR mirrors virtual a11y tree of embedded platform views in the Flutter
a11y tree.

Non virtual hierarchies are not currently supported.

Only works on Android versions earlier than Android P as it relies on
reflection access to hidden system APIs which cannot be done starting
Android P.

A11y is not yet working as we also need to delegate a11y events from the
platform view to the FlutterView. This will be done in a following PR to
keep the change size a little saner.
2019-03-21 15:26:44 -07:00
Matt Carroll
28433c513c
FlutterJNI no longer asserts it is attached when dispatching platform messages and instead fizzles with a warning if not attached. Not sure what root cause of issue is, but this is necessary to avoid crashes. (#8246) 2019-03-21 13:45:13 -07:00
Jason Simmons
fa435385b6
Use the GPU thread for Android surface on-screen context lifecycle operations (#8234)
Fixes https://github.com/flutter/flutter/issues/29679
2019-03-20 17:43:53 -07:00
Matt Carroll
188adf7e5e
Removed Activity reference from AccessibilityBridge by using a View for insets instead of the Activity (#18115) (#8231) 2019-03-20 14:18:34 -07:00
Amir Hardon
6a8a45fc4f
Have the AccessibilityBridge attach/detach itself to the (#8229)
PlatformViewsDelegate.

Since onDetachedFromWindow can be called after the activity was
destroyed, the previous call to detach the accessibility bridge could
have crash as the NativeFlutterView was already null.
2019-03-20 12:26:30 -07:00
Matt Carroll
1dbd2046b5
Moved io.flutter.embedding.engine.android package to io.flutter.embedding.android (#8221) 2019-03-20 11:30:49 -07:00
Amir Hardon
45f69ac471
Plumb a reference of PlatformViewsController and AccessibilityBridge to each other (#8208)
This is in preparation for implementing platform views a11y on Android.

And e2e working prototype is available here: https://github.com/amirh/engine/tree/a11y_hacks

flutter/flutter#19418
2019-03-19 15:48:45 -07:00
Matt Carroll
b32d0ab982
Bugfix: Prevent crash when responding to a platform message after FlutterJNI detaches from native (#28651). (#8170) 2019-03-14 21:13:03 -07:00
Matt Carroll
09db84fad6
Android Embedding PR 19: Add accessibility to new FlutterView. (#8109) 2019-03-14 14:24:49 -07:00
liyuqian
66fdeb163e
Add dump-shader-skp switch to help ShaderWarmUp (#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
fcc66fc235
Suppress deprecation warning for use of Build.CPU_ABI (#8154) 2019-03-13 14:36:35 -07:00
Jason Simmons
b1b388f1c2
Encode scroll motion events in the Android touch processor (#8149) 2019-03-13 11:30:42 -07:00
Jason Simmons
9f50dae33f
Look up ICU symbols based on the path to libflutter.so as a fallback (#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
8b0df6ded5
Bugfix #29203: NPE in getAccessibilityProvider in old FlutterView. (#8126) 2019-03-11 23:45:03 -07:00
Matt Carroll
20165b3147
Integrated AndroidTouchProcessor within the old FlutterView (#8095) 2019-03-11 16:04:44 -07:00
Michael Goderbauer
bd0f9085e5
Adds a platfromViewId to SemanticsNode (#8055) 2019-03-11 11:30:35 -07:00
Jonah Williams
4e54bc93ca
Guard initialization of touch exploration listener (#8103) 2019-03-09 15:07:26 -08:00
Matt Carroll
718329ce6e
Android Embedding PR 17: Clarify AccessibilityBridge and move logic out of FlutterView. (#8061) 2019-03-08 18:09:04 -08:00
Matt Carroll
edfc0cfaaf
Android Embedding PR 16: Add touch support to FlutterView. (#8034) 2019-03-08 18:08:26 -08:00
Michael Klimushyn
1d10e0eb67
Guard against NewAPI failures (#8048)
Adds minimum SDK checks around minimum APIs.

flutter/flutter#28848
2019-03-08 13:33:58 -08:00
Jonah Williams
ca0bac4fb0
Revert "add signal to pointer kinds" (#8066) 2019-03-06 20:55:34 -08:00
stuartmorgan
dd80fc9ff6
Add engine support for scrollwheel events (#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
Matt Carroll
8f1fdcd195
Android Embedding PR 14: Almost done with FlutterFragment. (#8000) 2019-03-04 18:02:24 -08:00
Matt Carroll
fb3e35d6ac
Android Embedding PR15: Add Viewport Metrics to FlutterView (#8029) 2019-03-04 17:12:52 -08:00
Dan Field
a2246c1990
Start of linting Android embedding (#8023)
* Add a tool for running Android SDK lint on Android embedding
2019-03-04 13:55:53 -08:00
Greg Spencer
293cfcaa54
Guard against using Android API not defined in API level 16 & 17 (#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
Matt Carroll
fe15149d1a
Android Embedding PR 12: Add lifecycle methods to FlutterActivity. (#7974) 2019-02-28 16:51:17 -08:00
Matt Carroll
6145e9046a
Android Embedding PR 13: Integrated text input, keyevent input, and some other channel comms in FlutterView. (#7979) 2019-02-28 15:02:56 -08:00
Matt Carroll
56c16154ea
Android Embedding PR 9: Introduce an AndroidTouchProcessor to convert MotionEvents to Flutter touch data. (#7947) 2019-02-28 14:44:28 -08:00
Matt Carroll
2360b459de
Android Embedding PR 11: Add FlutterEngine to FlutterFragment. (#7972) 2019-02-27 21:09:28 -08:00
Jason Simmons
1089b5c9f8
Check for a null pressure range for motion events (#7986)
Fixes https://github.com/flutter/flutter/issues/28490
2019-02-27 11:27:19 -08:00
Matt Carroll
4db7c30501
Android Embedding PR 10: Add system channels to FlutterEngine. (#7960) 2019-02-26 19:05:18 -08:00
Jason Simmons
9f92324fd6
Suppress deprecation warning for usage of Configuration.locale (#7973) 2019-02-26 17:03:10 -08:00
Ben Konyi
fb1c543dd4
Link dart:* sources into engine for debugger source support (#7908)
Link dart:* sources into engine for debugger source support

Currently, dart:* libraries appear to have no source in
debuggers like Observatory. With this change, these sources will be
available in debug mode applications. Sources for dart:* libraries are
lazily loaded on a script-by-script basis.

Refer to https://dart-review.googlesource.com/c/sdk/+/93375 for the Dart
SDK change.
2019-02-26 13:28:04 -08:00
Gary Qian
4434a39c7d
Add api 21 check to LocalizationChannel.java (#7967) 2019-02-26 11:33:07 -08:00
Matt Carroll
9f95ef23aa
Android Embedding PR 8: Add FlutterEngine attachment/detachment to FlutterView (#7946) 2019-02-26 01:54:17 -08:00
Matt Carroll
31d31e6d2a
Android PR 7: Introduce structure of FlutterActivity and FlutterFragment (#7912) 2019-02-26 01:48:09 -08:00
Matt Carroll
18ad03d49d
Fixed an Android keyboard entry bug that was introduced by the embedding refactor. (#28438) (#7954) 2019-02-25 19:15:49 -08:00
Jason Simmons
fd6c3fc700
Do not clear FlutterJNI state when a FlutterView is detached (#7929)
If an app is using retainFlutterNativeView or a plugin wants to keep the
FlutterNativeView active, then the FlutterNativeView should not drop its
handle to the corresponding native platform view.

Fixes https://github.com/flutter/flutter/issues/26931
2019-02-25 15:31:50 -08:00
Ivan
f7306394e3 fix sendLocales on old android versions (#7937)
[Configuration.getLocales()][1] was added in API level 24. 
For earlier versions, we instead return only the current locale.

Fixes https://github.com/flutter/flutter/issues/28321

[1]: https://developer.android.com/reference/android/content/res/Configuration#getLocales()
2019-02-24 22:29:16 -08:00
Matt Carroll
502c9c4002
Android Embedding PR 6: Introduce FlutterView structure with FlutterSurfaceView and FlutterTextureView. (#7896) 2019-02-24 20:41:18 -08:00
Stanislav Baranov
36d495d57a
Dynamic patching support for native code libraries. (#7927) 2019-02-22 14:18:47 -08:00
Stanislav Baranov
5809adea41
Make the layout of dynamic patch bundle similar to APK. (#7925)
This will help further changes when we pull other artifacts into the bundle.
2019-02-22 12:56:35 -08:00
Chinmay Garde
33bb91cc15
Allow embedders to specify a vsync waiter. (#7914)
Fixes https://github.com/flutter/flutter/issues/28240
2019-02-21 23:02:32 -08:00
Stanislav Baranov
aa2b287cbf
Reland #7777 with proper LICENSE (#7888) 2019-02-21 13:45:24 -08:00
Chinmay Garde
684c9394c0
Respect the custom GL proc table when creating the resource context on the IO thread. (#7893)
Fixes https://github.com/flutter/flutter/issues/28229
2019-02-20 17:23:14 -08:00
Matt Carroll
e11d0e96fb
Android embedding refactor pr5 add flutterengine impl (#7878) 2019-02-20 17:06:33 -08:00
Matt Carroll
2f4a38dbd3
Android embedding refactor pr3 add remaining systemchannels (#7892)
Merging back in after reversion. Fixed some messaging issues in FlutterNativeView and corrected some message parsing.
2019-02-20 17:05:31 -08:00