1053 Commits

Author SHA1 Message Date
Chris Bracken
ef868edd36 Eliminate FLUTTER_NOLINT where possible (flutter/engine#21904)
This removes most of the remaining FLUTTER_NOLINT comments and opts
these files back into linter enforcement.

I've filed https://github.com/flutter/flutter/issues/68273 to require
that all FLUTTER_NOLINT comments be followed by a GitHub issue URL
describing the problem to be fixed.
2020-10-16 12:44:49 -07:00
Mehmet Fidanboylu
681ffacfe6 Forward Error objects to uncaught exception handler if there is one. (flutter/engine#21806) 2020-10-16 08:21:04 -07:00
Kaushik Iska
fea7e59a66 Fix incldues to be flutter/shell rather than shell/ (flutter/engine#21889) 2020-10-15 16:51:17 -07:00
Jason Simmons
d6720f7085 Prevent a race between SurfaceTexture.release and updateTexImage (flutter/engine#21777) 2020-10-14 15:02:02 -07:00
Kaushik Iska
fba087b5e3 [android] Refactor surface factory and wire in external view embedder (flutter/engine#21839) 2020-10-14 14:27:02 -07:00
Jason Simmons
190b35170f Call PlatformView.dispose when removing hybrid composition platform views (flutter/engine#21790)
Also force disposal of all hybrid platform views when shutting down the
engine.

Fixes https://github.com/flutter/flutter/issues/66764
2020-10-13 18:40:55 -07:00
Emmanuel Garcia
a36600d4b0 Allow TalkBack navigation while a platform view is rendered (flutter/engine#21719) 2020-10-13 17:52:02 -07:00
Yuqian Li
0c645869e3 Revert "Migration to PlatformDispatcher and multi-window #20496" (flutter/engine#21792)
* Revert "Fix documentation build for window changes. (#21780)"

This reverts commit a539d91840d2fbbb4aa07eeed6a92d654db167ab.

* Revert "Migration to PlatformDispatcher and multi-window (#20496)"

This reverts commit a58fec63f196175eedfc5fbaedce9336dab5c508.
2020-10-12 19:26:41 -07:00
Greg Spencer
a58fec63f1 Migration to PlatformDispatcher and multi-window (flutter/engine#20496)
This is a PR for converting the dart:ui code in the engine to use a multi-window API. The goal here is to convert from the window singleton to an API that has the concept of multiple windows. Also, I'm matching up the new PlatformDispatcher class to talk directly to the PlatformConfiguration class in the engine. I'm not attempting to actually enable creating multiple windows here, just migrate to an API that has a concept of multiple windows. The multi-window API in this PR currently only ever creates one window.

The design doc for this change is here.

The major changes in this PR:

Move the platfom-specific attributes out of Window, and into the new PlatformDispatcher class that holds all of the platform state, so that the platform code need only update the configuration on this class.
Create FlutterView, FlutterWindow, and SingletonFlutterWindow classes to separate out the concepts of a view (of which there may be multiple in a window), a window (of which there may be multiple on a screen, and they host views), and a window where there is only ever expected to be one (this hosts the entire API of the former Window class, and will eventually be the type of the window singleton).
Next step after this PR lands:

Remove the Window class entirely (it is replaced by SingletonFlutterWindow). Some minor changes in the Framework are needed to switch to using SingletonFlutterWindow directly first.

The Window class still exists in this PR, but will be removed as soon as the framework is converted to point to the SingletonFlutterWindow class instead. They share the same API, just have different names (Window is currently a subclass of SingletonFlutterWindow). The intention is that the Window name will be freed up to use as a widget class name in the framework for managing windows. The singleton called window will remain, and keep the same API it has now.
2020-10-09 16:29:16 -07:00
Dan Field
73b959d7cb Forbid android.util.Log (flutter/engine#21696) 2020-10-08 14:52:05 -07:00
Hamdi Kahloun
5ee8b7c5ef SecurityException: Permission Denial (flutter/engine#21290)
Fix `java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider`

Fixes flutter/flutter#66108

Co-authored-by: Dan Field <dfield@gmail.com>
2020-10-08 14:36:51 -07:00
Jonah Williams
127f3af9e0 Preserve specified AssetResolvers when performing a hot restart or updating the asset directory (flutter/engine#21611)
Follow up from #21436 . That PR works for all embeddings except for Android, which creates a special JNI AssetResolver. Since the shell cannot recreate this resolver, update the logic to preserve existing resolvers instead.
2020-10-08 09:22:01 -07:00
Emmanuel Garcia
2bd0e126a5 Ensure JNI is not called from raster thread (flutter/engine#21665) 2020-10-07 16:37:02 -07:00
Jason Simmons
7987032038 Workaround for an Android emulator EGL bug that can cause inaccurate GL version strings (flutter/engine#21258) 2020-10-02 12:17:02 -07:00
Jason Simmons
b1839003b3 Extract the WindowInsetsAnimation.Callback subclass into a separate class that will be lazily loaded (flutter/engine#21548)
WindowInsetsAnimation.Callback was introduced in API level 30.  This
PR moves the text input plugin's WindowInsetsAnimation.Callback subclass
into a class that will only be loaded if the embedding has checked for a
sufficient API level.

See https://github.com/flutter/flutter/issues/66908
2020-10-02 11:23:42 -07:00
Ren You
f2669455f3 Revert "Use dispatchKeyEventPreIme, and handle keys sent to InputConnection.sendKeyEvent on Android (#21163)" (flutter/engine#21513)
This reverts commit afeb9b27f0191997cc45682ab756c0be4d3e155c.
2020-09-30 09:34:05 -07:00
Greg Spencer
afeb9b27f0 Use dispatchKeyEventPreIme, and handle keys sent to InputConnection.sendKeyEvent on Android (flutter/engine#21163)
This switches from using dispatchKeyEvent to using dispatchKeyEventPreIme so that keys can be intercepted before they reach the IME and be handled by the framework.

It also now intercepts key events sent to InputConnection.sendKeyEvent, as some IMEs do (e.g. the Hacker's Keyboard), and sends the to Flutter before sending them to the IME (which it now only does if they are not handled by the framework).

This fixes the problem where pressing TAB on a hardware keyboard sends the tab to both the text field and to the focus traversal system.

Note that we still can't intercept all keystrokes given to a soft keyboard, only those which the soft keyboard decides to send to InputConnection.sendKeyEvent.
2020-09-29 12:46:29 -07:00
Kaushik Iska
a5f4486147 Reland multiple display support for embedder API (flutter/engine#21464) 2020-09-28 12:35:34 -07:00
Kaushik Iska
bd90847bad Revert multiple display support for embedder API (flutter/engine#21456)
This reverts commits
- 5f34b8442366463b5ad53e3e87e7920a006392eb.
- fc8b468d84f1fef5bf5183dd0b36d9411d454ea7.

See: https://github.com/flutter/flutter/issues/66829
2020-09-28 09:46:46 -07:00
Emmanuel Garcia
dbca16555e Support dragging native platform views (flutter/engine#21396) 2020-09-25 17:46:34 -07:00
Kaushik Iska
5f34b84423 Embedder API Support for display settings (flutter/engine#21355)
Embedders can now notify shell during startup about the various displays and their corresponding settings.
Adds a notion of Display update type which can later include chages to displays during runtime such as addition / removal / reconfiguration of displays.

We also remove the responsibility of providing the refresh rate from `vsync_waiter` to `DisplayManager`.
Rewires existing platform implementations of the said API to use `Shell::OnDisplayUpdate` to notify the display manager of the startup configuration.

DisplayManager is also thread-safe to account for rasterizer and UI thread accesses.
2020-09-25 11:04:10 -07:00
Gary Qian
e714ae10db Locale -> LanguageRange conversion to be more general in Android platformResolvedLocale (flutter/engine#21350) 2020-09-23 21:52:02 -07:00
Jason Simmons
32fbdb6755 Fix boolean value checks in StandardMessageCodec (flutter/engine#21270)
Fixes https://github.com/flutter/flutter/issues/65619
2020-09-23 16:31:07 -07:00
xster
1644e2fbcf Re-land deprecate Android v1 embedding classes (flutter/engine#21347) 2020-09-23 11:25:20 -07:00
Jason Simmons
1158faf54c Retain the WindowInsetsAnimation callback if code shrinking is enabled (flutter/engine#21330) 2020-09-23 09:17:02 -07:00
Zachary Anderson
01982beebc Revert "Deprecate Android v1 embedding classes (#20868)" (flutter/engine#21338)
This reverts commit 7b1562112962b1b22926938fad6438279ed6467c.
2020-09-22 14:38:18 -07:00
xster
aa3ac9e9aa Enforce exclusivity for activity and fragments attached to the FlutterEngine (flutter/engine#21272) 2020-09-22 10:34:52 -07:00
Jason Simmons
bc82ee9267 Disconnect the view's AndroidKeyProcessor when detaching from the engine (flutter/engine#21307) 2020-09-21 17:42:02 -07:00
xster
7b15621129 Deprecate Android v1 embedding classes (flutter/engine#20868) 2020-09-21 15:02:02 -07:00
Gary Qian
b2a78b0db5 Remove extraneous window inset call on IME animation (flutter/engine#21213) 2020-09-16 14:04:50 -07:00
Hamdi Kahloun
489c648b42 Fix NPE in PlatformPlugin.getClipboardData() (flutter/engine#21189) 2020-09-15 17:00:57 -07:00
Emmanuel Garcia
3a7b283bb3 Account for current open image in FlutterImageView (flutter/engine#21191) 2020-09-15 14:10:55 -07:00
kaisa695275735
85f1cd7356 delete opengl texture when it detatch from surfacetexture. (flutter/engine#18733) 2020-09-14 14:07:39 -07:00
Chris Bracken
2586db3b22 Clean up C++ includes (flutter/engine#21127)
Cleans up header order/grouping for consistency: associated header, C/C++ system/standard library headers, library headers, platform-specific #includes.

Adds <cstring> where strlen, memcpy are being used: there are a bunch of places we use them transitively.

Applies linter-required cleanups. Disables linter on one file due to included RapidJson header. See https://github.com/flutter/flutter/issues/65676

This patch does not cover flutter/shell/platform/darwin. There's a separate, slightly more intensive cleanup for those in progress.
2020-09-11 21:18:35 -07:00
Emmanuel Garcia
1ec891cb52 Fix comment indentation (flutter/engine#21114) 2020-09-11 17:50:26 -07:00
Emmanuel Garcia
8a317ebabc Add a new raster status kSkipAndRetry frame (flutter/engine#21059) 2020-09-11 16:29:11 -07:00
Chris Bracken
9ff7d7ca44 Copyright header hygiene improvements (flutter/engine#21089)
Add copyright headers in a few files where they were missing.

Trim trailing blank comment line where present, for consistency with
other engine code.

Use the standard libtxt copyright header in one file where it differed
(extra (C) and comma compared to other files in libtxt).

This also amends tools/const_finder/test/const_finder_test.dart to look
for a const an additional four lines down to account for the copyright
header added to the test fixture.
2020-09-11 08:55:37 -07:00
kele86838437
260a850e93 Update Androidx import (flutter/engine#19059) 2020-09-09 16:10:03 -07:00
linxuebin
538ae021ea Increase thread priority before engine init (flutter/engine#20922)
We get huge ANRs in not pure flutter app.
We found that 0.15% of the engine initialization took more than 10 seconds, every 10 million starts.
2020-09-09 14:07:34 -07:00
Gary Qian
cd4ac5d0a3 [Android R] Sync keyboard animation with view insets vs Android 11/R/API 30 WindowInsetsAnimation (flutter/engine#20843) 2020-09-04 02:06:30 -07:00
xster
ed15a009fe Let FlutterActivity/Fragment/FragmentActivity have an app bundle path override instead of eager resolving during construction (flutter/engine#20769) 2020-09-03 17:31:30 -07:00
Guokai-Cheng
03d8863078 Ensure the destructor is called since it destroys the EGLSurface before creating a new onscreen surface. (flutter/engine#20916) 2020-09-03 14:32:48 -07:00
Gary Qian
a1755b3feb [Android R] Integrate DisplayCutouts into viewportMetrics (flutter/engine#20921) 2020-09-02 05:18:35 -07:00
Emmanuel Garcia
12b8249404 Ensure all images are closed in FlutterImageView (flutter/engine#20842) 2020-09-01 16:57:45 -07:00
Jason Simmons
4bd9085a47 Pass text input key events to the EventResponder if they do not yield characters (flutter/engine#20912)
If the InputConnectionAdaptor receives a key event that does not move
the caret or produce a text character (such as the back button), then
the event should be given to the EventResponder which will forward it
to the view.

Fixes https://github.com/flutter/flutter/issues/64864
2020-08-31 17:56:09 -07:00
xster
7b62a6c11a Add auto plugin registration to FlutterFragmentActivity as well (flutter/engine#20865) 2020-08-31 13:43:46 -07:00
Emmanuel Garcia
2f8279900b Reland: Enable hybrid composition by default on Android (#20722) (flutter/engine#20864)
This reverts commit bb885a23e20d79c163dc884530acaafd6c311f2a.
2020-08-31 12:17:11 -07:00
xster
c09700b409 Add a java injector for testing (flutter/engine#20789) 2020-08-29 22:29:23 -07:00
Emmanuel Garcia
9d05be2966 Add ability to disable the raster thread merger (flutter/engine#20800) 2020-08-28 17:25:00 -07:00
Greg Spencer
408d2228fa Reland: Implement delayed event synthesis key event handling for Android (flutter/engine#20736)
This re-lands the key event synthesis implementation for Android (Original PR: #19024, Revert PR: #19956). The only difference is sending the synthesized key events to the root view instead of the current view.

Without sending it to the root view, the system doesn't have any chance of handling keys like the back button. The event will still not be sent to the framework twice, since we turn off event propagation while re-dispatching the event.
2020-08-28 14:45:38 -07:00