Commit 6b7fa064 authored by Samuel Huang's avatar Samuel Huang Committed by Commit Bot

[DevUI DFM] Fix breakage in APK builds.

DevUI DFM is on for bundle (AAB) builds only. For APK builds, which
does not support DFM, DevUI pages should be available by default.
However, the |dfmify_dev_ui| flag is common for bundle and APK builds.
So when the flag is on, for both bundle and APK builds:
* dev_ui_resources.pak is split from resources.pak, and
* Code to {check, perform} DevUI DFM {install, loading} are active.

As a result, DevUI pages break for APK builds (used by Android K).
Currently this only affects chrome://bluetooth-internals since that's
the only page moved into the DevUI DFM.

The fix: Include DevUI DFM Java classes and dev_ui_resources.pak into
the APK file. The Java classes tells DFM infra stub that the DevUI
module is installed, and the PAK provides the resources needed.

Bug: 1004263
Change-Id: I3bec6682799c49e84cf0a700c1b61a33a3335005
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1807069Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Reviewed-by: default avatarTibor Goldschwendt <tiborg@chromium.org>
Commit-Queue: Samuel Huang <huangs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#696925}
parent ec5d7bd7
...@@ -11,6 +11,7 @@ import("//build/config/compiler/compiler.gni") ...@@ -11,6 +11,7 @@ import("//build/config/compiler/compiler.gni")
import("//build/config/locales.gni") import("//build/config/locales.gni")
import("//build/util/version.gni") import("//build/util/version.gni")
import("//chrome/android/chrome_common_shared_library.gni") import("//chrome/android/chrome_common_shared_library.gni")
import("//chrome/android/features/dev_ui/dev_ui_module.gni")
import("//chrome/common/features.gni") import("//chrome/common/features.gni")
import("//device/vr/buildflags/buildflags.gni") import("//device/vr/buildflags/buildflags.gni")
import("channel.gni") import("channel.gni")
...@@ -235,7 +236,19 @@ template("chrome_public_common_apk_or_module_tmpl") { ...@@ -235,7 +236,19 @@ template("chrome_public_common_apk_or_module_tmpl") {
# for all other targets to save some binary size. # for all other targets to save some binary size.
if (_target_type == "android_app_bundle_module") { if (_target_type == "android_app_bundle_module") {
srcjar_deps = [ "//components/module_installer/android:module_installer_bundle_build_config" ] srcjar_deps = [ "//components/module_installer/android:module_installer_bundle_build_config" ]
} else { } else { # |_target_type| is "android_apk" or "instrumentation_test_apk".
if (dfmify_dev_ui) {
# Native resource split moves resources out of resources.pak, but this
# is a DFM feature, which APKs don't use. To make the resources split
# available for APKs, add dependencies to (1) Java classes, (2)
# resources of the resource split's DFM (e.g., DevUI DFM). The Java
# classes tells Chrome that the DFM is installed, which then causes the
# included resources to be loaded when needed.
deps += [
"//chrome/android/features/dev_ui:java", # (1) from above.
"//chrome/android/features/dev_ui:pak_assets", # (2) from above.
]
}
srcjar_deps = [ "//components/module_installer/android:module_installer_apk_build_config" ] srcjar_deps = [ "//components/module_installer/android:module_installer_apk_build_config" ]
} }
......
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