Merge "Reland "mark platform un-availability"""
diff --git a/core/Makefile b/core/Makefile
index ab0c047..69ee80f 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -263,7 +263,7 @@
INSTALLED_DEFAULT_PROP_TARGET := $(TARGET_OUT)/etc/prop.default
INSTALLED_DEFAULT_PROP_OLD_TARGET := $(TARGET_ROOT_OUT)/default.prop
ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_DEFAULT_PROP_OLD_TARGET)
-$(INSTALLED_DEFAULT_PROP_OLD_TARGET): $(INSTALLED_DEFAULT_PROP_TARGET)
+$(INSTALLED_DEFAULT_PROP_TARGET): .KATI_IMPLICIT_OUTPUTS := $(INSTALLED_DEFAULT_PROP_OLD_TARGET)
else
# legacy path
INSTALLED_DEFAULT_PROP_TARGET := $(TARGET_ROOT_OUT)/default.prop
@@ -874,7 +874,7 @@
# -----------------------------------------------------------------
# Cert-to-package mapping. Used by the post-build signing tools.
# Use a macro to add newline to each echo command
-# $1 package name
+# $1 stem name of the package
# $2 certificate
# $3 private key
# $4 compressed
@@ -904,8 +904,8 @@
@rm -f $@
$(foreach p,$(sort $(PACKAGES)),\
$(if $(PACKAGES.$(p).EXTERNAL_KEY),\
- $(call _apkcerts_write_line,$(p),"EXTERNAL","",$(PACKAGES.$(p).COMPRESSED),$(PACKAGES.$(p).PARTITION),$@),\
- $(call _apkcerts_write_line,$(p),$(PACKAGES.$(p).CERTIFICATE),$(PACKAGES.$(p).PRIVATE_KEY),$(PACKAGES.$(p).COMPRESSED),$(PACKAGES.$(p).PARTITION),$@)))
+ $(call _apkcerts_write_line,$(PACKAGES.$(p).STEM),"EXTERNAL","",$(PACKAGES.$(p).COMPRESSED),$(PACKAGES.$(p).PARTITION),$@),\
+ $(call _apkcerts_write_line,$(PACKAGES.$(p).STEM),$(PACKAGES.$(p).CERTIFICATE),$(PACKAGES.$(p).PRIVATE_KEY),$(PACKAGES.$(p).COMPRESSED),$(PACKAGES.$(p).PARTITION),$@)))
# In case value of PACKAGES is empty.
$(hide) touch $@
@@ -1358,10 +1358,10 @@
# original notice files instead of making rules to copy them somwehere.
# Then we could traverse that without quite as much bash drama.
define combine-notice-files
-$(2) $(3): PRIVATE_MESSAGE := $(4)
-$(2) $(3): PRIVATE_DIR := $(5)
-$(2) : $(3)
-$(3) : $(6) $(BUILD_SYSTEM)/Makefile build/make/tools/generate-notice-files.py
+$(2): PRIVATE_MESSAGE := $(4)
+$(2): PRIVATE_DIR := $(5)
+$(2): .KATI_IMPLICIT_OUTPUTS := $(3)
+$(2): $(6) $(BUILD_SYSTEM)/Makefile build/make/tools/generate-notice-files.py
build/make/tools/generate-notice-files.py --text-output $(2) $(foreach xdir, $(7), -e $(xdir) )\
$(if $(filter $(1),xml_excluded_vendor_product_odm),-e vendor -e product -e system_ext -e odm --xml-output, \
$(if $(filter $(1),xml_excluded_system_product_odm),-e system -e product -e system_ext -e odm --xml-output, \
@@ -2767,10 +2767,10 @@
endif # INSTALLED_RECOVERYIMAGE_TARGET
endif # INSTALLED_BOOTIMAGE_TARGET
-$(INSTALLED_SYSTEMIMAGE_TARGET): $(BUILT_SYSTEMIMAGE) $(RECOVERY_FROM_BOOT_PATCH)
+$(INSTALLED_SYSTEMIMAGE_TARGET): $(BUILT_SYSTEMIMAGE)
@echo "Install system fs image: $@"
$(copy-file-to-target)
- $(hide) $(call assert-max-image-size,$@ $(RECOVERY_FROM_BOOT_PATCH),$(BOARD_SYSTEMIMAGE_PARTITION_SIZE))
+ $(hide) $(call assert-max-image-size,$@,$(BOARD_SYSTEMIMAGE_PARTITION_SIZE))
systemimage: $(INSTALLED_SYSTEMIMAGE_TARGET)
@@ -3132,7 +3132,7 @@
$(BUILD_IMAGE) \
$(TARGET_OUT_VENDOR) $(vendorimage_intermediates)/vendor_image_info.txt \
$(INSTALLED_VENDORIMAGE_TARGET) $(TARGET_OUT)
- $(call assert-max-image-size,$(INSTALLED_VENDORIMAGE_TARGET),$(BOARD_VENDORIMAGE_PARTITION_SIZE))
+ $(call assert-max-image-size,$(INSTALLED_VENDORIMAGE_TARGET) $(RECOVERY_FROM_BOOT_PATCH),$(BOARD_VENDORIMAGE_PARTITION_SIZE))
endef
# We just build this directly to the install location.
@@ -3140,7 +3140,8 @@
$(INSTALLED_VENDORIMAGE_TARGET): \
$(INTERNAL_USERIMAGES_DEPS) \
$(INTERNAL_VENDORIMAGE_FILES) \
- $(INSTALLED_FILES_FILE_VENDOR)
+ $(INSTALLED_FILES_FILE_VENDOR) \
+ $(RECOVERY_FROM_BOOT_PATCH)
$(build-vendorimage-target)
.PHONY: vendorimage-nodeps vnod
diff --git a/core/app_prebuilt_internal.mk b/core/app_prebuilt_internal.mk
index 61e13e9..ab574b3 100644
--- a/core/app_prebuilt_internal.mk
+++ b/core/app_prebuilt_internal.mk
@@ -172,6 +172,12 @@
$(built_module): PRIVATE_CERTIFICATE_LINEAGE := $(LOCAL_CERTIFICATE_LINEAGE)
endif
+ifneq ($(LOCAL_MODULE_STEM),)
+ PACKAGES.$(LOCAL_MODULE).STEM := $(LOCAL_MODULE_STEM)
+else
+ PACKAGES.$(LOCAL_MODULE).STEM := $(LOCAL_MODULE)
+endif
+
include $(BUILD_SYSTEM)/app_certificate_validate.mk
# Set a actual_partition_tag (calculated in base_rules.mk) for the package.
diff --git a/core/base_rules.mk b/core/base_rules.mk
index f5bfc7d..e5b4e8f 100644
--- a/core/base_rules.mk
+++ b/core/base_rules.mk
@@ -905,7 +905,7 @@
##########################################################
# Track module-level dependencies.
# Use $(LOCAL_MODULE) instead of $(my_register_name) to ignore module's bitness.
-ifneq (,$(filter deps-license,$(MAKECMDGOALS)))
+ifdef RECORD_ALL_DEPS
ALL_DEPS.MODULES := $(ALL_DEPS.MODULES) $(LOCAL_MODULE)
ALL_DEPS.$(LOCAL_MODULE).ALL_DEPS := $(sort \
$(ALL_DEPS.$(LOCAL_MODULE).ALL_DEPS) \
diff --git a/core/binary.mk b/core/binary.mk
index 0582920..b14d8b8 100644
--- a/core/binary.mk
+++ b/core/binary.mk
@@ -1570,28 +1570,22 @@
## Define PRIVATE_ variables from global vars
###########################################################
ifndef LOCAL_IS_HOST_MODULE
+
ifdef LOCAL_USE_VNDK
-my_target_global_c_includes := \
- $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)PROJECT_INCLUDES)
-my_target_global_c_system_includes := \
- $(TARGET_OUT_HEADERS) \
- $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)PROJECT_SYSTEM_INCLUDES)
+ my_target_global_c_includes :=
+ my_target_global_c_system_includes := $(TARGET_OUT_HEADERS)
else ifdef LOCAL_SDK_VERSION
-my_target_global_c_includes :=
-my_target_global_c_system_includes := $(my_ndk_stl_include_path) $(my_ndk_sysroot_include)
+ my_target_global_c_includes :=
+ my_target_global_c_system_includes := $(my_ndk_stl_include_path) $(my_ndk_sysroot_include)
else ifdef BOARD_VNDK_VERSION
-my_target_global_c_includes := $(SRC_HEADERS) \
- $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)PROJECT_INCLUDES) \
+ my_target_global_c_includes := $(SRC_HEADERS) \
$($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)C_INCLUDES)
-my_target_global_c_system_includes := $(SRC_SYSTEM_HEADERS) \
- $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)PROJECT_SYSTEM_INCLUDES) \
+ my_target_global_c_system_includes := $(SRC_SYSTEM_HEADERS) \
$($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)C_SYSTEM_INCLUDES)
else
-my_target_global_c_includes := $(SRC_HEADERS) \
- $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)PROJECT_INCLUDES) \
+ my_target_global_c_includes := $(SRC_HEADERS) \
$($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)C_INCLUDES)
-my_target_global_c_system_includes := $(SRC_SYSTEM_HEADERS) $(TARGET_OUT_HEADERS) \
- $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)PROJECT_SYSTEM_INCLUDES) \
+ my_target_global_c_system_includes := $(SRC_SYSTEM_HEADERS) $(TARGET_OUT_HEADERS) \
$($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)C_SYSTEM_INCLUDES)
endif
@@ -1674,9 +1668,22 @@
####################################################
## Import includes
####################################################
+imported_includes :=
+
+ifdef LOCAL_USE_VNDK
+ imported_includes += $(call intermediates-dir-for,HEADER_LIBRARIES,device_kernel_headers,$(my_kind),,$(LOCAL_2ND_ARCH_VAR_PREFIX),$(my_host_cross))
+else ifdef LOCAL_SDK_VERSION
+ # Apps shouldn't need device-specific kernel headers
+else ifdef BOARD_VNDK_VERSION
+ # For devices building with the VNDK, only the VNDK gets device-specific kernel headers by default
+ # In soong, it's entirely opt-in
+else
+ # For older non-VNDK builds, continue adding in kernel headers to everything like we used to
+ imported_includes += $(call intermediates-dir-for,HEADER_LIBRARIES,device_kernel_headers,$(my_kind),,$(LOCAL_2ND_ARCH_VAR_PREFIX),$(my_host_cross))
+endif
+
imported_includes := $(strip \
- $(if $(LOCAL_USE_VNDK),\
- $(call intermediates-dir-for,HEADER_LIBRARIES,device_kernel_headers,$(my_kind),,$(LOCAL_2ND_ARCH_VAR_PREFIX),$(my_host_cross))) \
+ $(imported_includes) \
$(foreach l, $(installed_shared_library_module_names), \
$(call intermediates-dir-for,SHARED_LIBRARIES,$(l),$(my_kind),,$(LOCAL_2ND_ARCH_VAR_PREFIX),$(my_host_cross))) \
$(foreach l, $(my_static_libraries) $(my_whole_static_libraries), \
diff --git a/core/check_elf_file.mk b/core/check_elf_file.mk
index da4168d..d54a5b7 100644
--- a/core/check_elf_file.mk
+++ b/core/check_elf_file.mk
@@ -38,6 +38,8 @@
$<
$(hide) touch $@
+CHECK_ELF_FILES.$(check_elf_files_stamp) := 1
+
ifneq ($(strip $(LOCAL_CHECK_ELF_FILES)),false)
ifneq ($(strip $(BUILD_BROKEN_PREBUILT_ELF_FILES)),true)
$(LOCAL_BUILT_MODULE): $(check_elf_files_stamp)
diff --git a/core/config.mk b/core/config.mk
index 160614d..8910c11 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -135,6 +135,12 @@
LOCAL_IS_AUX_MODULE \
,AUX support has been removed)
$(KATI_obsolete_var HOST_OUT_TEST_CONFIG TARGET_OUT_TEST_CONFIG LOCAL_TEST_CONFIG_OPTIONS)
+$(KATI_obsolete_var \
+ TARGET_PROJECT_INCLUDES \
+ 2ND_TARGET_PROJECT_INCLUDES \
+ TARGET_PROJECT_SYSTEM_INCLUDES \
+ 2ND_TARGET_PROJECT_SYSTEM_INCLUDES \
+ ,Project include variables have been removed)
# Used to force goals to build. Only use for conditionally defined goals.
.PHONY: FORCE
@@ -1057,16 +1063,6 @@
RELATIVE_PWD :=
endif
-TARGET_PROJECT_INCLUDES :=
-TARGET_PROJECT_SYSTEM_INCLUDES := \
- $(TARGET_DEVICE_KERNEL_HEADERS) $(TARGET_BOARD_KERNEL_HEADERS) \
- $(TARGET_PRODUCT_KERNEL_HEADERS)
-
-ifdef TARGET_2ND_ARCH
-$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_PROJECT_INCLUDES := $(TARGET_PROJECT_INCLUDES)
-$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_PROJECT_SYSTEM_INCLUDES := $(TARGET_PROJECT_SYSTEM_INCLUDES)
-endif
-
# Flags for DEX2OAT
first_non_empty_of_three = $(if $(1),$(1),$(if $(2),$(2),$(3)))
DEX2OAT_TARGET_ARCH := $(TARGET_ARCH)
@@ -1218,4 +1214,7 @@
DEFAULT_DATA_OUT_MODULES := ltp $(ltp_packages) $(kselftest_modules)
.KATI_READONLY := DEFAULT_DATA_OUT_MODULES
+# Make RECORD_ALL_DEPS readonly and also set it if deps-license is a goal.
+RECORD_ALL_DEPS :=$= $(filter true,$(RECORD_ALL_DEPS))$(filter deps-license,$(MAKECMDGOALS))
+
include $(BUILD_SYSTEM)/dumpvar.mk
diff --git a/core/envsetup.mk b/core/envsetup.mk
index 6e75a18..7dd19cf 100644
--- a/core/envsetup.mk
+++ b/core/envsetup.mk
@@ -258,7 +258,13 @@
# java code with dalvikvm/art.
# Jars present in the ART apex. These should match exactly the list of
# Java libraries in the ART apex build rule.
-ART_APEX_JARS := core-oj core-libart core-icu4j okhttp bouncycastle apache-xml
+ART_APEX_JARS := \
+ com.android.art:core-oj \
+ com.android.art:core-libart \
+ com.android.art:core-icu4j \
+ com.android.art:okhttp \
+ com.android.art:bouncycastle \
+ com.android.art:apache-xml
#################################################################
# Read the product specs so we can get TARGET_DEVICE and other
diff --git a/core/java.mk b/core/java.mk
index 6798efa..61a3ad3 100644
--- a/core/java.mk
+++ b/core/java.mk
@@ -501,9 +501,9 @@
$(transform-classes.jar-to-dex)
endif
-ifneq ($(filter $(LOCAL_MODULE),$(PRODUCT_BOOT_JARS)),)
- $(call pretty-error,Modules in PRODUCT_BOOT_JARS must be defined in Android.bp files)
-endif
+$(foreach pair,$(PRODUCT_BOOT_JARS), \
+ $(if $(filter $(LOCAL_MODULE),$(call word-colon,2,$(pair))), \
+ $(call pretty-error,Modules in PRODUCT_BOOT_JARS must be defined in Android.bp files)))
$(built_dex): $(built_dex_intermediate)
@echo Copying: $@
diff --git a/core/java_common.mk b/core/java_common.mk
index f6e01d2..b218c0d 100644
--- a/core/java_common.mk
+++ b/core/java_common.mk
@@ -382,7 +382,9 @@
endif # USE_CORE_LIB_BOOTCLASSPATH
endif # !LOCAL_IS_HOST_MODULE
+ifdef RECORD_ALL_DEPS
ALL_DEPS.$(LOCAL_MODULE).ALL_DEPS := $(ALL_DEPS.$(LOCAL_MODULE).ALL_DEPS) $(full_java_bootclasspath_libs)
+endif
# Export the SDK libs. The sdk library names listed in LOCAL_SDK_LIBRARIES are first exported.
# Then sdk library names exported from dependencies are all re-exported.
diff --git a/core/java_prebuilt_internal.mk b/core/java_prebuilt_internal.mk
index 8a2091e..95ae2f8 100644
--- a/core/java_prebuilt_internal.mk
+++ b/core/java_prebuilt_internal.mk
@@ -35,9 +35,9 @@
my_dex_jar := $(my_prebuilt_src_file)
# This is a target shared library, i.e. a jar with classes.dex.
-ifneq ($(filter $(LOCAL_MODULE),$(PRODUCT_BOOT_JARS)),)
- $(call pretty-error,Modules in PRODUCT_BOOT_JARS must be defined in Android.bp files)
-endif
+$(foreach pair,$(PRODUCT_BOOT_JARS), \
+ $(if $(filter $(LOCAL_MODULE),$(call word-colon,2,$(pair))), \
+ $(call pretty-error,Modules in PRODUCT_BOOT_JARS must be defined in Android.bp files)))
ALL_MODULES.$(my_register_name).CLASSES_JAR := $(common_classes_jar)
diff --git a/core/local_systemsdk.mk b/core/local_systemsdk.mk
index 2b73f93..460073d 100644
--- a/core/local_systemsdk.mk
+++ b/core/local_systemsdk.mk
@@ -15,7 +15,7 @@
#
ifdef BOARD_SYSTEMSDK_VERSIONS
- # Apps and jars in vendor or odm partition are forced to build against System SDK.
+ # Apps and jars in vendor, product or odm partition are forced to build against System SDK.
_cannot_use_platform_apis :=
ifneq (,$(filter true,$(LOCAL_VENDOR_MODULE) $(LOCAL_ODM_MODULE) $(LOCAL_PROPRIETARY_MODULE)))
# Note: no need to check LOCAL_MODULE_PATH* since LOCAL_[VENDOR|ODM|OEM]_MODULE is already
@@ -29,9 +29,9 @@
ifneq (,$(filter JAVA_LIBRARIES APPS,$(LOCAL_MODULE_CLASS)))
ifndef LOCAL_SDK_VERSION
ifeq ($(_cannot_use_platform_apis),true)
- ifeq (,$(findstring __auto_generated_rro_,$(LOCAL_MODULE)))
+ ifeq (,$(LOCAL_IS_RUNTIME_RESOURCE_OVERLAY))
# Runtime resource overlays are exempted from building against System SDK.
- # TODO(b/35859726): remove this exception
+ # TODO(b/155027019): remove this, after no product/vendor apps rely on this behavior.
LOCAL_SDK_VERSION := system_current
endif
endif
diff --git a/core/main.mk b/core/main.mk
index 0f8af23..68303cf 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -795,9 +795,10 @@
$($(if $(2),$($(1)2ND_ARCH_VAR_PREFIX))TARGET_OUT_INTERMEDIATES)/SHARED_LIBRARIES/%,\
$(call module-built-files,$(mod)))))\
\
- $(if $(r),\
+ $(if $(and $(r),$(deps)),\
$(eval stamp := $(dir $(r))check_elf_files.timestamp)\
- $(eval $(call add-elf-file-check-shared-lib,$(stamp),$(deps)))\
+ $(if $(CHECK_ELF_FILES.$(stamp)),\
+ $(eval $(call add-elf-file-check-shared-lib,$(stamp),$(deps))))\
))
endef
@@ -1165,8 +1166,8 @@
# Verify the artifact path requirements made by included products.
is_asan := $(if $(filter address,$(SANITIZE_TARGET)),true)
ifneq (true,$(or $(is_asan),$(DISABLE_ARTIFACT_PATH_REQUIREMENTS)))
- # Fakes don't get installed
- static_whitelist_patterns := $(TARGET_OUT_FAKE)/%
+ # Fakes don't get installed, and NDK stubs aren't installed to device.
+ static_whitelist_patterns := $(TARGET_OUT_FAKE)/% $(SOONG_OUT_DIR)/ndk/%
# RROs become REQUIRED by the source module, but are always placed on the vendor partition.
static_whitelist_patterns += %__auto_generated_rro_product.apk
static_whitelist_patterns += %__auto_generated_rro_vendor.apk
diff --git a/core/package_internal.mk b/core/package_internal.mk
index 59e0701..034a36e 100644
--- a/core/package_internal.mk
+++ b/core/package_internal.mk
@@ -377,9 +377,11 @@
# they want to use this module's R.java file.
$(LOCAL_BUILT_MODULE): $(R_file_stamp)
+ifneq ($(full_classes_jar),)
# The R.java file must exist by the time the java source
# list is generated
$(java_source_list_file): $(R_file_stamp)
+endif
endif # need_compile_res
@@ -692,6 +694,12 @@
PACKAGES.$(LOCAL_PACKAGE_NAME).OVERRIDES := $(strip $(LOCAL_OVERRIDES_PACKAGES))
PACKAGES.$(LOCAL_PACKAGE_NAME).RESOURCE_FILES := $(all_resources)
+ifneq ($(LOCAL_MODULE_STEM),)
+ PACKAGES.$(LOCAL_MODULE).STEM := $(LOCAL_MODULE_STEM)
+else
+ PACKAGES.$(LOCAL_MODULE).STEM := $(LOCAL_MODULE)
+endif
+
PACKAGES := $(PACKAGES) $(LOCAL_PACKAGE_NAME)
# Reset internal variables.
diff --git a/core/product.mk b/core/product.mk
index b497abb..ea9be72 100644
--- a/core/product.mk
+++ b/core/product.mk
@@ -240,6 +240,10 @@
# List of system_server jars delivered via apex. Format = <apex name>:<jar name>.
_product_list_vars += PRODUCT_UPDATABLE_SYSTEM_SERVER_JARS
+# Additional system server jars to be appended at the end of the common list.
+# This is necessary to avoid jars reordering due to makefile inheritance order.
+_product_list_vars += PRODUCT_SYSTEM_SERVER_JARS_EXTRA
+
# All of the apps that we force preopt, this overrides WITH_DEXPREOPT.
_product_list_vars += PRODUCT_ALWAYS_PREOPT_EXTRACTED_APK
_product_list_vars += PRODUCT_DEXPREOPT_SPEED_APPS
diff --git a/core/product_config.mk b/core/product_config.mk
index aabd472..82967bc 100644
--- a/core/product_config.mk
+++ b/core/product_config.mk
@@ -231,6 +231,13 @@
# Extra boot jars must be appended at the end after common boot jars.
PRODUCT_BOOT_JARS += $(PRODUCT_BOOT_JARS_EXTRA)
+# Add 'platform:' prefix to unqualified boot jars
+PRODUCT_BOOT_JARS := $(foreach pair,$(PRODUCT_BOOT_JARS), \
+ $(if $(findstring :,$(pair)),,platform:)$(pair))
+
+# The extra system server jars must be appended at the end after common system server jars.
+PRODUCT_SYSTEM_SERVER_JARS += $(PRODUCT_SYSTEM_SERVER_JARS_EXTRA)
+
ifndef PRODUCT_SYSTEM_NAME
PRODUCT_SYSTEM_NAME := $(PRODUCT_NAME)
endif
@@ -268,11 +275,9 @@
endif
$(foreach pair,$(PRODUCT_UPDATABLE_BOOT_JARS), \
- $(if $(findstring $(call word-colon,2,$(pair)),$(PRODUCT_BOOT_JARS)), \
- $(error A jar in PRODUCT_UPDATABLE_BOOT_JARS must not be in PRODUCT_BOOT_JARS, \
- but $(call word-colon,2,$(pair)) is) \
- ) \
-)
+ $(eval jar := $(call word-colon,2,$(pair))) \
+ $(if $(findstring $(jar), $(PRODUCT_BOOT_JARS)), \
+ $(error A jar in PRODUCT_UPDATABLE_BOOT_JARS must not be in PRODUCT_BOOT_JARS, but $(jar) is)))
ENFORCE_SYSTEM_CERTIFICATE := $(PRODUCT_ENFORCE_ARTIFACT_SYSTEM_CERTIFICATE_REQUIREMENT)
ENFORCE_SYSTEM_CERTIFICATE_WHITELIST := $(PRODUCT_ARTIFACT_SYSTEM_CERTIFICATE_REQUIREMENT_WHITELIST)
diff --git a/core/soong_app_prebuilt.mk b/core/soong_app_prebuilt.mk
index 6dc396c..a3de688 100644
--- a/core/soong_app_prebuilt.mk
+++ b/core/soong_app_prebuilt.mk
@@ -157,6 +157,12 @@
include $(BUILD_SYSTEM)/app_certificate_validate.mk
PACKAGES.$(LOCAL_MODULE).OVERRIDES := $(strip $(LOCAL_OVERRIDES_PACKAGES))
+ifneq ($(LOCAL_MODULE_STEM),)
+ PACKAGES.$(LOCAL_MODULE).STEM := $(LOCAL_MODULE_STEM)
+else
+ PACKAGES.$(LOCAL_MODULE).STEM := $(LOCAL_MODULE)
+endif
+
# Set a actual_partition_tag (calculated in base_rules.mk) for the package.
PACKAGES.$(LOCAL_MODULE).PARTITION := $(actual_partition_tag)
diff --git a/core/soong_config.mk b/core/soong_config.mk
index cbc2dd1..18949be 100644
--- a/core/soong_config.mk
+++ b/core/soong_config.mk
@@ -121,7 +121,7 @@
$(call add_json_bool, ArtUseReadBarrier, $(call invert_bool,$(filter false,$(PRODUCT_ART_USE_READ_BARRIER))))
$(call add_json_bool, Binder32bit, $(BINDER32BIT))
$(call add_json_str, BtConfigIncludeDir, $(BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR))
-$(call add_json_list, DeviceKernelHeaders, $(TARGET_PROJECT_SYSTEM_INCLUDES))
+$(call add_json_list, DeviceKernelHeaders, $(TARGET_DEVICE_KERNEL_HEADERS) $(TARGET_BOARD_KERNEL_HEADERS) $(TARGET_PRODUCT_KERNEL_HEADERS))
$(call add_json_bool, DevicePrefer32BitApps, $(filter true,$(TARGET_PREFER_32_BIT_APPS)))
$(call add_json_bool, DevicePrefer32BitExecutables, $(filter true,$(TARGET_PREFER_32_BIT_EXECUTABLES)))
$(call add_json_str, DeviceVndkVersion, $(BOARD_VNDK_VERSION))
@@ -132,6 +132,8 @@
$(call add_json_list, DeviceSystemSdkVersions, $(BOARD_SYSTEMSDK_VERSIONS))
$(call add_json_list, Platform_systemsdk_versions, $(PLATFORM_SYSTEMSDK_VERSIONS))
$(call add_json_bool, Malloc_not_svelte, $(call invert_bool,$(filter true,$(MALLOC_SVELTE))))
+$(call add_json_bool, Malloc_zero_contents, $(MALLOC_ZERO_CONTENTS))
+$(call add_json_bool, Malloc_pattern_fill_contents, $(MALLOC_PATTERN_FILL_CONTENTS))
$(call add_json_str, Override_rs_driver, $(OVERRIDE_RS_DRIVER))
$(call add_json_bool, UncompressPrivAppDex, $(call invert_bool,$(filter true,$(DONT_UNCOMPRESS_PRIV_APPS_DEXS))))
diff --git a/core/soong_java_prebuilt.mk b/core/soong_java_prebuilt.mk
index 1496d56..509e3f6 100644
--- a/core/soong_java_prebuilt.mk
+++ b/core/soong_java_prebuilt.mk
@@ -91,7 +91,8 @@
ifdef LOCAL_SOONG_DEX_JAR
ifndef LOCAL_IS_HOST_MODULE
- ifneq ($(filter $(LOCAL_MODULE),$(PRODUCT_BOOT_JARS)),) # is_boot_jar
+ boot_jars := $(foreach pair,$(PRODUCT_BOOT_JARS), $(call word-colon,2,$(pair)))
+ ifneq ($(filter $(LOCAL_MODULE),$(boot_jars)),) # is_boot_jar
ifeq (true,$(WITH_DEXPREOPT))
# For libart, the boot jars' odex files are replaced by $(DEFAULT_DEX_PREOPT_INSTALLED_IMAGE).
# We use this installed_odex trick to get boot.art installed.
diff --git a/core/tasks/boot_jars_package_check.mk b/core/tasks/boot_jars_package_check.mk
index 05243e5..02d7212 100644
--- a/core/tasks/boot_jars_package_check.mk
+++ b/core/tasks/boot_jars_package_check.mk
@@ -23,19 +23,26 @@
intermediates := $(call intermediates-dir-for, PACKAGING, boot-jars-package-check,,COMMON)
stamp := $(intermediates)/stamp
-# The actual names for the updatable jars are <jar_name>.<apex_name> e.g., updatable-media.com.android.media
-updatable_boot_jars := $(foreach pair,$(PRODUCT_UPDATABLE_BOOT_JARS),\
- $(eval apex := $(call word-colon,1,$(pair)))\
- $(eval jar := $(call word-colon,2,$(pair)))\
- $(jar).$(apex)\
-)
-#TODO(jiyong) merge art_boot_jars into updatable_boot_jars
-art_boot_jars := $(addsuffix .com.android.art.release,$(filter $(ART_APEX_JARS),$(PRODUCT_BOOT_JARS)))
+# Convert the colon-separated components <apex>:<jar> to <jar>.<apex> names
+# (e.g. com.android.media:updatable-media -> updatable-media.com.android.media).
+# Special cases:
+# - for the "platform" or "system_ext" apex drop the .<apex> suffix
+# - for the ART apex select release variant
+boot_jars := $(foreach pair,$(PRODUCT_BOOT_JARS) $(PRODUCT_UPDATABLE_BOOT_JARS), \
+ $(eval apex := $(call word-colon,1,$(pair))) \
+ $(eval jar := $(call word-colon,2,$(pair))) \
+ $(eval q := :) \
+ $(eval sfx := $(q).$(apex)$(q)) \
+ $(eval sfx := $(subst $(q).platform$(q),$(q)$(q),$(sfx))) \
+ $(eval sfx := $(subst $(q).system_ext$(q),$(q)$(q),$(sfx))) \
+ $(eval sfx := $(subst $(q).com.android.art$(q),$(q).com.android.art.release$(q),$(sfx))) \
+ $(eval sfx := $(patsubst $(q)%$(q),%,$(sfx))) \
+ $(jar)$(sfx))
-platform_boot_jars := $(filter-out $(ART_APEX_JARS),$(PRODUCT_BOOT_JARS))
-
-built_boot_jars := $(foreach j, $(updatable_boot_jars) $(art_boot_jars) $(platform_boot_jars), \
+# Convert boot jar names to build paths.
+built_boot_jars := $(foreach j, $(boot_jars), \
$(call intermediates-dir-for, JAVA_LIBRARIES, $(j),,COMMON)/classes.jar)
+
script := build/make/core/tasks/check_boot_jars/check_boot_jars.py
whitelist_file := build/make/core/tasks/check_boot_jars/package_whitelist.txt
diff --git a/core/tasks/vts-core-tests.mk b/core/tasks/vts-core-tests.mk
index 08663c2..4e83de5 100644
--- a/core/tasks/vts-core-tests.mk
+++ b/core/tasks/vts-core-tests.mk
@@ -21,8 +21,28 @@
# Some repo may not include vts project.
-include test/vts/tools/build/tasks/framework/vts_for_core_suite.mk
+# Copy kernel test modules to testcases directories
+kernel_test_host_out := $(HOST_OUT_TESTCASES)/vts_kernel_tests
+kernel_test_vts_out := $(HOST_OUT)/$(test_suite_name)/android-$(test_suite_name)/testcases/vts_kernel_tests
+kernel_test_modules := \
+ $(kselftest_modules) \
+ ltp \
+ $(ltp_packages)
+
+kernel_test_copy_pairs := \
+ $(call target-native-copy-pairs,$(kernel_test_modules),$(kernel_test_vts_out)) \
+ $(call target-native-copy-pairs,$(kernel_test_modules),$(kernel_test_host_out))
+
+copy_kernel_tests := $(call copy-many-files,$(kernel_test_copy_pairs))
+
+# PHONY target to be used to build and test `vts_kernel_tests` without building full vts
+.PHONY: vts_kernel_tests
+vts_kernel_tests: $(copy_kernel_tests)
+
include $(BUILD_SYSTEM)/tasks/tools/compatibility.mk
+$(compatibility_zip): $(copy_kernel_tests)
+
.PHONY: vts
$(compatibility_zip): $(vts_test_artifact_paths)
vts: $(compatibility_zip)
diff --git a/core/version_defaults.mk b/core/version_defaults.mk
index fe71d7b..39956b6 100644
--- a/core/version_defaults.mk
+++ b/core/version_defaults.mk
@@ -39,9 +39,9 @@
include $(INTERNAL_BUILD_ID_MAKEFILE)
endif
-DEFAULT_PLATFORM_VERSION := RP1A
-MIN_PLATFORM_VERSION := RP1A
-MAX_PLATFORM_VERSION := RP1A
+DEFAULT_PLATFORM_VERSION := SP1A
+MIN_PLATFORM_VERSION := SP1A
+MAX_PLATFORM_VERSION := SP1A
ALLOWED_VERSIONS := $(call allowed-platform-versions,\
$(MIN_PLATFORM_VERSION),\
@@ -85,10 +85,12 @@
# unreleased API level targetable by this branch, not just those that are valid
# lunch targets for this branch.
PLATFORM_VERSION.RP1A := R
+PLATFORM_VERSION.SP1A := S
# These are the current development codenames, if the build is not a final
# release build. If this is a final release build, it is simply "REL".
PLATFORM_VERSION_CODENAME.RP1A := R
+PLATFORM_VERSION_CODENAME.SP1A := S
ifndef PLATFORM_VERSION
PLATFORM_VERSION := $(PLATFORM_VERSION.$(TARGET_PLATFORM_VERSION))
diff --git a/target/board/generic_arm64/BoardConfig.mk b/target/board/generic_arm64/BoardConfig.mk
index 91d5692..d793c38 100644
--- a/target/board/generic_arm64/BoardConfig.mk
+++ b/target/board/generic_arm64/BoardConfig.mk
@@ -54,6 +54,8 @@
include build/make/target/board/BoardConfigGsiCommon.mk
+BOARD_EXT4_SHARE_DUP_BLOCKS := true
+
TARGET_NO_KERNEL := false
TARGET_NO_VENDOR_BOOT := true
BOARD_USES_RECOVERY_AS_BOOT := true
diff --git a/target/product/aosp_arm64.mk b/target/product/aosp_arm64.mk
index d026a19..3254ccf 100644
--- a/target/product/aosp_arm64.mk
+++ b/target/product/aosp_arm64.mk
@@ -51,7 +51,6 @@
#
# All components inherited here go to vendor or vendor_boot image
#
-$(call inherit-product-if-exists, device/generic/goldfish/arm64-vendor.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/product/emulator_vendor.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/board/generic_arm64/device.mk)
diff --git a/target/product/gsi/current.txt b/target/product/gsi/current.txt
index d2aefdc..1bfdf0a 100644
--- a/target/product/gsi/current.txt
+++ b/target/product/gsi/current.txt
@@ -129,7 +129,7 @@
VNDK-core: android.hardware.health@1.0.so
VNDK-core: android.hardware.health@2.0.so
VNDK-core: android.hardware.health@2.1.so
-VNDK-core: android.hardware.identity-V1-ndk_platform.so
+VNDK-core: android.hardware.identity-V2-ndk_platform.so
VNDK-core: android.hardware.input.classifier@1.0.so
VNDK-core: android.hardware.input.common@1.0.so
VNDK-core: android.hardware.ir@1.0.so
diff --git a/tools/releasetools/OWNERS b/tools/releasetools/OWNERS
index a8295d4..d7fc540 100644
--- a/tools/releasetools/OWNERS
+++ b/tools/releasetools/OWNERS
@@ -1,3 +1,4 @@
+elsk@google.com
nhdo@google.com
xunchang@google.com
zhaojiac@google.com
diff --git a/tools/releasetools/build_image.py b/tools/releasetools/build_image.py
index 54bb857..f30f787 100755
--- a/tools/releasetools/build_image.py
+++ b/tools/releasetools/build_image.py
@@ -57,7 +57,7 @@
Returns:
The number of bytes based on a 1K block_size.
"""
- cmd = ["du", "-k", "-s", path]
+ cmd = ["du", "-b", "-k", "-s", path]
output = common.RunAndCheckOutput(cmd, verbose=False)
return int(output.split()[0]) * 1024
diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py
index 5cf4810..1abf5a5 100644
--- a/tools/releasetools/common.py
+++ b/tools/releasetools/common.py
@@ -336,8 +336,11 @@
_RO_PRODUCT_RESOLVE_PROPS = ["ro.product.brand", "ro.product.device",
"ro.product.manufacturer", "ro.product.model",
"ro.product.name"]
- _RO_PRODUCT_PROPS_DEFAULT_SOURCE_ORDER = ["product", "odm", "vendor",
- "system_ext", "system"]
+ _RO_PRODUCT_PROPS_DEFAULT_SOURCE_ORDER_CURRENT = [
+ "product", "odm", "vendor", "system_ext", "system"]
+ _RO_PRODUCT_PROPS_DEFAULT_SOURCE_ORDER_ANDROID_10 = [
+ "product", "product_services", "odm", "vendor", "system"]
+ _RO_PRODUCT_PROPS_DEFAULT_SOURCE_ORDER_LEGACY = []
def __init__(self, info_dict, oem_dicts=None):
"""Initializes a BuildInfo instance with the given dicts.
@@ -358,10 +361,13 @@
self.oem_dicts = oem_dicts
self._is_ab = info_dict.get("ab_update") == "true"
- self._oem_props = info_dict.get("oem_fingerprint_properties")
- if self._oem_props:
- assert oem_dicts, "OEM source required for this build"
+ # Skip _oem_props if oem_dicts is None to use BuildInfo in
+ # sign_target_files_apks
+ if self.oem_dicts:
+ self._oem_props = info_dict.get("oem_fingerprint_properties")
+ else:
+ self._oem_props = None
def check_fingerprint(fingerprint):
if (" " in fingerprint or any(ord(ch) > 127 for ch in fingerprint)):
@@ -447,16 +453,16 @@
if prop_val:
return prop_val
+ default_source_order = self._GetRoProductPropsDefaultSourceOrder()
source_order_val = self.info_dict.get("build.prop", {}).get(
"ro.product.property_source_order")
if source_order_val:
source_order = source_order_val.split(",")
else:
- source_order = BuildInfo._RO_PRODUCT_PROPS_DEFAULT_SOURCE_ORDER
+ source_order = default_source_order
# Check that all sources in ro.product.property_source_order are valid
- if any([x not in BuildInfo._RO_PRODUCT_PROPS_DEFAULT_SOURCE_ORDER
- for x in source_order]):
+ if any([x not in default_source_order for x in source_order]):
raise ExternalError(
"Invalid ro.product.property_source_order '{}'".format(source_order))
@@ -470,6 +476,27 @@
raise ExternalError("couldn't resolve {}".format(prop))
+ def _GetRoProductPropsDefaultSourceOrder(self):
+ # NOTE: refer to CDDs and android.os.Build.VERSION for the definition and
+ # values of these properties for each Android release.
+ android_codename = self.info_dict.get("build.prop", {}).get(
+ "ro.build.version.codename")
+ if android_codename == "REL":
+ android_version = self.info_dict.get("build.prop", {}).get(
+ "ro.build.version.release")
+ if android_version == "10":
+ return BuildInfo._RO_PRODUCT_PROPS_DEFAULT_SOURCE_ORDER_ANDROID_10
+ # NOTE: float() conversion of android_version will have rounding error.
+ # We are checking for "9" or less, and using "< 10" is well outside of
+ # possible floating point rounding.
+ try:
+ android_version_val = float(android_version)
+ except ValueError:
+ android_version_val = 0
+ if android_version_val < 10:
+ return BuildInfo._RO_PRODUCT_PROPS_DEFAULT_SOURCE_ORDER_LEGACY
+ return BuildInfo._RO_PRODUCT_PROPS_DEFAULT_SOURCE_ORDER_CURRENT
+
def GetOemProperty(self, key):
if self.oem_props is not None and key in self.oem_props:
return self.oem_dicts[0][key]
@@ -1121,6 +1148,10 @@
if partition_name == "recovery":
args = info_dict.get("recovery_mkbootimg_args")
+ if not args:
+ # Fall back to "mkbootimg_args" for recovery image
+ # in case "recovery_mkbootimg_args" is not set.
+ args = info_dict.get("mkbootimg_args")
else:
args = info_dict.get("mkbootimg_args")
if args and args.strip():
diff --git a/tools/releasetools/sign_apex.py b/tools/releasetools/sign_apex.py
index b0128dc..fb947f4 100755
--- a/tools/releasetools/sign_apex.py
+++ b/tools/releasetools/sign_apex.py
@@ -35,6 +35,10 @@
-e (--extra_apks) <name,name,...=key>
Add extra APK name/key pairs. This is useful to sign the apk files in the
apex payload image.
+
+ --codename_to_api_level_map Q:29,R:30,...
+ A Mapping of codename to api level. This is useful to provide sdk targeting
+ information to APK Signer.
"""
import logging
@@ -48,7 +52,7 @@
def SignApexFile(avbtool, apex_file, payload_key, container_key, no_hashtree,
- apk_keys=None, signing_args=None):
+ apk_keys=None, signing_args=None, codename_to_api_level_map=None):
"""Signs the given apex file."""
with open(apex_file, 'rb') as input_fp:
apex_data = input_fp.read()
@@ -59,7 +63,7 @@
payload_key=payload_key,
container_key=container_key,
container_pw=None,
- codename_to_api_level_map=None,
+ codename_to_api_level_map=codename_to_api_level_map,
no_hashtree=no_hashtree,
apk_keys=apk_keys,
signing_args=signing_args)
@@ -82,6 +86,13 @@
options['payload_key'] = a
elif o == '--payload_extra_args':
options['payload_extra_args'] = a
+ elif o == '--codename_to_api_level_map':
+ versions = a.split(",")
+ for v in versions:
+ key, value = v.split(":")
+ if 'codename_to_api_level_map' not in options:
+ options['codename_to_api_level_map'] = {}
+ options['codename_to_api_level_map'].update({key: value})
elif o in ("-e", "--extra_apks"):
names, key = a.split("=")
names = names.split(",")
@@ -98,6 +109,7 @@
extra_opts='e:',
extra_long_opts=[
'avbtool=',
+ 'codename_to_api_level_map=',
'container_key=',
'payload_extra_args=',
'payload_key=',
@@ -119,7 +131,9 @@
options['container_key'],
no_hashtree=False,
apk_keys=options.get('extra_apks', {}),
- signing_args=options.get('payload_extra_args'))
+ signing_args=options.get('payload_extra_args'),
+ codename_to_api_level_map=options.get(
+ 'codename_to_api_level_map', {}))
shutil.copyfile(signed_apex, args[1])
logger.info("done.")
diff --git a/tools/releasetools/test_check_target_files_vintf.py b/tools/releasetools/test_check_target_files_vintf.py
index 79f9018..d326229 100644
--- a/tools/releasetools/test_check_target_files_vintf.py
+++ b/tools/releasetools/test_check_target_files_vintf.py
@@ -35,20 +35,20 @@
'SYSTEM_EXT/etc/build.prop': '',
# Non-empty files
- 'SYSTEM/compatibility_matrix.xml':"""
- <compatibility-matrix version="1.0" type="framework">
+ 'SYSTEM/etc/vintf/compatibility_matrix.1.xml':"""
+ <compatibility-matrix version="1.0" level="1" type="framework">
<sepolicy>
<sepolicy-version>0.0</sepolicy-version>
<kernel-sepolicy-version>0</kernel-sepolicy-version>
</sepolicy>
</compatibility-matrix>""",
'SYSTEM/manifest.xml':
- '<manifest version="1.0" type="framework" />',
+ '<manifest version="1.0" type="framework"/>',
'VENDOR/build.prop': 'ro.product.first_api_level=29\n',
'VENDOR/compatibility_matrix.xml':
'<compatibility-matrix version="1.0" type="device" />',
- 'VENDOR/manifest.xml':
- '<manifest version="1.0" type="device"/>',
+ 'VENDOR/etc/vintf/manifest.xml':
+ '<manifest version="1.0" target-level="1" type="device"/>',
'META/misc_info.txt':
'recovery_api_version=3\nfstab_version=2\nvintf_enforce=true\n',
}
@@ -140,6 +140,6 @@
def test_CheckVintf_bad_xml(self):
test_dir = self.prepare_test_dir('does-not-exist')
write_string_to_file('not an XML',
- os.path.join(test_dir, 'VENDOR/manifest.xml'))
+ os.path.join(test_dir, 'VENDOR/etc/vintf/manifest.xml'))
# Should raise an error because a file has invalid format.
self.assertRaises(common.ExternalError, CheckVintf, test_dir)
diff --git a/tools/releasetools/test_common.py b/tools/releasetools/test_common.py
index 551f626..665eb51 100644
--- a/tools/releasetools/test_common.py
+++ b/tools/releasetools/test_common.py
@@ -108,6 +108,51 @@
},
]
+ TEST_INFO_DICT_PROPERTY_SOURCE_ORDER = {
+ 'build.prop' : {
+ 'ro.build.fingerprint' : 'build-fingerprint',
+ 'ro.product.property_source_order' :
+ 'product,odm,vendor,system_ext,system',
+ },
+ 'system.build.prop' : {
+ 'ro.product.system.device' : 'system-product-device',
+ },
+ 'vendor.build.prop' : {
+ 'ro.product.vendor.device' : 'vendor-product-device',
+ },
+ }
+
+ TEST_INFO_DICT_PROPERTY_SOURCE_ORDER_ANDROID_10 = {
+ 'build.prop' : {
+ 'ro.build.fingerprint' : 'build-fingerprint',
+ 'ro.product.property_source_order' :
+ 'product,product_services,odm,vendor,system',
+ 'ro.build.version.release' : '10',
+ 'ro.build.version.codename' : 'REL',
+ },
+ 'system.build.prop' : {
+ 'ro.product.system.device' : 'system-product-device',
+ },
+ 'vendor.build.prop' : {
+ 'ro.product.vendor.device' : 'vendor-product-device',
+ },
+ }
+
+ TEST_INFO_DICT_PROPERTY_SOURCE_ORDER_ANDROID_9 = {
+ 'build.prop' : {
+ 'ro.product.device' : 'product-device',
+ 'ro.build.fingerprint' : 'build-fingerprint',
+ 'ro.build.version.release' : '9',
+ 'ro.build.version.codename' : 'REL',
+ },
+ 'system.build.prop' : {
+ 'ro.product.system.device' : 'system-product-device',
+ },
+ 'vendor.build.prop' : {
+ 'ro.product.vendor.device' : 'vendor-product-device',
+ },
+ }
+
def test_init(self):
target_info = common.BuildInfo(self.TEST_INFO_DICT, None)
self.assertEqual('product-device', target_info.device)
@@ -131,10 +176,6 @@
self.assertEqual('brand3/product-name/device3:build-thumbprint',
target_info.fingerprint)
- # Missing oem_dict should be rejected.
- self.assertRaises(AssertionError, common.BuildInfo,
- self.TEST_INFO_DICT_USES_OEM_PROPS, None)
-
def test_init_badFingerprint(self):
info_dict = copy.deepcopy(self.TEST_INFO_DICT)
info_dict['build.prop']['ro.build.fingerprint'] = 'bad fingerprint'
@@ -254,6 +295,41 @@
],
script_writer.lines)
+ def test_ResolveRoProductProperty_FromVendor(self):
+ info_dict = copy.deepcopy(self.TEST_INFO_DICT_PROPERTY_SOURCE_ORDER)
+ info = common.BuildInfo(info_dict, None)
+ self.assertEqual('vendor-product-device',
+ info.GetBuildProp('ro.product.device'))
+
+ def test_ResolveRoProductProperty_FromSystem(self):
+ info_dict = copy.deepcopy(self.TEST_INFO_DICT_PROPERTY_SOURCE_ORDER)
+ del info_dict['vendor.build.prop']['ro.product.vendor.device']
+ info = common.BuildInfo(info_dict, None)
+ self.assertEqual('system-product-device',
+ info.GetBuildProp('ro.product.device'))
+
+ def test_ResolveRoProductProperty_InvalidPropertySearchOrder(self):
+ info_dict = copy.deepcopy(self.TEST_INFO_DICT_PROPERTY_SOURCE_ORDER)
+ info_dict['build.prop']['ro.product.property_source_order'] = 'bad-source'
+ with self.assertRaisesRegexp(common.ExternalError,
+ 'Invalid ro.product.property_source_order'):
+ info = common.BuildInfo(info_dict, None)
+ info.GetBuildProp('ro.product.device')
+
+ def test_ResolveRoProductProperty_Android10PropertySearchOrder(self):
+ info_dict = copy.deepcopy(
+ self.TEST_INFO_DICT_PROPERTY_SOURCE_ORDER_ANDROID_10)
+ info = common.BuildInfo(info_dict, None)
+ self.assertEqual('vendor-product-device',
+ info.GetBuildProp('ro.product.device'))
+
+ def test_ResolveRoProductProperty_Android9PropertySearchOrder(self):
+ info_dict = copy.deepcopy(
+ self.TEST_INFO_DICT_PROPERTY_SOURCE_ORDER_ANDROID_9)
+ info = common.BuildInfo(info_dict, None)
+ self.assertEqual('product-device',
+ info.GetBuildProp('ro.product.device'))
+
class CommonZipTest(test_utils.ReleaseToolsTestCase):
diff --git a/tools/releasetools/testdata/vintf/kernel/SYSTEM/compatibility_matrix.xml b/tools/releasetools/testdata/vintf/kernel/SYSTEM/etc/vintf/compatibility_matrix.1.xml
similarity index 74%
rename from tools/releasetools/testdata/vintf/kernel/SYSTEM/compatibility_matrix.xml
rename to tools/releasetools/testdata/vintf/kernel/SYSTEM/etc/vintf/compatibility_matrix.1.xml
index ed46b6b..a92dd6e 100644
--- a/tools/releasetools/testdata/vintf/kernel/SYSTEM/compatibility_matrix.xml
+++ b/tools/releasetools/testdata/vintf/kernel/SYSTEM/etc/vintf/compatibility_matrix.1.xml
@@ -1,4 +1,4 @@
-<compatibility-matrix version="1.0" type="framework">
+<compatibility-matrix version="1.0" level="1" type="framework">
<kernel version="4.14.1" />
<sepolicy>
<sepolicy-version>0.0</sepolicy-version>
diff --git a/tools/releasetools/testdata/vintf/matrix_incompat/SYSTEM/compatibility_matrix.xml b/tools/releasetools/testdata/vintf/matrix_incompat/SYSTEM/etc/vintf/compatibility_matrix.1.xml
similarity index 71%
rename from tools/releasetools/testdata/vintf/matrix_incompat/SYSTEM/compatibility_matrix.xml
rename to tools/releasetools/testdata/vintf/matrix_incompat/SYSTEM/etc/vintf/compatibility_matrix.1.xml
index 5d891fa..1700e21 100644
--- a/tools/releasetools/testdata/vintf/matrix_incompat/SYSTEM/compatibility_matrix.xml
+++ b/tools/releasetools/testdata/vintf/matrix_incompat/SYSTEM/etc/vintf/compatibility_matrix.1.xml
@@ -1,4 +1,4 @@
-<compatibility-matrix version="1.0" type="framework">
+<compatibility-matrix version="1.0" level="1" type="framework">
<sepolicy>
<sepolicy-version>1.0</sepolicy-version>
<kernel-sepolicy-version>0</kernel-sepolicy-version>
diff --git a/tools/releasetools/testdata/vintf/sku_compat/SYSTEM/compatibility_matrix.xml b/tools/releasetools/testdata/vintf/sku_compat/SYSTEM/etc/vintf/compatibility_matrix.1.xml
similarity index 85%
rename from tools/releasetools/testdata/vintf/sku_compat/SYSTEM/compatibility_matrix.xml
rename to tools/releasetools/testdata/vintf/sku_compat/SYSTEM/etc/vintf/compatibility_matrix.1.xml
index 19a9b6a..22272fd 100644
--- a/tools/releasetools/testdata/vintf/sku_compat/SYSTEM/compatibility_matrix.xml
+++ b/tools/releasetools/testdata/vintf/sku_compat/SYSTEM/etc/vintf/compatibility_matrix.1.xml
@@ -1,4 +1,4 @@
-<compatibility-matrix version="1.0" type="framework">
+<compatibility-matrix version="1.0" level="1" type="framework">
<hal format="hidl" optional="false">
<name>foo</name>
<version>1.0</version>
diff --git a/tools/releasetools/testdata/vintf/sku_incompat/SYSTEM/compatibility_matrix.xml b/tools/releasetools/testdata/vintf/sku_incompat/SYSTEM/etc/vintf/compatibility_matrix.1.xml
similarity index 85%
rename from tools/releasetools/testdata/vintf/sku_incompat/SYSTEM/compatibility_matrix.xml
rename to tools/releasetools/testdata/vintf/sku_incompat/SYSTEM/etc/vintf/compatibility_matrix.1.xml
index e0e0d6c..1a3fc43 100644
--- a/tools/releasetools/testdata/vintf/sku_incompat/SYSTEM/compatibility_matrix.xml
+++ b/tools/releasetools/testdata/vintf/sku_incompat/SYSTEM/etc/vintf/compatibility_matrix.1.xml
@@ -1,4 +1,4 @@
-<compatibility-matrix version="1.0" type="framework">
+<compatibility-matrix version="1.0" level="1" type="framework">
<hal format="hidl" optional="false">
<name>foo</name>
<version>1.1</version>