Move core-icu4j to PRODUCT_UPDATABLE_BOOT_JARS.
... but not really: move it back to PRODUCT_BOOT_JARS before the list is
passed to soong. This ensures that core-icu4j remains on the boot image
for system health reasons and maintains the status quo.
core-icu4j is the only APEX jar (aside from ART jars) that is ever meant
to be part of the boot image. This is an implementation detail that most
devs don't and shouldn't care about. Instead, most devs assume that
PRODUCT_UPDATABLE_BOOT_JARS is where all apex jars are meant to go. In
the follow ups, PRODUCT_UPDATABLE_BOOT_JARS would be renamed to
PRODUCT_APEX_BOOT_JARS, regardless of the updatable property.
This also solves the problem where vendors add /system and /system_ext
boot jars to PRODUCT_BOOT_JARS outside of default_art_config.mk and
essentially violate the ordering requirement: all /apex jars come after
/system and /system_ext.
Bug: 191127295
Test: atest CtsClasspathsTestCases derive_classpath_test
Change-Id: Ifdfdd02519a0f5baea45619523f0c1eb8be186bc
diff --git a/core/product_config.mk b/core/product_config.mk
index 5c85fb8..53bc9dd 100644
--- a/core/product_config.mk
+++ b/core/product_config.mk
@@ -249,6 +249,15 @@
PRODUCT_BOOT_JARS := $(call qualify-platform-jars,$(PRODUCT_BOOT_JARS))
+# b/191127295: force core-icu4j onto boot image. It comes from a non-updatable APEX jar, but has
+# historically been part of the boot image; even though APEX jars are not meant to be part of the
+# boot image.
+# TODO(b/191686720): remove PRODUCT_UPDATABLE_BOOT_JARS to avoid a special handling of core-icu4j
+# in make rules.
+PRODUCT_UPDATABLE_BOOT_JARS := $(filter-out com.android.i18n:core-icu4j,$(PRODUCT_UPDATABLE_BOOT_JARS))
+# All APEX jars come after /system and /system_ext jars, so adding core-icu4j at the end of the list
+PRODUCT_BOOT_JARS += com.android.i18n:core-icu4j
+
# Replaces references to overridden boot jar modules in a boot jars variable.
# $(1): Name of a boot jars variable with <apex>:<jar> pairs.
define replace-boot-jar-module-overrides
diff --git a/target/product/default_art_config.mk b/target/product/default_art_config.mk
index f0916f9..8c249b2 100644
--- a/target/product/default_art_config.mk
+++ b/target/product/default_art_config.mk
@@ -44,13 +44,11 @@
voip-common \
ims-common
-# Non-updatable APEX jars. Keep the list sorted.
-PRODUCT_BOOT_JARS += \
- com.android.i18n:core-icu4j
-
-# Updatable APEX boot jars. Keep the list sorted by module names and then library names.
+# APEX boot jars. Keep the list sorted by module names and then library names.
+# Note: core-icu4j is moved back to PRODUCT_BOOT_JARS in product_config.mk at a later stage.
PRODUCT_UPDATABLE_BOOT_JARS := \
com.android.conscrypt:conscrypt \
+ com.android.i18n:core-icu4j \
com.android.ipsec:android.net.ipsec.ike \
com.android.media:updatable-media \
com.android.mediaprovider:framework-mediaprovider \
@@ -60,7 +58,7 @@
com.android.tethering:framework-tethering \
com.android.wifi:framework-wifi
-# Updatable APEX system server jars. Keep the list sorted by module names and then library names.
+# APEX system server jars. Keep the list sorted by module names and then library names.
PRODUCT_UPDATABLE_SYSTEM_SERVER_JARS := \
com.android.art:service-art \
com.android.permission:service-permission \