gecko-dev/servo/resources
Imanol Fernandez cda127d899 servo: Merge #15773 - Android life cycle improvements and Gradle integration (from MortimerGoro:android_improvements); r=larsbergstrom,fabricedesre
This PR includes Android life cycle Improvements and Gradle integration for android packaging.

Android life cycle improvements are implemented in both the new [MainActivity](https://github.com/servo/servo/compare/master...MortimerGoro:android_improvements?expand=1#diff-f43708b102e98272c2af7454b8846927) and native code in this related PR: https://github.com/servo/glutin/pull/117
- Properly handle the life cycle of the Android Activity: manage EGLContext lost & restore, and animation loop pause/resume when the app goes to background/foreground or orientation changes. In the current upstream Servo crashes when the app goes to background, activity stops or changes orientation
- Handle event loop awake for Servo Animation loop
- Handle screen resize & orientation events
- Implement new keep_screen_on preference which keeps Android device's screen from ever going to sleep: very useful for games or WebVR
- Implement a full screen mode enabled by preference: very useful for games or WebVR
- Implement new shell.native-orientation preference which allows to lock the Activity to a specific orientation
- Automatically sync new android assets to sdcard when the Android version code is changed.  In the current upstream only the existence of the folder is check but resources are not updated

ofscreen_gl_context is updated to fix this: https://github.com/emilio/rust-offscreen-rendering-context/pull/83

This PR integrates Gradle build system for android packaging. Most of the code is implemented in this [build.gradle](https://github.com/servo/servo/compare/master...MortimerGoro:android_improvements?expand=1#diff-89cdb9324addb994cdba0a158b209547) . We can get rid of [build-apk](https://github.com/servo/servo/compare/master...MortimerGoro:android_improvements?expand=1#diff-40f5a7cf22f94aad059b2c1795347f5e) and manual jar dependency copying in the [package_commands.py](https://github.com/servo/servo/compare/master...MortimerGoro:android_improvements?expand=1#diff-0d425b142c8d10ae6ac1f3711fb5c23a). The correct version of gradle is automatically downloaded using the gradlew wrapper.

Some improvements:
- Allows to include more complex android dependencies/SDKs like AARs, manifest auto-merging and more.
- Improved packaging process: The gradle project is always in the same folder, it uses relative paths for everything (assets, native libraries) and outputs the apk into the correct target folder in servo. In the current upstream, ant/python build system copies the manifest, project, resources and jars each time so you end with multiple copies of the same files.
- Improved dependency declaration. We do not have to manually copy jar dependencies in the python script anymore. The gradle build scripts itself is able to search for the dependencies in the correct servo target folder.
- Supports packaging apks with different architectures: armeabi, armeabi-v7a, aarch64. We still need to fix some native servo compilation issues with armeabi-v7a, aarch64 due to dependencies which use `make`. I'll push this changes in a separate PR of the python build files but the gradle file is already ready to handle that.
- We can easily create product flavors for different versions of Servo. For example a default browser, a WebVR browser with additional dependencies or a Servo android Webview component
- Fixes minor.major.52 build error when blurdroid cargo dependency is compiled using java8 (the default in new Linux machines). The gradle build file enables the new Jack compiler which supports Java8 dependencies.
- The project can be opened with Android Studio and run the brand new GPU debugger on any Android phone. I'll add some docs in the Wiki about this.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #14568 (github issue number if applicable).

<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 2b5c17c43a517b6d6bd981f5fa905536dddd3beb

--HG--
rename : servo/support/android/apk/AndroidManifest.xml => servo/support/android/apk/app/src/main/AndroidManifest.xml
rename : servo/support/android/apk/res/mipmap/servo.png => servo/support/android/apk/app/src/main/res/mipmap/servo.png
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 2da8cf56223c150832fddb3e8878432f4d64bc6e
2017-04-21 15:52:13 -05:00
..
ahem servo: Merge #7013 - Make the Ahem font available to test-css and test-wpt tests (from servo:user-stylesheets); r=mbrubeck 2015-08-07 14:05:19 -06:00
user-agent-js servo: Merge #5298 - Basic userscript support (from Manishearth:userscript); r=saneyuki 2015-03-22 08:27:48 -06:00
Credits.rtf.mako servo: Merge #12250 - Add servo version to mac about servo window (from cbrewster:mac_about_version); r=larsbergstrom 2016-08-19 19:45:00 -05:00
Servo.ico servo: Merge #16509 - Add new Servo icon for Windows (from atouchet:win-ico); r=jdm 2017-04-20 20:51:04 -05:00
ahem.css servo: Merge #7013 - Make the Ahem font available to test-css and test-wpt tests (from servo:user-stylesheets); r=mbrubeck 2015-08-07 14:05:19 -06:00
android_params servo: Merge #13474 - Switch default renderer to webrender, and update webrender (from glennw:wr-default); r=Ms2ger 2016-09-28 13:42:14 -05:00
badcert.html servo: Merge #11932 - Print out useful SSL-related information on SSL error page (from jdm:servoorg-cert); r=asajeffrey 2016-06-29 16:47:57 -05:00
badcert.jpg servo: Merge #4741 - Basic certificate verification (from Manishearth:cert-checking); r=jdm 2015-01-31 03:42:48 -07:00
cert-google-only servo: Merge #4741 - Basic certificate verification (from Manishearth:cert-checking); r=jdm 2015-01-31 03:42:48 -07:00
certs servo: Merge #15106 - Update cert-generator and certs (from Manishearth:certs); r=avadacatavra 2017-04-03 12:50:21 -05:00
failure.html servo: Merge #3601 - Read user-agent.css at run time. Fix #3516 (from SimonSapin:runtime-ua-stylesheet); r=jdm 2014-10-08 00:42:36 -06:00
gatt_blocklist.txt servo: Merge #14429 - Replace Syntax with TypeError in bluetoothuuid.rs (from szeged:syntax-to-type-error); r=jdm 2016-12-06 17:30:40 -08:00
hsts_preload.json servo: Merge #8776 - Fix the parsing of the chromium HSTS preload list (from samfoo:hsts-preload-download-fix); r=jdm 2015-12-02 09:56:05 +05:01
iso-8859-8.css servo: Merge #5729 - Don't link to specific WHATWG multipage page (from frewsxcv:whatwg-multipage-redirects); r=Manishearth 2015-04-17 08:57:33 -05:00
itried.jpg servo: Merge #8649 - Moving Servo's cry message! (from Wafflespeanut:I_TRIED); r=SimonSapin 2015-11-23 02:52:57 +05:01
neterror.html servo: Merge #12539 - Improve page load error information (from johannhof:error-page); r=jdm 2016-07-21 13:27:06 -05:00
not-found.html servo: Merge #8650 - Redirect to an error page on 404! (from Wafflespeanut:about-404); r=Wafflespeanut 2015-11-26 22:18:03 +05:01
package-prefs.json servo: Merge #14877 - Package: Create ZIP on Windows and fix MacOS nightlies (from UK992:mach-package); r=Wafflespeanut 2017-01-05 21:45:31 -08:00
prefs.json servo: Merge #15773 - Android life cycle improvements and Gradle integration (from MortimerGoro:android_improvements); r=larsbergstrom,fabricedesre 2017-04-21 15:52:13 -05:00
presentational-hints.css servo: Merge #13926 - script: Fix issues relating to <iframe frameborder> (from pcwalton:iframe-frameborder); r=emilio 2016-10-26 19:13:09 -05:00
privatekey_for_testing.key servo: Merge #14716 - Implement HSTS fetch step (from mrnayak:hsts); r=jdm 2016-12-29 00:35:09 -08:00
public_domains.txt servo: Merge #11513 - Add mach command to update public domain list and use a HashSet for matching (from fduraffourg:pr11216); r=jdm 2016-06-09 12:54:42 -05:00
quirks-mode.css servo: Merge #5980 - layout: Implement `<table width>` and `<center>` (from pcwalton:table-width-and-center); r=mbrubeck 2015-05-11 15:25:42 -05:00
quotes.css servo: Merge #5729 - Don't link to specific WHATWG multipage page (from frewsxcv:whatwg-multipage-redirects); r=Manishearth 2015-04-17 08:57:33 -05:00
rippy.png servo: Merge #8517 - Use the correct .png extension for the image placeholder (from rillian:rippy); r=larsbergstrom 2015-11-14 00:49:08 +05:01
self_signed_certificate_for_testing.crt servo: Merge #14716 - Implement HSTS fetch step (from mrnayak:hsts); r=jdm 2016-12-29 00:35:09 -08:00
servo.css servo: Merge #16265 - Inherit 'text-overflow' and 'overflow' in text fragment (from stshine:oh-box-model); r=emilio 2017-04-05 15:09:14 -05:00
servo.icns servo: Merge #11899 - Create Servo.app and dmg on mac package (from cbrewster:app_packaging); r=larsbergstrom 2016-06-28 14:58:06 -05:00
servo.png servo: Merge #11814 - Add a border to the logo to differentiate from background color (from jdm:fancy-logo); r=metajack 2016-06-21 10:43:11 -05:00
tumbeast.png servo: Merge #8650 - Redirect to an error page on 404! (from Wafflespeanut:about-404); r=Wafflespeanut 2015-11-26 22:18:03 +05:01
user-agent.css servo: Merge #13489 - Add support for fullscreen #10102 (from farodin91:fullscreen); r=jdm 2016-12-09 09:52:34 -08:00