Merge "Make GSI for arm64_ab more generic" into oc-mr1-dev
diff --git a/core/dex_preopt.mk b/core/dex_preopt.mk
index 0606c83..8e496a7 100644
--- a/core/dex_preopt.mk
+++ b/core/dex_preopt.mk
@@ -30,10 +30,10 @@
# Conditional to building on linux, as dex2oat currently does not work on darwin.
ifeq ($(HOST_OS),linux)
WITH_DEXPREOPT ?= true
-# For an eng build only pre-opt the boot image. This gives reasonable performance and still
-# allows a simple workflow: building in frameworks/base and syncing.
+# For an eng build only pre-opt the boot image and system server. This gives reasonable performance
+# and still allows a simple workflow: building in frameworks/base and syncing.
ifeq (eng,$(TARGET_BUILD_VARIANT))
- WITH_DEXPREOPT_BOOT_IMG_ONLY ?= true
+ WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY ?= true
endif
# Add mini-debug-info to the boot classpath unless explicitly asked not to.
ifneq (false,$(WITH_DEXPREOPT_DEBUG_INFO))
diff --git a/core/dex_preopt_odex_install.mk b/core/dex_preopt_odex_install.mk
index 136def4..cfcfca5 100644
--- a/core/dex_preopt_odex_install.mk
+++ b/core/dex_preopt_odex_install.mk
@@ -33,9 +33,12 @@
ifeq (,$(strip $(built_dex)$(my_prebuilt_src_file))) # contains no java code
LOCAL_DEX_PREOPT :=
endif
-# if WITH_DEXPREOPT_BOOT_IMG_ONLY=true and module is not in boot class path skip
-ifeq (true,$(WITH_DEXPREOPT_BOOT_IMG_ONLY))
-ifeq ($(filter $(DEXPREOPT_BOOT_JARS_MODULES),$(LOCAL_MODULE)),)
+# if WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY=true and module is not in boot class path skip
+# Also preopt system server jars since selinux prevents system server from loading anything from
+# /data. If we don't do this they will need to be extracted which is not favorable for RAM usage
+# or performance.
+ifeq (true,$(WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY))
+ifeq ($(filter $(PRODUCT_SYSTEM_SERVER_JARS) $(DEXPREOPT_BOOT_JARS_MODULES),$(LOCAL_MODULE)),)
LOCAL_DEX_PREOPT :=
endif
endif
@@ -142,16 +145,19 @@
ifndef LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING
$(call pretty-error,Must have specified class listing (LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING))
endif
+ifeq (,$(dex_preopt_profile_src_file))
+$(call pretty-error, Internal error: dex_preopt_profile_src_file must be set)
+endif
my_built_profile := $(dir $(LOCAL_BUILT_MODULE))/profile.prof
my_dex_location := $(patsubst $(PRODUCT_OUT)%,%,$(LOCAL_INSTALLED_MODULE))
$(built_odex): $(my_built_profile)
$(built_odex): PRIVATE_PROFILE_PREOPT_FLAGS := --profile-file=$(my_built_profile)
-$(my_built_profile): PRIVATE_BUILT_MODULE := $(LOCAL_BUILT_MODULE)
+$(my_built_profile): PRIVATE_BUILT_MODULE := $(dex_preopt_profile_src_file)
$(my_built_profile): PRIVATE_DEX_LOCATION := $(my_dex_location)
$(my_built_profile): PRIVATE_SOURCE_CLASSES := $(LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING)
$(my_built_profile): $(LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING)
$(my_built_profile): $(PROFMAN)
-$(my_built_profile): $(LOCAL_BUILT_MODULE)
+$(my_built_profile): $(dex_preopt_profile_src_file)
$(my_built_profile):
$(hide) mkdir -p $(dir $@)
ANDROID_LOG_TAGS="*:e" $(PROFMAN) \
@@ -159,6 +165,7 @@
--apk=$(PRIVATE_BUILT_MODULE) \
--dex-location=$(PRIVATE_DEX_LOCATION) \
--reference-profile-file=$@
+dex_preopt_profile_src_file:=
my_installed_profile := $(LOCAL_INSTALLED_MODULE).prof
$(eval $(call copy-one-file,$(my_built_profile),$(my_installed_profile)))
build_installed_profile:=$(my_built_profile):$(my_installed_profile)
diff --git a/core/java.mk b/core/java.mk
index 8fde7c2..3601292 100644
--- a/core/java.mk
+++ b/core/java.mk
@@ -381,6 +381,19 @@
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_HAS_RS_SOURCES := $(if $(renderscript_sources),true)
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_RS_SOURCE_INTERMEDIATES_DIR := $(intermediates.COMMON)/renderscript
+# Set the profile source so that the odex / profile code included from java.mk
+# can find it.
+#
+# TODO: b/64896089, this is broken when called from package_internal.mk, since the file
+# we preopt from is a temporary file. This will be addressed in a follow up, possibly
+# by disabling stripping for profile guided preopt (which may be desirable for other
+# reasons anyway).
+#
+# Note that we set this only when called from package_internal.mk and not in other cases.
+ifneq (,$(called_from_package_internal)
+dex_preopt_profile_src_file := $(LOCAL_BUILT_MODULE)
+endif
+
#######################################
# defines built_odex along with rule to install odex
include $(BUILD_SYSTEM)/dex_preopt_odex_install.mk
diff --git a/core/java_library.mk b/core/java_library.mk
index 0aad84c..84f4419 100644
--- a/core/java_library.mk
+++ b/core/java_library.mk
@@ -44,6 +44,7 @@
# java libraries produce javalib.jar, so we will copy classes.jar there too.
intermediates.COMMON := $(call local-intermediates-dir,COMMON)
common_javalib.jar := $(intermediates.COMMON)/javalib.jar
+dex_preopt_profile_src_file := $(common_javalib.jar)
LOCAL_INTERMEDIATE_TARGETS += $(common_javalib.jar)
ifeq ($(LOCAL_PROGUARD_ENABLED),disabled)
diff --git a/core/package_internal.mk b/core/package_internal.mk
index 2eb806c..87a15d2 100644
--- a/core/package_internal.mk
+++ b/core/package_internal.mk
@@ -327,9 +327,11 @@
include $(BUILD_SYSTEM)/android_manifest.mk
+called_from_package_internal := true
#################################
include $(BUILD_SYSTEM)/java.mk
#################################
+called_from_package_internal :=
LOCAL_SDK_RES_VERSION:=$(strip $(LOCAL_SDK_RES_VERSION))
ifeq ($(LOCAL_SDK_RES_VERSION),)
diff --git a/core/prebuilt_internal.mk b/core/prebuilt_internal.mk
index 48593a5..a9c0bc2 100644
--- a/core/prebuilt_internal.mk
+++ b/core/prebuilt_internal.mk
@@ -283,6 +283,8 @@
my_extract_apk :=
endif
+dex_preopt_profile_src_file := $(my_prebuilt_src_file)
+
rs_compatibility_jni_libs :=
include $(BUILD_SYSTEM)/install_jni_libs.mk
diff --git a/core/product.mk b/core/product.mk
index 6722526..8f7db19 100644
--- a/core/product.mk
+++ b/core/product.mk
@@ -302,7 +302,7 @@
_product_stash_var_list += \
DEFAULT_SYSTEM_DEV_CERTIFICATE \
WITH_DEXPREOPT \
- WITH_DEXPREOPT_BOOT_IMG_ONLY \
+ WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY \
WITH_DEXPREOPT_APP_IMAGE
#
diff --git a/target/board/Android.mk b/target/board/Android.mk
index 331367f..5504c52 100644
--- a/target/board/Android.mk
+++ b/target/board/Android.mk
@@ -131,12 +131,17 @@
endif
# All kernel versions that the system image works with.
-$(GEN): test/vts-testcase/kernel/config/data/android-3.18/android-base.cfg
-$(GEN): test/vts-testcase/kernel/config/data/android-4.4/android-base.cfg
-$(GEN): test/vts-testcase/kernel/config/data/android-4.9/android-base.cfg
-$(GEN): PRIVATE_FLAGS += --kernel=3.18:test/vts-testcase/kernel/config/data/android-3.18/android-base.cfg
-$(GEN): PRIVATE_FLAGS += --kernel=4.4:test/vts-testcase/kernel/config/data/android-4.4/android-base.cfg
-$(GEN): PRIVATE_FLAGS += --kernel=4.9:test/vts-testcase/kernel/config/data/android-4.9/android-base.cfg
+KERNEL_VERSIONS := 3.18 4.4 4.9
+KERNEL_CONFIG_DATA := test/vts-testcase/kernel/config/data
+
+$(GEN): $(foreach version,$(KERNEL_VERSIONS),\
+ $(wildcard $(KERNEL_CONFIG_DATA)/android-$(version)/android-base*.cfg))
+$(GEN): PRIVATE_FLAGS += $(foreach version,$(KERNEL_VERSIONS),\
+ --kernel=$(version):$(call normalize-path-list,\
+ $(wildcard $(KERNEL_CONFIG_DATA)/android-$(version)/android-base*.cfg)))
+
+KERNEL_VERSIONS :=
+KERNEL_CONFIG_DATA :=
$(GEN): $(FRAMEWORK_COMPATIBILITY_MATRIX_FILE) $(HOST_OUT_EXECUTABLES)/assemble_vintf
# TODO(b/37405869) (b/37715375) inject avb versions as well for devices that have avb enabled.
diff --git a/target/board/generic/BoardConfig.mk b/target/board/generic/BoardConfig.mk
index 8bb3ed0..331f082 100644
--- a/target/board/generic/BoardConfig.mk
+++ b/target/board/generic/BoardConfig.mk
@@ -34,7 +34,7 @@
ifeq ($(HOST_OS),linux)
ifeq ($(WITH_DEXPREOPT),)
WITH_DEXPREOPT := true
- WITH_DEXPREOPT_BOOT_IMG_ONLY := false
+ WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY := false
endif
endif
diff --git a/target/board/generic/sepolicy/hal_drm_widevine.te b/target/board/generic/sepolicy/hal_drm_widevine.te
index c1a63ca..42d462a 100644
--- a/target/board/generic/sepolicy/hal_drm_widevine.te
+++ b/target/board/generic/sepolicy/hal_drm_widevine.te
@@ -8,4 +8,5 @@
allow hal_drm mediacodec:fd use;
allow hal_drm { appdomain -isolated_app }:fd use;
+vndbinder_use(hal_drm_widevine);
hal_client_domain(hal_drm_widevine, hal_graphics_composer);
diff --git a/target/board/generic_arm64/BoardConfig.mk b/target/board/generic_arm64/BoardConfig.mk
index a7a8943..46c8865 100644
--- a/target/board/generic_arm64/BoardConfig.mk
+++ b/target/board/generic_arm64/BoardConfig.mk
@@ -65,7 +65,7 @@
ifeq ($(HOST_OS),linux)
ifeq ($(WITH_DEXPREOPT),)
WITH_DEXPREOPT := true
- WITH_DEXPREOPT_BOOT_IMG_ONLY := false
+ WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY := false
endif
endif
diff --git a/target/board/generic_mips/BoardConfig.mk b/target/board/generic_mips/BoardConfig.mk
index a9e46b4..fb66d21 100644
--- a/target/board/generic_mips/BoardConfig.mk
+++ b/target/board/generic_mips/BoardConfig.mk
@@ -42,7 +42,7 @@
ifeq ($(HOST_OS),linux)
ifeq ($(WITH_DEXPREOPT),)
WITH_DEXPREOPT := true
- WITH_DEXPREOPT_BOOT_IMG_ONLY := false
+ WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY := false
endif
endif
diff --git a/target/board/generic_mips64/BoardConfig.mk b/target/board/generic_mips64/BoardConfig.mk
index 6cb6c11..67bb51f 100644
--- a/target/board/generic_mips64/BoardConfig.mk
+++ b/target/board/generic_mips64/BoardConfig.mk
@@ -57,7 +57,7 @@
ifeq ($(HOST_OS),linux)
ifeq ($(WITH_DEXPREOPT),)
WITH_DEXPREOPT := true
- WITH_DEXPREOPT_BOOT_IMG_ONLY := false
+ WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY := false
endif
endif
diff --git a/target/board/generic_x86/BoardConfig.mk b/target/board/generic_x86/BoardConfig.mk
index bb2166b..000a9a3 100644
--- a/target/board/generic_x86/BoardConfig.mk
+++ b/target/board/generic_x86/BoardConfig.mk
@@ -22,7 +22,7 @@
# of an SDK AVD. Note that this operation only works on Linux for now
ifeq ($(HOST_OS),linux)
WITH_DEXPREOPT ?= true
-WITH_DEXPREOPT_BOOT_IMG_ONLY ?= false
+WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY ?= false
endif
TARGET_USES_HWC2 := true
diff --git a/target/board/generic_x86_64/BoardConfig.mk b/target/board/generic_x86_64/BoardConfig.mk
index b49a10c..883dd2e 100755
--- a/target/board/generic_x86_64/BoardConfig.mk
+++ b/target/board/generic_x86_64/BoardConfig.mk
@@ -28,7 +28,7 @@
# of an SDK AVD. Note that this operation only works on Linux for now
ifeq ($(HOST_OS),linux)
WITH_DEXPREOPT ?= true
-WITH_DEXPREOPT_BOOT_IMG_ONLY ?= false
+WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY ?= false
endif
TARGET_USES_HWC2 := true
diff --git a/target/board/generic_x86_arm/BoardConfig.mk b/target/board/generic_x86_arm/BoardConfig.mk
index 4555f1f..131c001 100644
--- a/target/board/generic_x86_arm/BoardConfig.mk
+++ b/target/board/generic_x86_arm/BoardConfig.mk
@@ -39,7 +39,7 @@
ifeq ($(HOST_OS),linux)
ifeq ($(WITH_DEXPREOPT),)
WITH_DEXPREOPT := true
- WITH_DEXPREOPT_BOOT_IMG_ONLY := false
+ WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY := false
endif
endif
diff --git a/target/board/treble_common_32.mk b/target/board/treble_common_32.mk
index fb19d79..2c3447b 100644
--- a/target/board/treble_common_32.mk
+++ b/target/board/treble_common_32.mk
@@ -16,5 +16,5 @@
include build/make/target/board/treble_common.mk
-# Partition size is default 1GB (1024MB) for 32 bits projects
-BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1073741824
+# Partition size is default 906MB for 32 bits projects
+BOARD_SYSTEMIMAGE_PARTITION_SIZE := 950009856
diff --git a/target/product/embedded.mk b/target/product/embedded.mk
index aefba43..7efa686 100644
--- a/target/product/embedded.mk
+++ b/target/product/embedded.mk
@@ -20,7 +20,7 @@
PRODUCT_PACKAGES += \
adb \
adbd \
- android.hardware.configstore@1.1-service \
+ android.hardware.configstore@1.0-service \
android.hidl.allocator@1.0-service \
android.hidl.memory@1.0-impl \
atrace \
diff --git a/target/product/treble_common.mk b/target/product/treble_common.mk
index 2488653..070486d 100644
--- a/target/product/treble_common.mk
+++ b/target/product/treble_common.mk
@@ -54,6 +54,13 @@
PRODUCT_PACKAGES += \
netutils-wrapper-1.0
+# A workaround solution for some projects which require
+# TimeZoneRulesManagerService by overlaying resource property
+# "config_enableUpdateableTimeZoneRules"
+PRODUCT_PACKAGES += \
+ TimeZoneUpdater \
+ TimeZoneData \
+
# Android Verified Boot (AVB):
# Builds a special vbmeta.img that disables AVB verification.
# Otherwise, AVB will prevent the device from booting the generic system.img.