71 Commits

Author SHA1 Message Date
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
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
Mehmet Fidanboylu
4092b0c4fe
Add isRunningInRobolectricTest back (#13424) 2019-10-29 19:46:21 -07:00
Matt Carroll
9acec4102a
Move initialization into FlutterEngine (#12806) 2019-10-11 16:15:55 -07:00
Jonah Williams
6f5eb1332f
Add support for JIT release mode (#12446) 2019-09-27 11:20:54 -07:00
Matt Carroll
4c6948a88a
Android Embedding Refactor 38: Removed AssetManager from DartEntrypoint. (#10250) 2019-07-30 12:57:01 -07:00
Matt Carroll
f336e05a69
Android Embedding PR37: Separated FlutterActivity and FlutterFragment via FlutterActivityAndFragmentDelegate (#9895) 2019-07-29 17:40:25 -07:00
Jason Simmons
3c9a22c778
Fall back to a fully qualified path to libapp.so if the library can not be loaded by name (#9762)
libapp.so contains compiled application Dart code.  On most Android systems,
this library can be loaded by calling dlopen("libapp.so"), which will search
Android's default library directories.

On some Android devices this does not work as expected.  As a workaround, this
patch provides a fallback path to libapp.so based on ApplicationInfo.nativeLibraryDir.

Fixes https://github.com/flutter/flutter/issues/35838
2019-07-11 12:39:42 -07:00
Jason Simmons
3f4f606105
Simplify loading of app bundles on Android (#9360)
* Remove deprecated runBundle APIs
* Remove code related to dynamic patching (including support for multiple
  bundle paths)
* Change FlutterRunArugments.bundlePath to be the Android AssetManager path
  where the app's assets are located
2019-06-25 14:17:50 -07:00
Matt Carroll
a2db2ea6f1
Android Embedding Refactor PR35: Ensure all JNI methods are in FlutterJNI (#34751). (#9391) 2019-06-20 17:13:58 -07:00
Jason Simmons
209250da1b
When running in AOT modes create a flutter_assets directory that can be used as the bundle path (#9306)
The engine RunBundleAndSnapshotFromLibrary API expects a bundle path directory
containing the application's assets.  If the Android embedding is using
AOT ELF library packaging and does not need to extract assets, then create an
empty directory at the bundle path.

Fixes https://github.com/flutter/flutter/issues/34287
2019-06-12 17:34:02 -07:00
Jason Simmons
4d6847466d
Load AOT compiled Dart assets only from ELF libraries (#9260)
Previously AOT compiled Dart code would be packaged as a group of assets
within the APK.  This has been replaced by a single ELF library containing
the same data.
2019-06-11 10:10:45 -07:00
Emmanuel Garcia
05365c4c32 Revert change by mistake: extract resources (#9180) 2019-06-03 23:44:46 -07:00
Emmanuel Garcia
f4d92c1f0c
Use shared library when libapp.so is found (#9172) 2019-06-03 16:23:28 -07:00
Jason Simmons
e8db5dfd52
Always run the resource extractor in FlutterMain (#9149)
FlutterMain.findAppBundlePath is using the presence of the flutter_assets
directory as a signal that the app is initialized.  For consistency,
FlutterMain will run the resource extractor at startup and create
flutter_assets even if no resources need to be extracted.
2019-05-30 16:50:31 -07:00
Kate Lovett
6e5151359d
Removing unused imports (#9108) 2019-05-28 15:16:33 -07:00
Mehmet Fidanboylu
41e10f07f4
Fix internal break since listing contents can return null (#9078) 2019-05-26 20:07:13 -07:00
Chris Bracken
509a43fe27
Apply minor cleanups to Android embedding (#9088)
Eliminate an unused import, add missing @Override annotations, and
eliminate an unused logger.
2019-05-25 15:45:14 -07:00
Jason Simmons
ee6a9c4049
Fix unchecked operation warnings in FlutterMain (#9073)
Also remove trailing whitespace on some lines
2019-05-23 15:30:08 -07:00
Emmanuel Garcia
20f5000bc5
Add mode to load AOT snapshots as a native lib (#8979) 2019-05-20 10:08:50 -07:00
Dan Field
88e82d371a
Remove static leaks (#8825) 2019-05-03 16:57:04 -07:00
Stanislav Baranov
8b5f77630f
Remove support for downloading dynamic patches. (#8663) 2019-04-22 09:05:06 -07:00
Chinmay Garde
1fe3279149
Cleanup references to FLX archives from the engine. (#8653) 2019-04-19 12:49:07 -07:00
Chinmay Garde
56052c70af
Rename the shell namespace to flutter. (#8520) 2019-04-09 17:10:46 -07:00
Matt Carroll
dbcfc504cc
Android Embedding PR26: Offer an async version of FlutterMain's ensure initialization complete. (#8465) 2019-04-08 14:46:41 -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
Stanislav Baranov
36d495d57a
Dynamic patching support for native code libraries. (#7927) 2019-02-22 14:18:47 -08:00
Jason Simmons
050dcaad60
Embed ICU data inside libflutter.so on Android (#7588)
Prior to this the Android embedder code would extract the icudtl.dat asset out
of the APK and write it to local disk during the first startup of the app.

This change will make that work unnecessary and eliminate the risk of ICU
failures due to errors in the extraction process.
2019-01-30 11:56:17 -08:00
Stanislav Baranov
844d27cb3c
Refactor dynamic patching to use clearer naming and structure. (#7426)
This is a no-op change, except for fixing a bug where download task
reference wasn't cleared after download was completed.

This change also removes call to output stream flush(), which is not
necessary according to Java spec.

The rest of the change deals with requiring the code to work directly
with ResourceUpdater object instead of having FlutterMain be a facade
that forwards some of ResourceUpdater's methods. This simplifies the
other (more essential) upcoming changes that will be landing in the
followings few PRs.
2019-01-09 14:21:36 -08:00
Stanislav Baranov
8cca33aea8
Give more control over when dynamic patches get downloaded and installed. (#7327)
This change introduces manifest properties that control when dynamic patches are downloaded and installed in the application lifecycle.

Application developer can choose whether between install on restart, install on resume, or immediate forced install of dynamic patches.
2019-01-02 10:40:37 -08:00
Stanislav Baranov
6f763fbad7
Minor refactoring of dynamic patching code. (#7325)
Minor refactoring of dynamic patching code.

- Changes naming of manifest properties to be consistent with documentation.
- Moves methods from inner class to outer class to make them more reusable.
2018-12-28 13:23:38 -08:00
Dan Field
8b73b9d42c
Fix javadoc for Android-28 (#7254)
* Fix javadoc for Android-28

* build javadoc as part of pre-submit
2018-12-19 09:24:02 -08:00
Stanislav Baranov
18a4e33c2a
Downloading and installation of dynamic updates on Android (#7207) 2018-12-13 10:17:37 -08:00
Michael Goderbauer
70a1106b50
Unify copyright lines (#6757) 2018-11-07 12:24:35 -08:00
Chinmay Garde
f2a3df97e2
Wire up the Skia persistent GPU related artifacts cache. (#6278)
Also teaches FML to create files and directories.
2018-09-26 14:54:09 -07:00
Ryan Macnak
60bb5da33c
Reapply "Some cleanups enabled by removing support for Dart 1" (#6250)
Following fixes in dart-lang/sdk@91cbb57cd5
2018-09-14 09:36:13 -07:00
Michael Goderbauer
6f459e2f10
Revert "Reapply "Some cleanups enabled by removing support for Dart 1" (#6216)" (#6232)
This reverts commit e3133e0e3f7cbbd57fa930c11f3640561d691eba.
2018-09-12 12:07:20 +02:00
Ryan Macnak
e3133e0e3f
Reapply "Some cleanups enabled by removing support for Dart 1." (#6216)
- Add missing Dart 2 flags to gen_snapshot invocation.
 - Disable brittle service test.
2018-09-10 17:03:54 -07:00
Ryan Macnak
bf96dbed38
Revert "Some cleanups enabled by removing support for Dart. (#5621)" (#6205)
This reverts commit 4c2448d1591a5fab033de3885ad34d1fdf5474f1.
2018-09-07 17:39:51 -07:00
Ryan Macnak
4c2448d159
Some cleanups enabled by removing support for Dart. (#5621)
- Switch core snapshot to Dart 2 and remove support for loading platform.dill.
 - Remove support for loading script snapshots.
 - Remove support for loading source.
 - Remove settings and fix names to reflect the above.
 - Remove support for loading the service isolate from source.
2018-09-07 15:44:46 -07:00
Jason Simmons
e6d9b34a8c
Remove the old location of the ICU data asset (#6170)
The tools are now placing icudtl.dat in the flutter_shared directory.
It is no longer necessary to check for this asset at its previous path.
2018-09-05 12:22:27 -07:00
Martin Kustermann
81baff97c2
Switch all embedders to use platform_strong.dill instead of platform.dill (the flutter_tester binary already does this) (#6024) 2018-08-15 17:45:11 +02:00
Ben Konyi
3cbb5e2067
Persist DartCallbackCache contents across launches (#5947)
* Updated DartCallbackCache to write callback cache to disk which is
restored on engine startup
* Ensure cache isn't moved off disk in iOS
2018-08-07 14:37:19 -07:00
amirh
51785d244d
Remove unused Java imports (#5663) 2018-07-03 09:21:03 -07:00
Jason Simmons
2c158b6390
Check for calls to FlutterMain.ensureInitializationComplete before startInitialization (#5614) 2018-06-25 16:32:38 -07:00
Jason Simmons
1174a4d9fe
Load the ICU data file asset from the "flutter_shared" path (#5567)
See https://github.com/flutter/flutter/issues/18514
2018-06-19 14:34:13 -07:00
Ryan Macnak
86d96fd0ce
Reapply "Don't link the core snapshot in the Android engine." (#5353)
Add back the core snapshot to runtime_unittests and embedder_unittests.
2018-05-23 17:09:51 -07:00
Ryan Macnak
2e9ff1f09a
Revert "Don't link the core snapshot in the Android engine. (#5348)" (#5352)
This reverts commit e0d4c4641386b8a81c7e9c3bc1a32172d81a785d.
2018-05-23 16:11:57 -07:00
Ryan Macnak
e0d4c46413
Don't link the core snapshot in the Android engine. (#5348)
Allows one to use a different core snapshot without a custom engine build by just packaging a different one in the APK.
2018-05-23 15:56:28 -07:00