Commit be712e64 authored by Peter Wen's avatar Peter Wen Committed by Commit Bot

Android: Remove trichrome_chrome_apk

Use trichrome_chrome_bundle instead.

Removed:
- trichrome_chrome_apk_pak_assets
- trichrome_webview_for_bundle_apk
- trichrome_library_for_bundle_apk
- trichrome_chrome_apk

Downstream target removed here: https://crrev.com/i/2095508

Bug: 1021196
Change-Id: I4b6e249f393adf6bb49d845aff430172c8658268
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1914604
Auto-Submit: Peter Wen <wnwen@chromium.org>
Commit-Queue: Eric Stevenson <estevenson@chromium.org>
Reviewed-by: default avatarEric Stevenson <estevenson@chromium.org>
Reviewed-by: default avatarRichard Coles <torne@chromium.org>
Reviewed-by: default avatarSamuel Huang <huangs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#715427}
parent fbe4c69c
......@@ -833,24 +833,4 @@ if (public_android_sdk) {
static_library_provider = "//chrome/android:trichrome_library_apk"
}
}
# This target should be removed once Trichrome only supports Chrome bundle
# builds.
system_webview_apk_tmpl("trichrome_webview_for_bundle_apk") {
android_manifest = trichrome_webview_android_manifest
android_manifest_dep =
"//android_webview/nonembedded:trichrome_webview_manifest"
# TODO(torne): make minsdk=Q once we no longer build hacky P version
min_sdk_version = android_sdk_version
deps = upstream_only_webview_deps
apk_name = "TrichromeWebViewForBundle"
use_trichrome_library = true
uncompress_dex = use_uncompressed_dex
if (trichrome_synchronized_proguard) {
static_library_provider =
"//chrome/android:trichrome_library_for_bundle_apk"
}
}
}
......@@ -104,7 +104,7 @@ is called `MonochromePublic.apk`.
Trichrome is only compatible with Android Q and later.
Trichrome is composed of three APKs:
Trichrome is composed of three APK/AABs:
1. TrichromeWebView contains WebView-specific code and data, and provides
Android apps with the WebView implementation.
......@@ -119,9 +119,9 @@ The three Trichrome APKs together are roughly the same size as Monochrome,
providing the same benefits, but many of the downsides and complexities of
Monochrome don't apply to Trichrome.
The build targets are called `trichrome_webview_apk`, `trichrome_chrome_apk`,
The build targets are called `trichrome_webview_apk`, `trichrome_chrome_bundle`,
and `trichrome_library_apk` respectively, and the resulting output files are
called `TrichromeWebView.apk`, `TrichromeChrome.apk`, and
called `TrichromeWebView.apk`, `TrichromeChrome.aab`, and
`TrichromeLibrary.apk`.
### Choosing a WebView version
......
......@@ -1431,10 +1431,6 @@ if (current_toolchain == default_toolchain) {
is_monochrome = true
is_bundle_module = true
}
resource_packaging("trichrome_chrome_apk_pak_assets") {
is_monochrome = false
is_trichrome = true
}
resource_packaging("trichrome_chrome_bundle_module_pak_assets") {
is_monochrome = false
is_trichrome = true
......@@ -1812,7 +1808,7 @@ if (public_android_sdk) {
is_resource_ids_provider = true
},
{
name = ":trichrome_chrome_apk"
name = ":trichrome_chrome_bundle"
is_resource_ids_provider = false
},
]
......@@ -1840,29 +1836,6 @@ if (public_android_sdk) {
]
}
}
# This target should be removed once Trichrome only supports Chrome bundle
# builds.
trichrome_library_apk_tmpl("trichrome_library_for_bundle_apk") {
apk_name = "TrichromeLibraryForBundle"
android_manifest = trichrome_library_android_manifest
android_manifest_dep = ":trichrome_library_android_manifest"
if (trichrome_synchronized_proguard) {
shared_resources_whitelist_target = "//android_webview:system_webview_apk"
shared_resources_whitelist_locales = locales
static_library_dependent_targets = [
{
name = "//android_webview:trichrome_webview_for_bundle_apk"
is_resource_ids_provider = true
},
{
name = ":trichrome_chrome_bundle"
is_resource_ids_provider = false
},
]
}
}
}
# TODO(estevenson): Remove this once we switch to using bundle targets to
......@@ -1872,18 +1845,6 @@ android_resources("trichrome_dummy_resources") {
resource_dirs = [ "trichrome/res_dummy" ]
}
monochrome_public_apk_or_module_tmpl("trichrome_chrome_apk") {
version_code = trichrome_version_code
version_name = chrome_version_name
apk_name = "TrichromeChrome"
target_type = "android_apk"
use_trichrome_library = true
if (trichrome_synchronized_proguard) {
static_library_provider = ":trichrome_library_apk"
resource_ids_provider_dep = "//android_webview:trichrome_webview_apk"
}
}
chrome_public_test_apk_manifest =
"$root_gen_dir/chrome_public_test_apk_manifest/AndroidManifest.xml"
chrome_public_test_vr_apk_manifest =
......@@ -2389,8 +2350,7 @@ template("monochrome_or_trichrome_public_bundle_tmpl") {
}
if (_is_trichrome && trichrome_synchronized_proguard) {
resource_ids_provider_dep =
"//android_webview:trichrome_webview_for_bundle_apk"
resource_ids_provider_dep = "//android_webview:trichrome_webview_apk"
}
}
......@@ -2423,7 +2383,7 @@ template("monochrome_or_trichrome_public_bundle_tmpl") {
}
if (trichrome_synchronized_proguard && _is_trichrome) {
static_library_provider = ":trichrome_library_for_bundle_apk"
static_library_provider = ":trichrome_library_apk"
}
}
}
......@@ -2463,7 +2423,7 @@ if (public_android_sdk) {
monochrome_or_trichrome_public_bundle_tmpl("trichrome_chrome_bundle") {
bundle_suffix = ""
use_trichrome_library = true
static_library_provider = ":trichrome_library_for_bundle_apk"
static_library_provider = ":trichrome_library_apk"
if (!is_java_debug) {
static_library_proguard_disabled = !trichrome_synchronized_proguard
}
......
......@@ -22,7 +22,7 @@ declare_args() {
multidex_in_release = false
# Experimental only. Causes .dex files to be store in the APK uncompressed.
# Only affects monochrome_public_apk and trichrome_chrome_apk.
# Only affects monochrome_public_apk.
use_uncompressed_dex = false
}
......
......@@ -177,11 +177,11 @@ out/Default` from the command line. To compile one, pass the GN label to Ninja
with no preceding "//" (so, for `//chrome/test:unit_tests` use `autoninja -C
out/Default chrome/test:unit_tests`).
### Multiple Chrome APK Targets
### Multiple Chrome Targets
The Google Play Store allows apps to send customized `.apk` files depending on
the version of Android running on a device. Chrome uses this feature to target
4 different versions using 4 different ninja targets:
The Google Play Store allows apps to send customized `.apk` or `.aab` files
depending on the version of Android running on a device. Chrome uses this
feature to target 4 different versions using 4 different ninja targets:
1. `chrome_public_apk` (ChromePublic.apk)
* `minSdkVersion=19` (KitKat).
......@@ -201,7 +201,7 @@ the version of Android running on a device. Chrome uses this feature to target
* Stores libmonochrome.so uncompressed within the APK.
* Does not use Crazy Linker (WebView requires system linker).
* But system linker supports crazy linker features now anyways.
4. `trichrome_chrome_apk` and `trichrome_library_apk` (TrichromeChrome.apk and TrichromeLibrary.apk)
4. `trichrome_chrome_bundle` and `trichrome_library_apk` (TrichromeChrome.aab and TrichromeLibrary.apk)
* `minSdkVersion=Q` (Q).
* TrichromeChrome contains only the Chrome code that is not shared with WebView.
* TrichromeLibrary contains the shared code and is a "static shared library APK", which must be installed prior to TrichromeChrome.
......
......@@ -11,7 +11,7 @@ This doc outlines some tricks / gotchas / features of how we ship native code in
* It is loaded directly from the apk (without extracting) by `mmap()`'ing it.
* Android N, O & P (MonochromePublic.apk):
* `libmonochrome.so` is stored uncompressed (AndroidManifest.xml attribute disables extraction) and loaded directly from the apk (functionality now supported by the system linker).
* Android Q (TrichromeChrome.apk+TrichromeLibrary.apk):
* Android Q (TrichromeChrome.aab+TrichromeLibrary.apk):
* `libmonochrome.so` is stored in the shared library apk (TrichromeLibrary.apk) instead of in the Chrome apk, so that it can be shared with TrichromeWebView. It's stored uncompressed and loaded directly from the apk the same way as on N-P. Trichrome uses the same native library as Monochrome, so it's still called `libmonochrome.so`.
## Crashpad Packaging
......@@ -74,7 +74,7 @@ This doc outlines some tricks / gotchas / features of how we ship native code in
* `JNI_OnLoad()` is the only exported symbol (enforced by a linker script).
* Native methods registered explicitly during start-up by generated code.
* Explicit generation is required because the Android runtime uses the system's `dlsym()`, which doesn't know about Crazy-Linker-opened libraries.
* For MonochromePublic.apk and TrichromeChrome.apk:
* For MonochromePublic.apk and TrichromeChrome.aab:
* `JNI_OnLoad()` and `Java_*` symbols are exported by linker script.
* No manual JNI registration is done. Symbols are resolved lazily by the runtime.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment