844 Commits

Author SHA1 Message Date
liyuqian
b3075b3091
Rename GPU thread to raster thread in code comments (#17329)
1. Simple "GPU thread" to "raster thread" replacement.

2. Regex replace "GPU([\n\r\s]+//+ thread)" with "raster$1".

3. Regex replace "// gpu$" with "// raster".

4. Simple test change.

5. Run ci/format.sh
2020-03-25 22:49:59 -07:00
renyou
ba80c0c49a
Android change to match the Google internal changes. (#17331)
* Android change to match the google internal changes.

* Fix format.

* Revert format change, add super call.

* Remove comment for API version.
2020-03-25 18:02:46 -07:00
Emmanuel Garcia
025e2d82dd
Migrate embedding to AndroidX (#17075) 2020-03-13 21:19:24 -07:00
xster
1ff81bc117
Make a pass through all the embedding javadocs (#17109) 2020-03-13 16:34:34 -07:00
Emmanuel Garcia
25cded5742
Fix link in readme (#17119) 2020-03-12 13:59:31 -07:00
Emmanuel Garcia
cbc8713fdd
Define embedding dependencies in Gradle (#17116) 2020-03-12 13:49:46 -07:00
Kirill Nikolaev
7381ca8ddf
Avoid generating VSYNC trace events from Flutter common code. (#16248)
Chrome Trace viewer treats events labeled "VSYNC" as special and highlights them (when the "Highlight Vsync" checkbox is enabled). Ideally VSYNC events are generated by the host system at their source. System VSYNC events are indeed present in full-system systraces. Flutter-level traces (as seen in Observatory/Flutter devtools) do not contain the system VSYNC events, so we rely on the engine to generate them (as close to where they would be generated by the system ideally).

Currently the common (platform-independent code) generates VSYNC events at the time when the UI thread starts processing a frame. This has two drawbacks:
1. The traces are generated with a delay (we wait for the callback to be have been scheduled on the UI thread instead of tracing as soon as the system notified us.
2. When inspecting system-wide traces we'll have both the system and the Flutter app (or potentially multiple Flutter apps) generate VSYNC events at the same time. This confuses both the developers and the trace viewer.

This change moves the VSYNC event generation to the platform-specific embedder implementations:
1. On Android/iOS we always generate the VSYNC event since Android/iOS developers use Flutter tools to debug the apps.
2. On Fuchsia we do not generate VSYNC events since the systraces always contain them.
3. In the Embedder wrapper we don not generate VSYNC events and rely on the actual embedder to do this in a way appropriate for the target system.
2020-03-05 16:59:43 +01:00
Matt Carroll
482155b3c6
Fixed splash screen crash when bringing Android app back to foreground after being evicted from memory. (#47635) (#16916) 2020-03-04 11:27:12 -08:00
Edman P. Anjos
9beac71a2e
Add support for software text editing controls (#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
02aa865da3
Fix the newline on some keyboards (#16560) 2020-02-20 10:36:03 -08:00
Matt Carroll
f39bc73d6a
Exposes FlutterSurfaceView, and FlutterTextureView to FlutterActivity and FlutterFragment. (#41984, #47557) (#16552) 2020-02-12 19:21:00 -08:00
Gary Qian
c4c6ef6719
Samsung keyboard duplication workaround: updateSelection (#16547) 2020-02-12 19:51:40 -05:00
Michael Klimushyn
7c67573896
Fix multiline Javadoc code blocks (#16565)
The formatter didn't understand what was going on here and broke the
text. Changed these to use `<pre>{@code }</pre>` instead.
2020-02-12 15:07:16 -08:00
Matt Carroll
ca02b9197e
Prevent long flash when switching to Flutter app. (#47903) (#16527) 2020-02-11 15:26:27 -08:00
Matt Carroll
270421c103
Fix ensureInitializationCompleteAsync callback when already initialized. (#39675) (#16503) 2020-02-11 15:25:58 -08:00
Gityuan
5041ff1b1e
support endless trace buffer (#16520) 2020-02-11 15:08:03 -08:00
Dan Field
826b2d46ef
Apply lints from internal roll (#16509) 2020-02-10 13:53:04 -08:00
Michael Klimushyn
077918dcfd
Apply Google Java format (#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
9443518f62
Fix safe area reporting with transparent FlutterActivitys. (#46060) (#16208) 2020-02-07 14:57:06 -08:00
Chris Bracken
1a4f4e3943
Fix unused import in Android embedder (#16494)
android.os.Parcelable was added in commit
6d5aaa090abe19ff0f08eb28f6663173750fd80c but never used.
2020-02-07 12:26:50 -08:00
Amir Hardon
7f6149cbdd
Revert "Remove use of the deprecated AccessibilityNodeInfo boundsInPa… (#16355) 2020-02-04 11:43:03 -08:00
George Wright
677b563b9a
Refactor of Vulkan GPUSurface code (#16224)
Co-authored-by: David Worsham <arbreng@gmail.com>
2020-02-04 10:44:35 -08:00
Matt Carroll
95468839a0
Added API guards to flags in PlatformPlugin that were introduced after Flutter's min SDK version. (#13965) 2020-02-03 16:25:27 -08:00
Chinmay Garde
f7b78e001d
Remove all uses of the redundant flutter_root variable. (#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
0816c040fb
Deprecated FlutterView v1 points to FlutterView v2 (#16304)
FlutterView#enableTransparentBackground has been deprecated for some
time now since it breaks a11y highlighting in most cases. When the
warning was first added there was no known workaround, but now the v2
embedding is in stable and ready to support this usecase. Update the
warning to point to the v2 embedding.
2020-01-31 15:06:52 -08:00
Jason Simmons
7c95cdada4
Ensure that Android embedding initialization always uses an application context (#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
eecb5e5c25
Notify PlatformViewsController within FlutterEngine when a hot restart occurs. (#48518) (#16230) 2020-01-30 12:58:41 -08:00
Michael Klimushyn
6fa1fcda8f
Register plugins at the right time, once (#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
Chris Bracken
d1b0883883
Eliminate unused import in Android embedding (#15975)
Eliminates an unused dependency on android.os.build. The last remaining
use of this was eliminated in 0615f45623224bd99ee3ceb8ba4a0d4d04f58d54
with the removal of an unused method that contained an android version
check.
2020-01-24 16:19:00 -08:00
Matt Carroll
fec9573786
Prevent duplicate plugin registration in FlutterEnginePluginRegistry. (#49365) (#15956) 2020-01-24 15:57:51 -08:00
Matt Carroll
29e857ca2c
Release TextureView surface within FlutterTextureView when disconnected. (#48535) (#15899) 2020-01-23 13:19:42 -08:00
Michael Goderbauer
0615f45623 Remove unused Imports and private method (#15872) 2020-01-21 17:53:02 -08:00
xster
006e44d1d0 Reduce default verbosity of Android embedding (#15164) 2020-01-18 23:49:05 -08:00
Gary Qian
5734eceddf
Samsung fix duplication on punctuation: Update keyboard on finish compose. (#15701) 2020-01-16 18:04:58 -08:00
Greg Spencer
73cdd0ef70
Fix hardware keyboard enter so it triggers an action. (#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
Jason Simmons
0235a50843
Change the value of EXTRA_INITIAL_ROUTE to match the value used by the old embedding and flutter_tools (#15569) 2020-01-13 17:19:31 -08:00
Jason Simmons
fb52622304
Add a type parameter to SavedState.Creator in the new embedding (#15563) 2020-01-13 15:26:32 -08:00
Matt Carroll
4513205b13 Make BackgroundMode public. (#45747) (#14673) 2020-01-08 21:41:34 -08:00
chunhtai
7a27e75c67
Add shell api to set default for windows data (#14002) 2020-01-08 19:36:10 -08:00
Chris Bracken
5c9e134bf8
Add missing super.onNewIntent() call (#15328)
From the onNewIntent docs:

    If you are handling new intents and may be making changes to the
    fragment state, you want to be sure to call through to the
    super-class here first. Otherwise, if your state is saved but the
    activity is not stopped, you could get an onNewIntent() call which
    happens before onResume() and trying to perform fragment operations
    at that point will throw IllegalStateException because the fragment
    manager thinks the state is still saved.
2020-01-08 18:07:36 -08:00
Jenn Magder
5759a437e6
Revert "Add a deprecation javadoc note to the old FlutterActivity (#15156)" (#15331)
This reverts commit 293cd971d0147cc84120a6de579f476e030d56c7.
2020-01-08 18:04:49 -08:00
xster
293cd971d0
Add a deprecation javadoc note to the old FlutterActivity (#15156) 2020-01-08 10:06:58 -08:00
Dan Field
2a1ade7908
Raise API level for reportFullyDrawn (#14146) 2019-12-05 14:51:55 -08:00
Dan Field
73da385c11
Disable a11y on detach (#14142) 2019-12-05 11:16:38 -08:00
Dan Field
e3e2a3899e
Remove suprious warning (#14079) 2019-12-02 16:51:30 -08:00
Dan Field
ea721ebf1a
Fix live region logic (#14081) 2019-12-02 15:49:15 -08:00
Gary Qian
2c0eee4392
Always set mEditable values when different in TextPlugin (#13951) 2019-11-27 07:51:04 +09:00
Matt Carroll
7c5a954dd3
Removed GET_ACTIVITIES flag from all manifest meta-data lookups. (#38891) (#13932) 2019-11-21 15:00:27 -08:00
chunhtai
132d38cd22
Moves pointer event sanitizing to engine. (#13697)
* Moves pointer event sanitizing to engine

* fix comment format

* fix formatting

* addressing comment

* fix format

* fix format

* addressing comment
2019-11-19 09:48:25 -08:00
Todd Volkert
762294cf2d
Revert "RendererContextSwitch guard flutter's gl context rework. (#13812)" (#13906)
This reverts commit f456423cfb820d07bb36e9a8979e3d75cc9d8d76.

This is being reverted because it caused flutter/flutter#45098
(images don't load on iOS).
2019-11-18 18:28:04 -08:00