60 Commits

Author SHA1 Message Date
Gary Qian
eff62e12bd Implement getExtractedText in InputConnectionAdaptor (flutter/engine#17426) 2020-04-01 18:51:04 -07:00
Gary Qian
317c96c3ce Partially revert Samsung keyboard force-update workaround (flutter/engine#17391) 2020-03-29 15:46:39 -07:00
Emmanuel Garcia
257b799767 Migrate embedding to AndroidX (flutter/engine#17075) 2020-03-13 21:19:24 -07:00
Emmanuel Garcia
c6e300a3de Fix link in readme (flutter/engine#17119) 2020-03-12 13:59:31 -07:00
Emmanuel Garcia
4a30d786c6 Define embedding dependencies in Gradle (flutter/engine#17116) 2020-03-12 13:49:46 -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
Gary Qian
45f630128d Samsung keyboard duplication workaround: updateSelection (flutter/engine#16547) 2020-02-12 19:51:40 -05:00
Michael Klimushyn
2ad0c2ebe7 Apply Google Java format (flutter/engine#16501)
This shouldn't result in any logical changes. I've done a quick smoke
test by building a local Android engine and running Flutter gallery, no
compile errors or other obvious issues.

Applied by running `/ci/format.sh | patch -p0` with the altered script
added in flutter/engine#16500. I did locally modify the script slightly
further so it would run against all Java files in the repo instead of
just modified ones.
2020-02-07 16:10:46 -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
Jason Simmons
5453ed7721 Ensure that Android embedding initialization always uses an application context (flutter/engine#16204)
Some parts of the embedding (e.g. VsyncWaiter) may hold global references to
system services obtained through the context used during initialization.
These must not be associated with an activity or other non-application context.

Fixes https://github.com/flutter/flutter/issues/49612
2020-01-31 12:09:38 -08:00
Matt Carroll
122e9dda72 Notify PlatformViewsController within FlutterEngine when a hot restart occurs. (#48518) (flutter/engine#16230) 2020-01-30 12:58:41 -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
Gary Qian
a6de6785ef Samsung fix duplication on punctuation: Update keyboard on finish compose. (flutter/engine#15701) 2020-01-16 18:04:58 -08:00
Greg Spencer
100eb51f4f Fix hardware keyboard enter so it triggers an action. (flutter/engine#15568)
This changes the InputConnectionAdaptor so that it will execute an IME action when ENTER is pressed. Prior to this, pressing ENTER on a hardware keyboard did nothing.
2020-01-15 11:13:39 -08:00
Matt Carroll
2d86c18a75 Make BackgroundMode public. (#45747) (flutter/engine#14673) 2020-01-08 21:41:34 -08:00
Dan Field
fcab1c7433 Disable a11y on detach (flutter/engine#14142) 2019-12-05 11:16:38 -08:00
Gary Qian
b2a77134a6 Always set mEditable values when different in TextPlugin (flutter/engine#13951) 2019-11-27 07:51:04 +09:00
Matt Carroll
be849d1363 Add support for --dart-flags in FlutterShellArgs. (#44855) (flutter/engine#13855) 2019-11-14 04:09:08 +00:00
chunhtai
7787960f0c reland add lifecycle enum (flutter/engine#13767)
This reverts commit 5e7e183369b3816650f776c767e241bb98a87276.
2019-11-13 11:26:25 -08:00
Matt Carroll
6bf82e4675 Expose asset lookup from plugin binding. (#42019) (flutter/engine#13743) 2019-11-12 07:14:27 +00:00
chunhtai
5e7e183369 Revert "Issues/39832 reland (#13642)" (flutter/engine#13720)
This reverts commit a1824112a46ba1968217be011efd19d528330127.
2019-11-06 11:41:36 -08:00
chunhtai
a1824112a4 Issues/39832 reland (flutter/engine#13642)
* Reland "Added new lifecycle enum (#11913)"
2019-11-05 14:52:16 -08:00
chunhtai
2958712751 Revert "Added new lifecycle enum (#11913)" (flutter/engine#13632)
This reverts commit 583e1335bbf9842ff4dc349021c6c71e6141fffe.
2019-11-04 13:40:20 -08:00
chunhtai
583e1335bb Added new lifecycle enum (flutter/engine#11913) 2019-11-04 12:33:41 -08:00
xster
7e3e60d902 Release shim bindings when detaching (flutter/engine#13432) 2019-11-01 17:53:15 -07:00
Dan Field
9b6d00c6fe Request a reattach when creating the text input plugin on Android (flutter/engine#13474) 2019-11-01 15:29:33 -07:00
Jason Simmons
f0341399a4 Pass the automaticallyRegisterPlugins flag to the FlutterEngine constructor in FlutterActivityTest (flutter/engine#13468) 2019-10-31 16:06:37 -07:00
Matt Carroll
49819893ec Automatically register plugins in FlutterEngine. (#43855) (flutter/engine#13455) 2019-10-31 14:10:45 -07:00
Dan Field
019c555be8 Fizzle onConfigurationChanged if no FlutterView (flutter/engine#13445) 2019-10-30 15:49:02 -07:00
Matt Carroll
14f2c142d2 Automatically destroy FlutterEngine when created by FlutterActivity or FlutterFragment. (flutter/engine#13423) 2019-10-30 15:01:57 -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
Justin McCandless
c1d8b3c16d NO_SUGGESTIONS keyboard flag in Android (flutter/engine#13099)
Add the enableSuggestions parameter to control Android's keyboard suggestions
2019-10-23 10:47:19 -07:00
Matt Carroll
8f2cb01779 Adds Dark Mode support to new Android embedding (this was accidentally missed previously). (flutter/engine#13215) 2019-10-18 12:46:09 -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
Matt Carroll
5e17ccdf32 Added FlutterActivity and FlutterFragment hook to cleanUpFlutterEngine() as symmetry for configureFlutterEngine(). (#41943) (flutter/engine#12987) 2019-10-11 13:52:21 -07:00
Gary Qian
1f1ee25a47 Restart all modern Samsung keyboard IMM (flutter/engine#12780) 2019-10-04 15:14:38 -04:00
Jason Simmons
e023418f3f Check for a null input method subtype (flutter/engine#12706)
Fixes https://github.com/flutter/flutter/issues/41557
2019-10-01 09:03:47 -07:00
Matt Carroll
e6e9fb54bb Forwards Flutter View to platform views and detaches when needed. (flutter/engine#12359) 2019-09-26 15:34:01 -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
Shi-Hao Hong
19b98ba9f2 Incorporate View.setSystemGestureExclusionRects code review feedback from #11441 (flutter/engine#11804)
* Improve variable naming and javadoc for setSystemGestureExclusionRects

* Remove variables from setSystemGestureExclusionRects tests

* Split test for two behaviors into two separate tests for setSystemGestureExclusionRects success case
2019-09-05 12:53:41 -07:00
Shi-Hao Hong
a4cb86d72d Android 10+ View.getSystemGestureExclusionRects (flutter/engine#11451)
* SystemGesture.getSystemGestureExclusionRects

* Add getSystemExclusionRects unit tests
2019-09-04 15:13:02 -07:00
Matt Carroll
bebb5d2b5b Rename first frame method and notify FlutterActivity when full drawn (#38714 #36796). (flutter/engine#11357) 2019-09-03 15:49:53 -07:00