170 Commits

Author SHA1 Message Date
Kaushik Iska
8818677dfd Track motion events for reuse post gesture disambiguation (flutter/engine#19484)
This change makes it so that we track all the motion events encountered by `FlutterView` and all of its subviews in the `MotionEventTracker` class, indexed by a unique `MotionEventId`. This identifier is then passed to the Flutter framework as seen in https://github.com/flutter/flutter/pull/60930. Once the gestures take part in gesture disambiguation and are sent back to the engine, we look-up the original motion event using the `MotionEventId` and dispatch it to the platform.

Bug: https://github.com/flutter/flutter/issues/58837
2020-07-06 22:22:37 -07:00
Chris Yang
cf4d2e25d9 Implement mutator stack on Android hybrid composition platform view (flutter/engine#19426) 2020-07-04 13:03:04 -07:00
Gary Qian
fa5dca45d5 Android native locale resolution algorithm (flutter/engine#19266) 2020-06-26 02:48:33 -07:00
Maurice Parrish
a51b5b22d6 Creates a new RenderMode for FlutterView (flutter/engine#19143) 2020-06-22 14:40:00 -07:00
Emmanuel Garcia
202c1af268 Implement external view embedder on Android (flutter/engine#19033)
The external view embedder allows to embed Android views in a Flutter app.
2020-06-20 12:51:55 -07:00
cg021
ef2b08d5b6 createOverlaySurface JNI method (flutter/engine#19076)
* createOverlaySurface JNI

* update imports

* remove unused method

* license

* deleted unused file

* remove wrong function call

* removed duplicate createOverlaySurface
2020-06-17 15:21:41 -05:00
Emmanuel Garcia
f44a132c1b Revert add createOverlaySurface JNI #19040 (flutter/engine#19075) 2020-06-16 14:06:15 -07:00
Gary Qian
c9fa545cf3 Platform resolved locale and Android localization refactor (flutter/engine#18645) 2020-06-16 04:29:50 -07:00
cg021
1e0b020dde Add createOverlaySurface JNI (flutter/engine#19040) 2020-06-15 19:49:29 -07:00
Michael Goderbauer
8b7389a9c8 Wire up channel for restoration data (flutter/engine#18042) 2020-06-12 16:31:25 -07:00
Emmanuel Garcia
edb8164038 Put JNI functions under an interface (flutter/engine#18903) 2020-06-10 18:40:58 -07:00
xster
9a3d13748b Fix intent builder visibility (flutter/engine#18875) 2020-06-08 12:08:04 -07:00
Emmanuel Garcia
2bee676fe5 Refactor AndroidContextGL, AndroidSurface and AndroidSurfaceGL (flutter/engine#18670) 2020-06-05 09:18:03 -07:00
Tong Mu
75724a5657 System mouse cursor: Android (flutter/engine#18569)
Adds system mouse cursor to the Android engine.
2020-06-01 18:08:43 -07:00
xster
70a4de6878 Let run_tests.py just stream output (flutter/engine#18534) 2020-05-20 21:38:37 -07:00
Mehmet Fidanboylu
6baffb9091 Add tests for StandardMethodCodec (flutter/engine#18521) 2020-05-20 21:02:03 -07:00
xster
d216d2e76f Make robolectric tests run against SDK 29 by default (flutter/engine#17996) 2020-05-07 23:29:02 -07:00
Ali Mahdiyar
f1e911f717 Custom unicode handling for Android backspace via JNI to ICU (flutter/engine#17960) 2020-05-06 14:01:02 -07:00
Jason Simmons
e2907d3089 Remove the ResourceCleaner from the Android embedding (flutter/engine#18072) 2020-05-04 16:34:02 -07:00
Emmanuel Garcia
f6c5bdea96 Add initial unit tests for the android embedding (flutter/engine#17921) 2020-04-26 20:45:28 -07:00
Emmanuel Garcia
c6f023fe75 Extend external view embedder on Android (flutter/engine#17839) 2020-04-21 19:14:38 -07:00
Jonah Williams
152ae6b486 [a11y] Support TalkBack reading by word, character, and paragraph (flutter/engine#17626) 2020-04-15 19:07:12 -07:00
Shi-Hao Hong
7eae32d7f2 Revert getSystemGestureExclusionRects and setSystemGestureExclusionRects (flutter/engine#17613)
* Revert getSystemGestureExclusionRects and setSystemGestureExclusionRects 

* Remove references to removed PlatformChannelTest.java file
2020-04-09 20:44:37 -07:00
Jason Simmons
33843702fe Add the Android SDK lambda stub library to the classpath (flutter/engine#17508)
Previously the build scripts obtained the lambda support classes from rt.jar,
which is no longer provided by recent versions of the JDK.
2020-04-07 11:24:52 -07:00
Emmanuel Garcia
257b799767 Migrate embedding to AndroidX (flutter/engine#17075) 2020-03-13 21:19:24 -07:00
Edman P. Anjos
519eae37a0 Add support for software text editing controls (flutter/engine#15560)
* Add support for software text editing controls

Includes selection, copy, cut, paste, as well as partial support for up
and down movement.

Text editing controls can be accessed in GBoard by:
  top-left arrow > three dots menu > text editing

Partial fix for flutter/flutter#9419 and flutter/flutter#37371.

* Introduce InputConnectionAdaptor tests

Run with:
  testing/run_tests.py --type=java --java-filter=io.flutter.plugin.editing.InputConnectionAdaptorTest

* Fix BUILD.gn comment on run_tests.py --java-filter flag
2020-02-28 20:18:04 +01:00
Justin McCandless
9c628f10d8 Fix the newline on some keyboards (flutter/engine#16560) 2020-02-20 10:36:03 -08:00
Matt Carroll
bd50ab762a Exposes FlutterSurfaceView, and FlutterTextureView to FlutterActivity and FlutterFragment. (#41984, #47557) (flutter/engine#16552) 2020-02-12 19:21:00 -08:00
Matt Carroll
672995657d Added API guards to flags in PlatformPlugin that were introduced after Flutter's min SDK version. (flutter/engine#13965) 2020-02-03 16:25:27 -08:00
Chinmay Garde
426c48aaac Remove all uses of the redundant flutter_root variable. (flutter/engine#16311)
This was only necessary when the Engine had to build in multiple buildroots
where the sources where checked out at different paths relative to the
buildroot. This is no longer the case and there are already cases GN rules
have been written that mix and match variable usage with the direct
specification of the path to the Flutter sources relative to the sole buildroot.
2020-01-31 21:49:48 -08:00
Michael Klimushyn
f3ec835234 Register plugins at the right time, once (flutter/engine#15979)
Currently we're automatically registering plugins both when the
FlutterEngine is constructed and in the `flutter create` template, when
FlutterActivity#configureFlutterEngine is called. The initial
registration is too early to contain a reference to the activity and the
second registration can cause problems in some plugins.

This alters the flow so automatic registration happens in two discrete
places, and contains the `activity` in its first and only call for most
apps.

1. We're no longer automatically registering plugins on `FlutterEngine`
in any of our activities/fragments at construction time. But since the
FlutterEngine default constructor still automatically registers plugins,
anyone constructing the engine themselves (for example, in a service) is
still going to get automatic registration at `FlutterEngine`
instantiation time.
2. We now automatically register plugins in the base `FlutterActivity`'s
`configureFlutterEngine` hook. Anyone using `FlutterActivity` (or
`FlutterFragment`) should be automatically registered once that hook is
called. Right now the `flutter create` template overrides the base class
method with a subclass that registers everything manually in the same
spot. But with this in place we can safely recommend to remove the
subclass and rely on this hook to automatically register going forward.
Registering at this time means `activity` is set correctly.
2020-01-25 00:34:52 -08:00
Matt Carroll
10e5d6d7b5 Prevent duplicate plugin registration in FlutterEnginePluginRegistry. (#49365) (flutter/engine#15956) 2020-01-24 15:57:51 -08:00
Matt Carroll
2d86c18a75 Make BackgroundMode public. (#45747) (flutter/engine#14673) 2020-01-08 21:41:34 -08:00
Matt Carroll
be849d1363 Add support for --dart-flags in FlutterShellArgs. (#44855) (flutter/engine#13855) 2019-11-14 04:09:08 +00:00
Matt Carroll
6bf82e4675 Expose asset lookup from plugin binding. (#42019) (flutter/engine#13743) 2019-11-12 07:14:27 +00:00
xster
7e3e60d902 Release shim bindings when detaching (flutter/engine#13432) 2019-11-01 17:53:15 -07:00
Matt Carroll
49819893ec Automatically register plugins in FlutterEngine. (#43855) (flutter/engine#13455) 2019-10-31 14:10:45 -07:00
Jason Simmons
2c61d2336b Reformat BUILD.gn files to comply with the format checker presubmit script (flutter/engine#13401) 2019-10-29 09:49:16 -07:00
Matt Carroll
63ddf0ce72 Converted ActivityAware and ServiceAware Lifecycles to opaque objects (#43670) (flutter/engine#13402) 2019-10-28 21:41:07 -07:00
Matt Carroll
b2b2f011e7 Remove multiplexed Flutter Android Lifecycle. (#43663) (flutter/engine#13394) 2019-10-28 16:22:11 -07:00
Matt Carroll
454b97d691 Deprecated DartExecutor as BinaryMessenger and added a getBinaryMessenger() method. (#43202) (flutter/engine#13349) 2019-10-25 20:07:13 -07:00
Matt Carroll
f89e36a95b Android embedding API updates for plugin ecosystem - plugin facade, split Lifecycle, save state callbacks to plugins (#43241, #43242, #43295) (flutter/engine#13280) 2019-10-24 19:10:05 -07:00
Michael Klimushyn
4b9fc4c1a5 Fire PlatformViewController FlutterView callbacks (flutter/engine#13015)
Fixes a bug where `PlatformViewController` was not being notified of `FlutterView` attachment changes.
2019-10-14 14:03:25 -07:00
Matt Carroll
d632e81dd4 Move initialization into FlutterEngine (flutter/engine#12806) 2019-10-11 16:15:55 -07:00
Dan Field
80492fb4e9 Android targets create final zip artifacts (flutter/engine#13059) 2019-10-10 06:56:43 -07:00
Michael Klimushyn
be42c21dc1 Work around Samsung keyboard issue (flutter/engine#12432)
Samsung's Korean keyboard has a bug where it always attempts to combine
characters based on its internal state, ignoring if and when the cursor
is moved programmatically. EG typing "ㄴㅇ" and then moving the cursor
back to the front of the text and typing "ㄴ" again would result in
"ㄴㅇㄴ", not "ㄴㄴㅇ".

Fully restarting the IMM works around this because it flushes the
keyboard's internal state and stops it from trying to incorrectly
combine characters. However this also has some negative performance
implications, so we only apply the workaround on Samsung devices set
to use Korean input.

This also effectively disables the feature on Samsung keyboards that
allowed users to re-open a composing region for previously typed
characters. See https://github.com/flutter/flutter/issues/29341#issuecomment-531283508.

Fixes flutter/flutter#29341.
2019-09-25 11:16:32 -07:00
Matt Carroll
c8c68ac789 Introduce FlutterFragmentActivity (flutter/engine#12305) 2019-09-17 15:09:38 -07:00
rafern
7d72616400 Tests for #11283 (flutter/engine#12322)
Added tests for #11283. The itEncodesNullObjects test fails with the branch before the merge and succeeds with the master branch
2019-09-17 13:52:40 -07:00
Michael Klimushyn
eef9a08469 Enable platform view keyboard input on Android Q (flutter/engine#12085)
Naively embedded platform views on Android were never able to receive
keyboard input, because they were never focusable. So far we've worked
around the limiation by hooking into InputMethodManager and proxying the
InputConnection from a focused window over to the embeded view.

Android Q changed InputMethodManager to be instanced per display instead
of a singleton. Because of this our proxy hook was never being called,
since it was being set up on a different instance of IMM than was being
used in the virtual display.

Update `SingleViewPresentation` to store the IMM from the focused window
and return it whenever there are any calls to `INPUT_METHOD_SERVICE`.
This hooks our proxy back into place for the embedded view in the
virtual display. This restores the functionality of our workaround from
previous versions.

Unfortunately there's still a lot of noisy error logs from IMM here. It
can tell that the IMM has a different displayId than what it's expecting
from the window.

This also updates the unit tests to support SDK=27. SDK 16 doesn't have
DisplayManager, so there were NPEs attempting to instantiate the class
under test.
2019-09-12 09:50:54 -07:00
Emmanuel Garcia
61d1fabcae Document dependencies and remove support-v13 (flutter/engine#11912) 2019-09-06 15:25:59 -07:00