aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Android.mk1
-rw-r--r--core/Makefile74
-rw-r--r--core/OWNERS2
-rw-r--r--core/android_manifest.mk4
-rw-r--r--core/clear_vars.mk3
-rw-r--r--core/config.mk60
-rw-r--r--core/config_sanitizers.mk2
-rw-r--r--core/definitions.mk8
-rw-r--r--core/dex_preopt_libart_boot.mk4
-rw-r--r--core/dex_preopt_odex_install.mk12
-rw-r--r--core/java.mk2
-rw-r--r--core/java_common.mk8
-rw-r--r--core/java_renderscript.mk4
-rw-r--r--core/package_internal.mk51
-rw-r--r--core/prebuilt_internal.mk6
-rw-r--r--core/product_config.mk6
-rw-r--r--core/soong_config.mk1
-rw-r--r--core/static_java_library.mk2
-rw-r--r--envsetup.sh43
-rw-r--r--target/Android.mk23
-rw-r--r--target/board/BoardConfigEmuCommon.mk2
-rw-r--r--target/board/BoardConfigGsiCommon.mk11
-rw-r--r--target/board/generic_arm64_a/BoardConfig.mk2
-rw-r--r--target/board/generic_arm64_ab/BoardConfig.mk4
-rw-r--r--target/board/generic_arm_a/BoardConfig.mk5
-rw-r--r--target/board/generic_arm_ab/BoardConfig.mk7
-rw-r--r--target/board/generic_x86_64_a/BoardConfig.mk2
-rw-r--r--target/board/generic_x86_64_ab/BoardConfig.mk10
-rw-r--r--target/board/generic_x86_a/BoardConfig.mk5
-rw-r--r--target/board/generic_x86_ab/BoardConfig.mk13
-rw-r--r--target/board/treble_common.mk69
-rw-r--r--target/board/treble_common_32.mk17
-rw-r--r--target/board/treble_system.prop8
-rw-r--r--target/product/aosp_arm64_a.mk2
-rw-r--r--target/product/aosp_arm64_ab.mk2
-rw-r--r--target/product/aosp_arm_a.mk2
-rw-r--r--target/product/aosp_arm_ab.mk2
-rw-r--r--target/product/aosp_x86_64_a.mk2
-rw-r--r--target/product/aosp_x86_64_ab.mk2
-rw-r--r--target/product/aosp_x86_a.mk2
-rw-r--r--target/product/aosp_x86_ab.mk2
-rw-r--r--target/product/base_system.mk9
-rw-r--r--target/product/base_vendor.mk4
-rw-r--r--target/product/go_defaults_common.mk4
-rw-r--r--target/product/gsi/current.txt2
-rw-r--r--target/product/handheld_system.mk21
-rw-r--r--target/product/handheld_vendor.mk24
-rw-r--r--target/product/languages_default.mk105
-rw-r--r--target/product/languages_full.mk97
-rw-r--r--target/product/languages_small.mk24
-rw-r--r--target/product/mainline.mk (renamed from target/board/treble_common_64.mk)11
-rw-r--r--target/product/mainline_arm64.mk41
-rw-r--r--target/product/mainline_system.mk7
-rw-r--r--target/product/media_vendor.mk5
-rw-r--r--target/product/telephony_system.mk2
-rw-r--r--target/product/telephony_vendor.mk6
-rw-r--r--target/product/treble_common.mk2
-rw-r--r--tools/Android.mk23
-rwxr-xr-xtools/buildinfo.sh1
-rw-r--r--tools/droiddoc/Android.mk17
-rwxr-xr-xtools/releasetools/add_img_to_target_files.py5
-rw-r--r--tools/releasetools/blockimgdiff.py105
-rwxr-xr-xtools/releasetools/build_image.py4
-rwxr-xr-xtools/releasetools/build_super_image.py52
-rw-r--r--tools/releasetools/test_blockimgdiff.py6
-rw-r--r--tools/signapk/Android.bp6
-rw-r--r--tools/signapk/Android.mk26
67 files changed, 569 insertions, 527 deletions
diff --git a/Android.mk b/Android.mk
deleted file mode 100644
index 5053e7d64..000000000
--- a/Android.mk
+++ /dev/null
@@ -1 +0,0 @@
1include $(call all-subdir-makefiles)
diff --git a/core/Makefile b/core/Makefile
index 4eb04a6c8..f6a246bcb 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -122,6 +122,33 @@ ndk-docs: $(ndk_doxygen_out)/index.html
122endif 122endif
123 123
124# ----------------------------------------------------------------- 124# -----------------------------------------------------------------
125# generate preview API fingerprint
126api_fingerprint := $(call intermediates-dir-for,PACKAGING,api_fingerprint)/api_fingerprint.txt
127.KATI_READONLY := api_fingerprint
128
129ifeq (REL,$(PLATFORM_VERSION_CODENAME))
130 $(api_fingerprint):
131 echo REL >$@
132else ifneq ($(TARGET_BUILD_APPS),)
133 # TODO: use a prebuilt api_fingerprint.txt from prebuilts/sdk/current.txt once we have one
134 #$(eval $(call copy-one-file,prebuilts/sdk/current/api_fingerprint.txt,$(api_fingerprint)))
135 $(api_fingerprint):
136 echo $(PLATFORM_PREVIEW_SDK_VERSION) >$@
137else ifneq ($(TARGET_BUILD_PDK),)
138 $(eval $(call copy-one-file,$(_pdk_fusion_intermediates)/api_fingerprint.txt,$(api_fingerprint)))
139else
140 ifeq ($(HOST_OS),darwin)
141 $(api_fingerprint): PRIVATE_HASH := md5
142 else
143 $(api_fingerprint): PRIVATE_HASH := md5sum
144 endif
145 $(api_fingerprint): $(sort $(wildcard frameworks/base/api/*current.txt))
146 cat $^ | $(PRIVATE_HASH) | cut -d' ' -f1 >$@
147
148 $(call dist-for-goals,sdk,$(api_fingerprint))
149endif
150
151# -----------------------------------------------------------------
125# property_overrides_split_enabled 152# property_overrides_split_enabled
126property_overrides_split_enabled := 153property_overrides_split_enabled :=
127ifeq ($(BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED), true) 154ifeq ($(BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED), true)
@@ -368,7 +395,7 @@ system_prop_file := $(TARGET_SYSTEM_PROP)
368else 395else
369system_prop_file := $(wildcard $(TARGET_DEVICE_DIR)/system.prop) 396system_prop_file := $(wildcard $(TARGET_DEVICE_DIR)/system.prop)
370endif 397endif
371$(intermediate_system_build_prop): $(BUILDINFO_SH) $(BUILDINFO_COMMON_SH) $(INTERNAL_BUILD_ID_MAKEFILE) $(BUILD_SYSTEM)/version_defaults.mk $(system_prop_file) $(INSTALLED_ANDROID_INFO_TXT_TARGET) 398$(intermediate_system_build_prop): $(BUILDINFO_SH) $(BUILDINFO_COMMON_SH) $(INTERNAL_BUILD_ID_MAKEFILE) $(BUILD_SYSTEM)/version_defaults.mk $(system_prop_file) $(INSTALLED_ANDROID_INFO_TXT_TARGET) $(api_fingerprint)
372 @echo Target buildinfo: $@ 399 @echo Target buildinfo: $@
373 @mkdir -p $(dir $@) 400 @mkdir -p $(dir $@)
374 $(hide) echo > $@ 401 $(hide) echo > $@
@@ -401,6 +428,7 @@ endif
401 PLATFORM_BASE_OS="$(PLATFORM_BASE_OS)" \ 428 PLATFORM_BASE_OS="$(PLATFORM_BASE_OS)" \
402 PLATFORM_SDK_VERSION="$(PLATFORM_SDK_VERSION)" \ 429 PLATFORM_SDK_VERSION="$(PLATFORM_SDK_VERSION)" \
403 PLATFORM_PREVIEW_SDK_VERSION="$(PLATFORM_PREVIEW_SDK_VERSION)" \ 430 PLATFORM_PREVIEW_SDK_VERSION="$(PLATFORM_PREVIEW_SDK_VERSION)" \
431 PLATFORM_PREVIEW_SDK_FINGERPRINT="$$(cat $(api_fingerprint))" \
404 PLATFORM_VERSION_CODENAME="$(PLATFORM_VERSION_CODENAME)" \ 432 PLATFORM_VERSION_CODENAME="$(PLATFORM_VERSION_CODENAME)" \
405 PLATFORM_VERSION_ALL_CODENAMES="$(PLATFORM_VERSION_ALL_CODENAMES)" \ 433 PLATFORM_VERSION_ALL_CODENAMES="$(PLATFORM_VERSION_ALL_CODENAMES)" \
406 PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION="$(PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION)" \ 434 PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION="$(PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION)" \
@@ -1591,12 +1619,13 @@ $(RECOVERY_INSTALLING_TEXT_FILE): PRIVATE_RESOURCE_DIR := $(resource_dir)
1591$(RECOVERY_INSTALLING_TEXT_FILE): PRIVATE_IMAGE_GENERATOR_JAR := $(image_generator_jar) 1619$(RECOVERY_INSTALLING_TEXT_FILE): PRIVATE_IMAGE_GENERATOR_JAR := $(image_generator_jar)
1592$(RECOVERY_INSTALLING_TEXT_FILE): PRIVATE_ZOPFLIPNG := $(zopflipng) 1620$(RECOVERY_INSTALLING_TEXT_FILE): PRIVATE_ZOPFLIPNG := $(zopflipng)
1593$(RECOVERY_INSTALLING_TEXT_FILE): PRIVATE_RECOVERY_IMAGE_WIDTH := $(recovery_image_width) 1621$(RECOVERY_INSTALLING_TEXT_FILE): PRIVATE_RECOVERY_IMAGE_WIDTH := $(recovery_image_width)
1594$(RECOVERY_INSTALLING_TEXT_FILE): PRIVATE_RECOVERY_TEXT_LIST := \ 1622$(RECOVERY_INSTALLING_TEXT_FILE): PRIVATE_RECOVERY_BACKGROUND_TEXT_LIST := \
1595 recovery_installing \ 1623 recovery_installing \
1596 recovery_installing_security \ 1624 recovery_installing_security \
1597 recovery_erasing \ 1625 recovery_erasing \
1598 recovery_error \ 1626 recovery_error \
1599 recovery_no_command \ 1627 recovery_no_command
1628$(RECOVERY_INSTALLING_TEXT_FILE): PRIVATE_RECOVERY_WIPE_DATA_TEXT_LIST := \
1600 recovery_cancel_wipe_data \ 1629 recovery_cancel_wipe_data \
1601 recovery_factory_data_reset \ 1630 recovery_factory_data_reset \
1602 recovery_try_again \ 1631 recovery_try_again \
@@ -1608,17 +1637,17 @@ $(RECOVERY_INSTALLING_TEXT_FILE): $(image_generator_jar) $(resource_dir) $(recov
1608 @rm -rf $(PRIVATE_RECOVERY_FONT_FILES_DIR) 1637 @rm -rf $(PRIVATE_RECOVERY_FONT_FILES_DIR)
1609 @mkdir -p $(PRIVATE_RECOVERY_FONT_FILES_DIR) 1638 @mkdir -p $(PRIVATE_RECOVERY_FONT_FILES_DIR)
1610 $(foreach filename,$(PRIVATE_SOURCE_FONTS), cp $(filename) $(PRIVATE_RECOVERY_FONT_FILES_DIR) &&) true 1639 $(foreach filename,$(PRIVATE_SOURCE_FONTS), cp $(filename) $(PRIVATE_RECOVERY_FONT_FILES_DIR) &&) true
1611
1612 @rm -rf $(dir $@) 1640 @rm -rf $(dir $@)
1613 @mkdir -p $(dir $@) 1641 @mkdir -p $(dir $@)
1614 $(foreach text_name,$(PRIVATE_RECOVERY_TEXT_LIST), \ 1642 $(foreach text_name,$(PRIVATE_RECOVERY_BACKGROUND_TEXT_LIST) $(PRIVATE_RECOVERY_WIPE_DATA_TEXT_LIST), \
1615 $(eval output_file := $(dir $@)/$(patsubst recovery_%,%_text.png,$(text_name))) \ 1643 $(eval output_file := $(dir $@)/$(patsubst recovery_%,%_text.png,$(text_name))) \
1644 $(eval center_alignment := $(if $(filter $(text_name),$(PRIVATE_RECOVERY_BACKGROUND_TEXT_LIST)), --center_alignment)) \
1616 java -jar $(PRIVATE_IMAGE_GENERATOR_JAR) \ 1645 java -jar $(PRIVATE_IMAGE_GENERATOR_JAR) \
1617 --image_width $(PRIVATE_RECOVERY_IMAGE_WIDTH) \ 1646 --image_width $(PRIVATE_RECOVERY_IMAGE_WIDTH) \
1618 --text_name $(text_name) \ 1647 --text_name $(text_name) \
1619 --font_dir $(PRIVATE_RECOVERY_FONT_FILES_DIR) \ 1648 --font_dir $(PRIVATE_RECOVERY_FONT_FILES_DIR) \
1620 --resource_dir $(PRIVATE_RESOURCE_DIR) \ 1649 --resource_dir $(PRIVATE_RESOURCE_DIR) \
1621 --output_file $(output_file) && \ 1650 --output_file $(output_file) $(center_alignment) && \
1622 $(PRIVATE_ZOPFLIPNG) -y --iterations=1 --filters=0 $(output_file) $(output_file) > /dev/null &&) true 1651 $(PRIVATE_ZOPFLIPNG) -y --iterations=1 --filters=0 $(output_file) $(output_file) > /dev/null &&) true
1623else 1652else
1624RECOVERY_INSTALLING_TEXT_FILE := 1653RECOVERY_INSTALLING_TEXT_FILE :=
@@ -2199,7 +2228,7 @@ $(INSTALLED_PLATFORM_ZIP): PRIVATE_ODEX_CONFIG := $(pdk_odex_config_mk)
2199$(INSTALLED_PLATFORM_ZIP) : $(SOONG_ZIP) 2228$(INSTALLED_PLATFORM_ZIP) : $(SOONG_ZIP)
2200# dependencies for the other partitions are defined below after their file lists 2229# dependencies for the other partitions are defined below after their file lists
2201# are known 2230# are known
2202$(INSTALLED_PLATFORM_ZIP) : $(INTERNAL_SYSTEMIMAGE_FILES) $(pdk_classes_dex) $(pdk_odex_config_mk) 2231$(INSTALLED_PLATFORM_ZIP) : $(INTERNAL_SYSTEMIMAGE_FILES) $(pdk_classes_dex) $(pdk_odex_config_mk) $(api_fingerprint)
2203 $(call pretty,"Platform zip package: $(INSTALLED_PLATFORM_ZIP)") 2232 $(call pretty,"Platform zip package: $(INSTALLED_PLATFORM_ZIP)")
2204 rm -f $@ $@.lst 2233 rm -f $@ $@.lst
2205 echo "-C $(PRODUCT_OUT)" >> $@.lst 2234 echo "-C $(PRODUCT_OUT)" >> $@.lst
@@ -2232,6 +2261,7 @@ endif
2232 @# Add dex-preopt files and config. 2261 @# Add dex-preopt files and config.
2233 $(if $(PRIVATE_DEX_FILES),\ 2262 $(if $(PRIVATE_DEX_FILES),\
2234 echo "-C $(OUT_DIR) $(addprefix -f ,$(PRIVATE_DEX_FILES))") >> $@.lst 2263 echo "-C $(OUT_DIR) $(addprefix -f ,$(PRIVATE_DEX_FILES))") >> $@.lst
2264 echo "-C $(dir $(api_fingerprint)) -f $(api_fingerprint)" >> $@.lst
2235 touch $(PRODUCT_OUT)/pdk.mk 2265 touch $(PRODUCT_OUT)/pdk.mk
2236 echo "-C $(PRODUCT_OUT) -f $(PRIVATE_ODEX_CONFIG) -f $(PRODUCT_OUT)/pdk.mk" >> $@.lst 2266 echo "-C $(PRODUCT_OUT) -f $(PRIVATE_ODEX_CONFIG) -f $(PRODUCT_OUT)/pdk.mk" >> $@.lst
2237 $(SOONG_ZIP) --ignore_missing_files -o $@ @$@.lst 2267 $(SOONG_ZIP) --ignore_missing_files -o $@ @$@.lst
@@ -3253,7 +3283,9 @@ OTATOOLS += \
3253 $(HOST_LIBRARY_PATH)/libpcre2$(HOST_SHLIB_SUFFIX) \ 3283 $(HOST_LIBRARY_PATH)/libpcre2$(HOST_SHLIB_SUFFIX) \
3254 $(HOST_LIBRARY_PATH)/libbrotli$(HOST_SHLIB_SUFFIX) \ 3284 $(HOST_LIBRARY_PATH)/libbrotli$(HOST_SHLIB_SUFFIX) \
3255 $(HOST_LIBRARY_PATH)/liblp$(HOST_SHLIB_SUFFIX) \ 3285 $(HOST_LIBRARY_PATH)/liblp$(HOST_SHLIB_SUFFIX) \
3256 $(HOST_LIBRARY_PATH)/libext4_utils$(HOST_SHLIB_SUFFIX) 3286 $(HOST_LIBRARY_PATH)/libext4_utils$(HOST_SHLIB_SUFFIX) \
3287 $(HOST_LIBRARY_PATH)/libfec$(HOST_SHLIB_SUFFIX) \
3288 $(HOST_LIBRARY_PATH)/libsquashfs_utils$(HOST_SHLIB_SUFFIX)
3257 3289
3258 3290
3259.PHONY: otatools 3291.PHONY: otatools
@@ -3394,6 +3426,8 @@ define dump-dynamic-partitions-info
3394 echo "lpmake=$(notdir $(LPMAKE))" >> $(1) 3426 echo "lpmake=$(notdir $(LPMAKE))" >> $(1)
3395 $(if $(filter true,$(PRODUCT_BUILD_SUPER_PARTITION)), $(if $(BOARD_SUPER_PARTITION_SIZE), \ 3427 $(if $(filter true,$(PRODUCT_BUILD_SUPER_PARTITION)), $(if $(BOARD_SUPER_PARTITION_SIZE), \
3396 echo "build_super_partition=true" >> $(1))) 3428 echo "build_super_partition=true" >> $(1)))
3429 $(if $(filter true,$(BOARD_BUILD_RETROFIT_DYNAMIC_PARTITIONS_OTA_PACKAGE)), \
3430 echo "build_retrofit_dynamic_partitions_ota_package=true" >> $(1))
3397 echo "super_metadata_device=$(BOARD_SUPER_PARTITION_METADATA_DEVICE)" >> $(1) 3431 echo "super_metadata_device=$(BOARD_SUPER_PARTITION_METADATA_DEVICE)" >> $(1)
3398 $(if $(BOARD_SUPER_PARTITION_BLOCK_DEVICES), \ 3432 $(if $(BOARD_SUPER_PARTITION_BLOCK_DEVICES), \
3399 echo "super_block_devices=$(BOARD_SUPER_PARTITION_BLOCK_DEVICES)" >> $(1)) 3433 echo "super_block_devices=$(BOARD_SUPER_PARTITION_BLOCK_DEVICES)" >> $(1))
@@ -3779,12 +3813,16 @@ ifdef BUILT_VENDOR_MATRIX
3779endif 3813endif
3780ifneq ($(BOARD_SUPER_PARTITION_GROUPS),) 3814ifneq ($(BOARD_SUPER_PARTITION_GROUPS),)
3781 $(hide) echo "super_partition_groups=$(BOARD_SUPER_PARTITION_GROUPS)" > $(zip_root)/META/dynamic_partitions_info.txt 3815 $(hide) echo "super_partition_groups=$(BOARD_SUPER_PARTITION_GROUPS)" > $(zip_root)/META/dynamic_partitions_info.txt
3816 @# Remove 'vendor' from the group partition list if the image is not available. This should only
3817 @# happen to AOSP targets built without vendor.img. We can't remove the partition from the
3818 @# BoardConfig file, as it's still needed elsewhere (e.g. when creating super_empty.img).
3782 $(foreach group,$(BOARD_SUPER_PARTITION_GROUPS), \ 3819 $(foreach group,$(BOARD_SUPER_PARTITION_GROUPS), \
3820 $(eval _group_partition_list := $(BOARD_$(call to-upper,$(group))_PARTITION_LIST)) \
3821 $(if $(INSTALLED_VENDORIMAGE_TARGET),,$(eval _group_partition_list := $(filter-out vendor,$(_group_partition_list)))) \
3783 echo "$(group)_size=$(BOARD_$(call to-upper,$(group))_SIZE)" >> $(zip_root)/META/dynamic_partitions_info.txt; \ 3822 echo "$(group)_size=$(BOARD_$(call to-upper,$(group))_SIZE)" >> $(zip_root)/META/dynamic_partitions_info.txt; \
3784 $(if $(BOARD_$(call to-upper,$(group))_PARTITION_LIST), \ 3823 $(if $(_group_partition_list), \
3785 echo "$(group)_partition_list=$(BOARD_$(call to-upper,$(group))_PARTITION_LIST)" >> $(zip_root)/META/dynamic_partitions_info.txt;)) 3824 echo "$(group)_partition_list=$(_group_partition_list)" >> $(zip_root)/META/dynamic_partitions_info.txt;))
3786endif 3825endif # BOARD_SUPER_PARTITION_GROUPS
3787
3788 $(hide) PATH=$(foreach p,$(INTERNAL_USERIMAGES_BINARY_PATHS),$(p):)$$PATH MKBOOTIMG=$(MKBOOTIMG) \ 3826 $(hide) PATH=$(foreach p,$(INTERNAL_USERIMAGES_BINARY_PATHS),$(p):)$$PATH MKBOOTIMG=$(MKBOOTIMG) \
3789 build/make/tools/releasetools/add_img_to_target_files -a -v -p $(HOST_OUT) $(zip_root) 3827 build/make/tools/releasetools/add_img_to_target_files -a -v -p $(HOST_OUT) $(zip_root)
3790 @# Zip everything up, preserving symlinks and placing META/ files first to 3828 @# Zip everything up, preserving symlinks and placing META/ files first to
@@ -3850,7 +3888,7 @@ $(INTERNAL_OTA_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) \
3850.PHONY: otapackage 3888.PHONY: otapackage
3851otapackage: $(INTERNAL_OTA_PACKAGE_TARGET) 3889otapackage: $(INTERNAL_OTA_PACKAGE_TARGET)
3852 3890
3853ifeq ($(PRODUCT_RETROFIT_DYNAMIC_PARTITIONS),true) 3891ifeq ($(BOARD_BUILD_RETROFIT_DYNAMIC_PARTITIONS_OTA_PACKAGE),true)
3854name := $(TARGET_PRODUCT) 3892name := $(TARGET_PRODUCT)
3855ifeq ($(TARGET_BUILD_TYPE),debug) 3893ifeq ($(TARGET_BUILD_TYPE),debug)
3856 name := $(name)_debug 3894 name := $(name)_debug
@@ -3876,7 +3914,7 @@ $(INTERNAL_OTA_RETROFIT_DYNAMIC_PARTITIONS_PACKAGE_TARGET): $(BUILT_TARGET_FILES
3876 3914
3877otapackage otardppackage: $(INTERNAL_OTA_RETROFIT_DYNAMIC_PARTITIONS_PACKAGE_TARGET) 3915otapackage otardppackage: $(INTERNAL_OTA_RETROFIT_DYNAMIC_PARTITIONS_PACKAGE_TARGET)
3878 3916
3879endif # PRODUCT_RETROFIT_DYNAMIC_PARTITIONS 3917endif # BOARD_BUILD_RETROFIT_DYNAMIC_PARTITIONS_OTA_PACKAGE
3880 3918
3881endif # build_ota_package 3919endif # build_ota_package
3882 3920
@@ -4096,7 +4134,7 @@ $(INSTALLED_QEMU_SYSTEMIMAGE): $(INSTALLED_SYSTEMIMAGE_TARGET) $(MK_QEMU_IMAGE_S
4096 4134
4097systemimage: $(INSTALLED_QEMU_SYSTEMIMAGE) 4135systemimage: $(INSTALLED_QEMU_SYSTEMIMAGE)
4098droidcore: $(INSTALLED_QEMU_SYSTEMIMAGE) 4136droidcore: $(INSTALLED_QEMU_SYSTEMIMAGE)
4099ifeq ($(BOARD_USES_VENDORIMAGE),true) 4137ifdef INSTALLED_VENDORIMAGE_TARGET
4100INSTALLED_QEMU_VENDORIMAGE := $(PRODUCT_OUT)/vendor-qemu.img 4138INSTALLED_QEMU_VENDORIMAGE := $(PRODUCT_OUT)/vendor-qemu.img
4101$(INSTALLED_QEMU_VENDORIMAGE): $(INSTALLED_VENDORIMAGE_TARGET) $(MK_QEMU_IMAGE_SH) $(SGDISK_HOST) $(SIMG2IMG) 4139$(INSTALLED_QEMU_VENDORIMAGE): $(INSTALLED_VENDORIMAGE_TARGET) $(MK_QEMU_IMAGE_SH) $(SGDISK_HOST) $(SIMG2IMG)
4102 @echo Create vendor-qemu.img 4140 @echo Create vendor-qemu.img
@@ -4105,7 +4143,7 @@ $(INSTALLED_QEMU_VENDORIMAGE): $(INSTALLED_VENDORIMAGE_TARGET) $(MK_QEMU_IMAGE_S
4105vendorimage: $(INSTALLED_QEMU_VENDORIMAGE) 4143vendorimage: $(INSTALLED_QEMU_VENDORIMAGE)
4106droidcore: $(INSTALLED_QEMU_VENDORIMAGE) 4144droidcore: $(INSTALLED_QEMU_VENDORIMAGE)
4107endif 4145endif
4108ifeq ($(BOARD_USES_PRODUCTIMAGE),true) 4146ifdef INSTALLED_PRODUCTIMAGE_TARGET
4109INSTALLED_QEMU_PRODUCTIMAGE := $(PRODUCT_OUT)/product-qemu.img 4147INSTALLED_QEMU_PRODUCTIMAGE := $(PRODUCT_OUT)/product-qemu.img
4110$(INSTALLED_QEMU_PRODUCTIMAGE): $(INSTALLED_PRODUCTIMAGE_TARGET) $(MK_QEMU_IMAGE_SH) $(SGDISK_HOST) $(SIMG2IMG) 4148$(INSTALLED_QEMU_PRODUCTIMAGE): $(INSTALLED_PRODUCTIMAGE_TARGET) $(MK_QEMU_IMAGE_SH) $(SGDISK_HOST) $(SIMG2IMG)
4111 @echo Create product-qemu.img 4149 @echo Create product-qemu.img
@@ -4114,7 +4152,7 @@ $(INSTALLED_QEMU_PRODUCTIMAGE): $(INSTALLED_PRODUCTIMAGE_TARGET) $(MK_QEMU_IMAGE
4114productimage: $(INSTALLED_QEMU_PRODUCTIMAGE) 4152productimage: $(INSTALLED_QEMU_PRODUCTIMAGE)
4115droidcore: $(INSTALLED_QEMU_PRODUCTIMAGE) 4153droidcore: $(INSTALLED_QEMU_PRODUCTIMAGE)
4116endif 4154endif
4117ifeq ($(BOARD_USES_PRODUCT_SERVICESIMAGE),true) 4155ifdef INSTALLED_PRODUCT_SERVICESIMAGE_TARGET
4118INSTALLED_QEMU_PRODUCT_SERVICESIMAGE := $(PRODUCT_OUT)/product_services-qemu.img 4156INSTALLED_QEMU_PRODUCT_SERVICESIMAGE := $(PRODUCT_OUT)/product_services-qemu.img
4119$(INSTALLED_QEMU_PRODUCT_SERVICESIMAGE): $(INSTALLED_PRODUCT_SERVICESIMAGE_TARGET) $(MK_QEMU_IMAGE_SH) $(SGDISK_HOST) $(SIMG2IMG) 4157$(INSTALLED_QEMU_PRODUCT_SERVICESIMAGE): $(INSTALLED_PRODUCT_SERVICESIMAGE_TARGET) $(MK_QEMU_IMAGE_SH) $(SGDISK_HOST) $(SIMG2IMG)
4120 @echo Create product_services-qemu.img 4158 @echo Create product_services-qemu.img
@@ -4123,7 +4161,7 @@ $(INSTALLED_QEMU_PRODUCT_SERVICESIMAGE): $(INSTALLED_PRODUCT_SERVICESIMAGE_TARGE
4123productservicesimage: $(INSTALLED_QEMU_PRODUCT_SERVICESIMAGE) 4161productservicesimage: $(INSTALLED_QEMU_PRODUCT_SERVICESIMAGE)
4124droidcore: $(INSTALLED_QEMU_PRODUCT_SERVICESIMAGE) 4162droidcore: $(INSTALLED_QEMU_PRODUCT_SERVICESIMAGE)
4125endif 4163endif
4126ifeq ($(BOARD_USES_ODMIMAGE),true) 4164ifdef INSTALLED_ODMIMAGE_TARGET
4127INSTALLED_QEMU_ODMIMAGE := $(PRODUCT_OUT)/odm-qemu.img 4165INSTALLED_QEMU_ODMIMAGE := $(PRODUCT_OUT)/odm-qemu.img
4128$(INSTALLED_QEMU_ODMIMAGE): $(INSTALLED_ODMIMAGE_TARGET) $(MK_QEMU_IMAGE_SH) $(SGDISK_HOST) 4166$(INSTALLED_QEMU_ODMIMAGE): $(INSTALLED_ODMIMAGE_TARGET) $(MK_QEMU_IMAGE_SH) $(SGDISK_HOST)
4129 @echo Create odm-qemu.img 4167 @echo Create odm-qemu.img
diff --git a/core/OWNERS b/core/OWNERS
index 570ede8a4..750f1fa20 100644
--- a/core/OWNERS
+++ b/core/OWNERS
@@ -1 +1,3 @@
1per-file dex_preopt*.mk = ngeoffray@google.com,calin@google.com,mathewi@google.com,dbrazdil@google.com 1per-file dex_preopt*.mk = ngeoffray@google.com,calin@google.com,mathewi@google.com,dbrazdil@google.com
2per-file construct_context.sh = ngeoffray@google.com,calin@google.com,mathieuc@google.com
3per-file verify_uses_libraries.sh = ngeoffray@google.com,calin@google.com,mathieuc@google.com
diff --git a/core/android_manifest.mk b/core/android_manifest.mk
index c3af942f9..ed759c5ad 100644
--- a/core/android_manifest.mk
+++ b/core/android_manifest.mk
@@ -72,8 +72,8 @@ ifeq ($(LOCAL_PRIVATE_PLATFORM_APIS),true)
72 my_manifest_fixer_flags += --uses-non-sdk-api 72 my_manifest_fixer_flags += --uses-non-sdk-api
73endif 73endif
74 74
75ifeq (true,$(LOCAL_PREFER_INTEGRITY)) 75ifeq (true,$(LOCAL_PREFER_CODE_INTEGRITY))
76 my_manifest_fixer_flags += --prefer-integrity 76 my_manifest_fixer_flags += --prefer-code-integrity
77endif 77endif
78 78
79$(fixed_android_manifest): PRIVATE_MANIFEST_FIXER_FLAGS := $(my_manifest_fixer_flags) 79$(fixed_android_manifest): PRIVATE_MANIFEST_FIXER_FLAGS := $(my_manifest_fixer_flags)
diff --git a/core/clear_vars.mk b/core/clear_vars.mk
index 0fce502a6..b47071a23 100644
--- a/core/clear_vars.mk
+++ b/core/clear_vars.mk
@@ -51,7 +51,6 @@ LOCAL_CTS_TEST_PACKAGE:=
51LOCAL_CTS_TEST_RUNNER:= 51LOCAL_CTS_TEST_RUNNER:=
52LOCAL_CXX:= 52LOCAL_CXX:=
53LOCAL_CXX_STL := default 53LOCAL_CXX_STL := default
54LOCAL_DATA_BINDING:=
55LOCAL_DEX_PREOPT_APP_IMAGE:= 54LOCAL_DEX_PREOPT_APP_IMAGE:=
56LOCAL_DEX_PREOPT_FLAGS:= 55LOCAL_DEX_PREOPT_FLAGS:=
57LOCAL_DEX_PREOPT_GENERATE_PROFILE:= 56LOCAL_DEX_PREOPT_GENERATE_PROFILE:=
@@ -213,7 +212,7 @@ LOCAL_PREBUILT_MODULE_FILE:=
213LOCAL_PREBUILT_OBJ_FILES:= 212LOCAL_PREBUILT_OBJ_FILES:=
214LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES:= 213LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES:=
215LOCAL_PREBUILT_STRIP_COMMENTS:= 214LOCAL_PREBUILT_STRIP_COMMENTS:=
216LOCAL_PREFER_INTEGRITY:= 215LOCAL_PREFER_CODE_INTEGRITY:=
217LOCAL_PRESUBMIT_DISABLED:= 216LOCAL_PRESUBMIT_DISABLED:=
218LOCAL_PRIVATE_PLATFORM_APIS:= 217LOCAL_PRIVATE_PLATFORM_APIS:=
219LOCAL_PRIVILEGED_MODULE:= 218LOCAL_PRIVILEGED_MODULE:=
diff --git a/core/config.mk b/core/config.mk
index 9d77fe52b..c0a159dce 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -569,6 +569,13 @@ ALLOW_MISSING_DEPENDENCIES := true
569endif 569endif
570.KATI_READONLY := ALLOW_MISSING_DEPENDENCIES 570.KATI_READONLY := ALLOW_MISSING_DEPENDENCIES
571 571
572TARGET_BUILD_APPS_USE_PREBUILT_SDK :=
573ifdef TARGET_BUILD_APPS
574 ifndef UNBUNDLED_BUILD_SDKS_FROM_SOURCE
575 TARGET_BUILD_APPS_USE_PREBUILT_SDK := true
576 endif
577endif
578
572prebuilt_sdk_tools := prebuilts/sdk/tools 579prebuilt_sdk_tools := prebuilts/sdk/tools
573prebuilt_sdk_tools_bin := $(prebuilt_sdk_tools)/$(HOST_OS)/bin 580prebuilt_sdk_tools_bin := $(prebuilt_sdk_tools)/$(HOST_OS)/bin
574 581
@@ -680,7 +687,7 @@ AVBTOOL := $(HOST_OUT_EXECUTABLES)/avbtool$(HOST_EXECUTABLE_SUFFIX)
680else 687else
681AVBTOOL := $(BOARD_CUSTOM_AVBTOOL) 688AVBTOOL := $(BOARD_CUSTOM_AVBTOOL)
682endif 689endif
683APICHECK := $(HOST_OUT_EXECUTABLES)/apicheck$(HOST_EXECUTABLE_SUFFIX) 690APICHECK := $(HOST_OUT_JAVA_LIBRARIES)/metalava$(COMMON_JAVA_PACKAGE_SUFFIX)
684FS_GET_STATS := $(HOST_OUT_EXECUTABLES)/fs_get_stats$(HOST_EXECUTABLE_SUFFIX) 691FS_GET_STATS := $(HOST_OUT_EXECUTABLES)/fs_get_stats$(HOST_EXECUTABLE_SUFFIX)
685MAKE_EXT4FS := $(HOST_OUT_EXECUTABLES)/mke2fs$(HOST_EXECUTABLE_SUFFIX) 692MAKE_EXT4FS := $(HOST_OUT_EXECUTABLES)/mke2fs$(HOST_EXECUTABLE_SUFFIX)
686MKEXTUSERIMG := $(HOST_OUT_EXECUTABLES)/mkuserimg_mke2fs 693MKEXTUSERIMG := $(HOST_OUT_EXECUTABLES)/mkuserimg_mke2fs
@@ -748,13 +755,7 @@ else
748MD5SUM:=md5sum 755MD5SUM:=md5sum
749endif 756endif
750 757
751APICHECK_CLASSPATH_ENTRIES := \ 758APICHECK_COMMAND := $(JAVA) -Xmx4g -jar $(APICHECK) --no-banner --compatible-output=yes
752 $(HOST_OUT_JAVA_LIBRARIES)/apicheck$(COMMON_JAVA_PACKAGE_SUFFIX) \
753 $(HOST_JDK_TOOLS_JAR) \
754 )
755APICHECK_CLASSPATH := $(subst $(space),:,$(strip $(APICHECK_CLASSPATH_ENTRIES)))
756
757APICHECK_COMMAND := $(APICHECK) -JXmx1024m -J"classpath $(APICHECK_CLASSPATH)"
758 759
759# Boolean variable determining if the whitelist for compatible properties is enabled 760# Boolean variable determining if the whitelist for compatible properties is enabled
760PRODUCT_COMPATIBLE_PROPERTY := false 761PRODUCT_COMPATIBLE_PROPERTY := false
@@ -1057,31 +1058,52 @@ endif
1057# The metadata device must be supplied to init via the kernel command-line. 1058# The metadata device must be supplied to init via the kernel command-line.
1058BOARD_KERNEL_CMDLINE += androidboot.super_partition=$(BOARD_SUPER_PARTITION_METADATA_DEVICE) 1059BOARD_KERNEL_CMDLINE += androidboot.super_partition=$(BOARD_SUPER_PARTITION_METADATA_DEVICE)
1059 1060
1060else # PRODUCT_RETROFIT_DYNAMIC_PARTITIONS 1061BOARD_BUILD_RETROFIT_DYNAMIC_PARTITIONS_OTA_PACKAGE := true
1061 1062
1062# These should not be specified on devices launching with dynamic partition support. 1063# If "vendor" is listed as one of the dynamic partitions but without its image available (e.g. an
1063ifdef BOARD_SUPER_PARTITION_BLOCK_DEVICES 1064# AOSP target built without vendor image), don't build the retrofit full OTA package. Because we
1064$(error BOARD_SUPER_PARTITION_BLOCK_DEVICES can only be used if PRODUCT_RETROFIT_DYNAMIC_PARTITIONS is true.) 1065# won't be able to build meaningful super_* images for retrofitting purpose.
1065endif 1066ifneq (,$(filter vendor,$(BOARD_SUPER_PARTITION_PARTITION_LIST)))
1066ifdef BOARD_SUPER_PARTITION_METADATA_DEVICE 1067ifndef BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE
1067$(error BOARD_SUPER_PARTITION_METADATA_DEVICE can only be used if PRODUCT_RETROFIT_DYNAMIC_PARTITIONS is true.) 1068ifndef BOARD_PREBUILT_VENDORIMAGE
1068endif 1069BOARD_BUILD_RETROFIT_DYNAMIC_PARTITIONS_OTA_PACKAGE :=
1070endif # BOARD_PREBUILT_VENDORIMAGE
1071endif # BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE
1072endif # BOARD_SUPER_PARTITION_PARTITION_LIST
1073
1074else # PRODUCT_RETROFIT_DYNAMIC_PARTITIONS
1069 1075
1070# For normal devices, we populate BOARD_SUPER_PARTITION_BLOCK_DEVICES so the 1076# For normal devices, we populate BOARD_SUPER_PARTITION_BLOCK_DEVICES so the
1071# build can handle both cases consistently. 1077# build can handle both cases consistently.
1072BOARD_SUPER_PARTITION_BLOCK_DEVICES := super 1078ifeq ($(BOARD_SUPER_PARTITION_METADATA_DEVICE),)
1073BOARD_SUPER_PARTITION_METADATA_DEVICE := super 1079BOARD_SUPER_PARTITION_METADATA_DEVICE := super
1074BOARD_SUPER_PARTITION_SUPER_DEVICE_SIZE := $(BOARD_SUPER_PARTITION_SIZE) 1080endif
1081
1082ifeq ($(BOARD_SUPER_PARTITION_BLOCK_DEVICES),)
1083BOARD_SUPER_PARTITION_BLOCK_DEVICES := $(BOARD_SUPER_PARTITION_METADATA_DEVICE)
1084endif
1085
1086# If only one super block device, default to super partition size.
1087ifeq ($(word 2,$(BOARD_SUPER_PARTITION_BLOCK_DEVICES)),)
1088BOARD_SUPER_PARTITION_$(call to-upper,$(strip $(BOARD_SUPER_PARTITION_BLOCK_DEVICES)))_DEVICE_SIZE ?= \
1089 $(BOARD_SUPER_PARTITION_SIZE)
1090endif
1091
1092ifneq ($(BOARD_SUPER_PARTITION_METADATA_DEVICE),super)
1093BOARD_KERNEL_CMDLINE += androidboot.super_partition=$(BOARD_SUPER_PARTITION_METADATA_DEVICE)
1094endif
1095BOARD_BUILD_RETROFIT_DYNAMIC_PARTITIONS_OTA_PACKAGE :=
1075 1096
1076endif # PRODUCT_RETROFIT_DYNAMIC_PARTITIONS 1097endif # PRODUCT_RETROFIT_DYNAMIC_PARTITIONS
1077endif # BOARD_SUPER_PARTITION_SIZE 1098endif # BOARD_SUPER_PARTITION_SIZE
1078.KATI_READONLY := BOARD_SUPER_PARTITION_BLOCK_DEVICES 1099.KATI_READONLY := BOARD_SUPER_PARTITION_BLOCK_DEVICES
1079.KATI_READONLY := BOARD_SUPER_PARTITION_METADATA_DEVICE 1100.KATI_READONLY := BOARD_SUPER_PARTITION_METADATA_DEVICE
1101.KATI_READONLY := BOARD_BUILD_RETROFIT_DYNAMIC_PARTITIONS_OTA_PACKAGE
1080 1102
1081$(foreach device,$(call to-upper,$(BOARD_SUPER_PARTITION_BLOCK_DEVICES)), \ 1103$(foreach device,$(call to-upper,$(BOARD_SUPER_PARTITION_BLOCK_DEVICES)), \
1082 $(eval BOARD_SUPER_PARTITION_$(device)_DEVICE_SIZE := $(strip $(BOARD_SUPER_PARTITION_$(device)_DEVICE_SIZE))) \ 1104 $(eval BOARD_SUPER_PARTITION_$(device)_DEVICE_SIZE := $(strip $(BOARD_SUPER_PARTITION_$(device)_DEVICE_SIZE))) \
1083 $(if $(BOARD_SUPER_PARTITION_$(device)_DEVICE_SIZE),, \ 1105 $(if $(BOARD_SUPER_PARTITION_$(device)_DEVICE_SIZE),, \
1084 $(error $(BOARD_SUPER_PARTITION_$(device)_DEVICE_SIZE must not be empty))) \ 1106 $(error BOARD_SUPER_PARTITION_$(device)_DEVICE_SIZE must not be empty)) \
1085 $(eval .KATI_READONLY := BOARD_SUPER_PARTITION_$(device)_DEVICE_SIZE)) 1107 $(eval .KATI_READONLY := BOARD_SUPER_PARTITION_$(device)_DEVICE_SIZE))
1086 1108
1087endif # PRODUCT_BUILD_SUPER_PARTITION 1109endif # PRODUCT_BUILD_SUPER_PARTITION
diff --git a/core/config_sanitizers.mk b/core/config_sanitizers.mk
index 51b859ed8..6c9caa86c 100644
--- a/core/config_sanitizers.mk
+++ b/core/config_sanitizers.mk
@@ -337,7 +337,7 @@ ifneq ($(filter address,$(my_global_sanitize) $(my_sanitize)),)
337 my_ldflags += -Wl,--as-needed 337 my_ldflags += -Wl,--as-needed
338 endif 338 endif
339 339
340 ifeq ($(LOCAL_MODULE_CLASS),EXECUTABLES) 340 ifneq ($(filter EXECUTABLES NATIVE_TESTS,$(LOCAL_MODULE_CLASS)),)
341 ifneq ($(LOCAL_FORCE_STATIC_EXECUTABLE),true) 341 ifneq ($(LOCAL_FORCE_STATIC_EXECUTABLE),true)
342 my_linker := $($(LOCAL_2ND_ARCH_VAR_PREFIX)ADDRESS_SANITIZER_LINKER) 342 my_linker := $($(LOCAL_2ND_ARCH_VAR_PREFIX)ADDRESS_SANITIZER_LINKER)
343 # Make sure linker_asan get installed. 343 # Make sure linker_asan get installed.
diff --git a/core/definitions.mk b/core/definitions.mk
index 50c26d3b3..a67508018 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -2370,7 +2370,7 @@ endef
2370define run-appcompat 2370define run-appcompat
2371$(hide) \ 2371$(hide) \
2372 echo "appcompat.sh output:" >> $(PRODUCT_OUT)/appcompat/$(PRIVATE_MODULE).log && \ 2372 echo "appcompat.sh output:" >> $(PRODUCT_OUT)/appcompat/$(PRIVATE_MODULE).log && \
2373 PACKAGING=$(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING art/tools/veridex/appcompat.sh --dex-file=$@ 2>&1 >> $(PRODUCT_OUT)/appcompat/$(PRIVATE_MODULE).log 2373 PACKAGING=$(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING ANDROID_LOG_TAGS="*:e" art/tools/veridex/appcompat.sh --dex-file=$@ 2>&1 >> $(PRODUCT_OUT)/appcompat/$(PRIVATE_MODULE).log
2374endef 2374endef
2375appcompat-files = \ 2375appcompat-files = \
2376 art/tools/veridex/appcompat.sh \ 2376 art/tools/veridex/appcompat.sh \
@@ -2704,9 +2704,9 @@ $(3): $(1) $(CLASS2GREYLIST) $(INTERNAL_PLATFORM_HIDDENAPI_PUBLIC_LIST)
2704$(INTERNAL_PLATFORM_HIDDENAPI_FLAGS): $(2) 2704$(INTERNAL_PLATFORM_HIDDENAPI_FLAGS): $(2)
2705$(INTERNAL_PLATFORM_HIDDENAPI_FLAGS): PRIVATE_FLAGS_INPUTS := $$(PRIVATE_FLAGS_INPUTS) $(2) 2705$(INTERNAL_PLATFORM_HIDDENAPI_FLAGS): PRIVATE_FLAGS_INPUTS := $$(PRIVATE_FLAGS_INPUTS) $(2)
2706 2706
2707$(INTERNAL_PLATFORM_HIDDENAPI_GREYLIST_METADATA): $(5) 2707$(INTERNAL_PLATFORM_HIDDENAPI_GREYLIST_METADATA): $(3)
2708$(INTERNAL_PLATFORM_HIDDENAPI_GREYLIST_METADATA): \ 2708$(INTERNAL_PLATFORM_HIDDENAPI_GREYLIST_METADATA): \
2709 PRIVATE_METADATA_INPUTS := $$(PRIVATE_METADATA_INPUTS) $(5) 2709 PRIVATE_METADATA_INPUTS := $$(PRIVATE_METADATA_INPUTS) $(3)
2710 2710
2711endif 2711endif
2712endef 2712endef
@@ -2904,7 +2904,7 @@ endef
2904define check-api 2904define check-api
2905$(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/$(strip $(1))-timestamp: $(2) $(3) $(4) $(APICHECK) $(9) 2905$(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/$(strip $(1))-timestamp: $(2) $(3) $(4) $(APICHECK) $(9)
2906 @echo "Checking API:" $(1) 2906 @echo "Checking API:" $(1)
2907 $(hide) ( $(APICHECK_COMMAND) $(6) $(2) $(3) $(4) $(5) || ( $(7) ; exit 38 ) ) 2907 $(hide) ( $(APICHECK_COMMAND) --check-api-files $(6) $(2) $(3) $(4) $(5) || ( $(7) ; exit 38 ) )
2908 $(hide) mkdir -p $$(dir $$@) 2908 $(hide) mkdir -p $$(dir $$@)
2909 $(hide) touch $$@ 2909 $(hide) touch $$@
2910$(8): $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/$(strip $(1))-timestamp 2910$(8): $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/$(strip $(1))-timestamp
diff --git a/core/dex_preopt_libart_boot.mk b/core/dex_preopt_libart_boot.mk
index 156ce02f7..b31f5a847 100644
--- a/core/dex_preopt_libart_boot.mk
+++ b/core/dex_preopt_libart_boot.mk
@@ -90,11 +90,13 @@ $($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME) : $(LIBART_TARGE
90 @echo "target dex2oat: $@" 90 @echo "target dex2oat: $@"
91 @mkdir -p $(dir $@) 91 @mkdir -p $(dir $@)
92 @mkdir -p $(dir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)LIBART_TARGET_BOOT_OAT_UNSTRIPPED)) 92 @mkdir -p $(dir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)LIBART_TARGET_BOOT_OAT_UNSTRIPPED))
93 @rm -f $(dir $@)/*.art $(dir $@)/*.oat 93 @rm -f $(dir $@)/*.art $(dir $@)/*.oat $(dir $@)/*.invocation
94 @rm -f $(dir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)LIBART_TARGET_BOOT_OAT_UNSTRIPPED))/*.art 94 @rm -f $(dir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)LIBART_TARGET_BOOT_OAT_UNSTRIPPED))/*.art
95 @rm -f $(dir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)LIBART_TARGET_BOOT_OAT_UNSTRIPPED))/*.oat 95 @rm -f $(dir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)LIBART_TARGET_BOOT_OAT_UNSTRIPPED))/*.oat
96 @rm -f $(dir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)LIBART_TARGET_BOOT_OAT_UNSTRIPPED))/*.invocation
96 $(hide) $(DEX2OAT_BOOT_IMAGE_LOG_TAGS) $(DEX2OAT) --runtime-arg -Xms$(DEX2OAT_IMAGE_XMS) \ 97 $(hide) $(DEX2OAT_BOOT_IMAGE_LOG_TAGS) $(DEX2OAT) --runtime-arg -Xms$(DEX2OAT_IMAGE_XMS) \
97 --avoid-storing-invocation \ 98 --avoid-storing-invocation \
99 --write-invocation-to=$(patsubst %.art,%.invocation,$@) \
98 --runtime-arg -Xmx$(DEX2OAT_IMAGE_XMX) \ 100 --runtime-arg -Xmx$(DEX2OAT_IMAGE_XMX) \
99 $(PRIVATE_BOOT_IMAGE_FLAGS) \ 101 $(PRIVATE_BOOT_IMAGE_FLAGS) \
100 $(addprefix --dex-file=,$(LIBART_TARGET_BOOT_DEX_FILES)) \ 102 $(addprefix --dex-file=,$(LIBART_TARGET_BOOT_DEX_FILES)) \
diff --git a/core/dex_preopt_odex_install.mk b/core/dex_preopt_odex_install.mk
index 9f29c689d..17eeb8a11 100644
--- a/core/dex_preopt_odex_install.mk
+++ b/core/dex_preopt_odex_install.mk
@@ -3,7 +3,7 @@
3# Output variables: LOCAL_DEX_PREOPT, LOCAL_UNCOMPRESS_DEX, built_odex, 3# Output variables: LOCAL_DEX_PREOPT, LOCAL_UNCOMPRESS_DEX, built_odex,
4# dexpreopt_boot_jar_module 4# dexpreopt_boot_jar_module
5 5
6ifeq (true,$(LOCAL_PREFER_INTEGRITY)) 6ifeq (true,$(LOCAL_PREFER_CODE_INTEGRITY))
7 LOCAL_UNCOMPRESS_DEX := true 7 LOCAL_UNCOMPRESS_DEX := true
8else 8else
9 LOCAL_UNCOMPRESS_DEX := 9 LOCAL_UNCOMPRESS_DEX :=
@@ -181,7 +181,7 @@ ifdef LOCAL_DEX_PREOPT
181 $(call add_json_str, BuildPath, $(LOCAL_BUILT_MODULE)) 181 $(call add_json_str, BuildPath, $(LOCAL_BUILT_MODULE))
182 $(call add_json_str, DexPath, $$1) 182 $(call add_json_str, DexPath, $$1)
183 $(call add_json_str, ExtrasOutputPath, $$2) 183 $(call add_json_str, ExtrasOutputPath, $$2)
184 $(call add_json_bool, PreferIntegrity, $(filter true,$(LOCAL_PREFER_INTEGRITY))) 184 $(call add_json_bool, PreferCodeIntegrity, $(filter true,$(LOCAL_PREFER_CODE_INTEGRITY)))
185 $(call add_json_bool, Privileged, $(filter true,$(LOCAL_PRIVILEGED_MODULE))) 185 $(call add_json_bool, Privileged, $(filter true,$(LOCAL_PRIVILEGED_MODULE)))
186 $(call add_json_bool, UncompressedDex, $(filter true,$(LOCAL_UNCOMPRESS_DEX))) 186 $(call add_json_bool, UncompressedDex, $(filter true,$(LOCAL_UNCOMPRESS_DEX)))
187 $(call add_json_bool, HasApkLibraries, $(LOCAL_APK_LIBRARIES)) 187 $(call add_json_bool, HasApkLibraries, $(LOCAL_APK_LIBRARIES))
@@ -253,7 +253,13 @@ ifdef LOCAL_DEX_PREOPT
253 LOCAL_POST_INSTALL_CMD += && 253 LOCAL_POST_INSTALL_CMD += &&
254 endif 254 endif
255 255
256 LOCAL_POST_INSTALL_CMD += for i in $$(zipinfo -1 $(my_dexpreopt_zip)); do mkdir -p $(PRODUCT_OUT)/$$(dirname $$i); done && unzip -qo -d $(PRODUCT_OUT) $(my_dexpreopt_zip) 256 LOCAL_POST_INSTALL_CMD += \
257 for i in $$(zipinfo -1 $(my_dexpreopt_zip)); \
258 do mkdir -p $(PRODUCT_OUT)/$$(dirname $$i); \
259 done && \
260 ( unzip -qo -d $(PRODUCT_OUT) $(my_dexpreopt_zip) 2>&1 | grep -v "zipfile is empty"; exit $${PIPESTATUS[0]} ) || \
261 ( code=$$?; if [ $$code -ne 0 -a $$code -ne 1 ]; then exit $$code; fi )
262
257 $(LOCAL_INSTALLED_MODULE): PRIVATE_POST_INSTALL_CMD := $(LOCAL_POST_INSTALL_CMD) 263 $(LOCAL_INSTALLED_MODULE): PRIVATE_POST_INSTALL_CMD := $(LOCAL_POST_INSTALL_CMD)
258 $(LOCAL_INSTALLED_MODULE): $(my_dexpreopt_zip) 264 $(LOCAL_INSTALLED_MODULE): $(my_dexpreopt_zip)
259 265
diff --git a/core/java.mk b/core/java.mk
index 932a4212a..e564db251 100644
--- a/core/java.mk
+++ b/core/java.mk
@@ -109,7 +109,7 @@ ifneq ($(strip $(aidl_sources)),)
109 109
110aidl_preprocess_import := 110aidl_preprocess_import :=
111ifdef LOCAL_SDK_VERSION 111ifdef LOCAL_SDK_VERSION
112ifneq ($(filter current system_current test_current core_current, $(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS)),) 112ifneq ($(filter current system_current test_current core_current, $(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS_USE_PREBUILT_SDK)),)
113 # LOCAL_SDK_VERSION is current and no TARGET_BUILD_APPS 113 # LOCAL_SDK_VERSION is current and no TARGET_BUILD_APPS
114 aidl_preprocess_import := $(TARGET_OUT_COMMON_INTERMEDIATES)/framework.aidl 114 aidl_preprocess_import := $(TARGET_OUT_COMMON_INTERMEDIATES)/framework.aidl
115else 115else
diff --git a/core/java_common.mk b/core/java_common.mk
index f4c47c81a..ac26e5e44 100644
--- a/core/java_common.mk
+++ b/core/java_common.mk
@@ -29,7 +29,7 @@ ifeq (,$(LOCAL_JAVA_LANGUAGE_VERSION))
29 LOCAL_JAVA_LANGUAGE_VERSION := 1.7 29 LOCAL_JAVA_LANGUAGE_VERSION := 1.7
30 else ifneq (,$(filter $(LOCAL_SDK_VERSION), $(TARGET_SDK_VERSIONS_WITHOUT_JAVA_19_SUPPORT))) 30 else ifneq (,$(filter $(LOCAL_SDK_VERSION), $(TARGET_SDK_VERSIONS_WITHOUT_JAVA_19_SUPPORT)))
31 LOCAL_JAVA_LANGUAGE_VERSION := 1.8 31 LOCAL_JAVA_LANGUAGE_VERSION := 1.8
32 else ifneq (,$(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS)) 32 else ifneq (,$(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS_USE_PREBUILT_SDK))
33 # TODO(ccross): allow 1.9 for current and unbundled once we have SDK system modules 33 # TODO(ccross): allow 1.9 for current and unbundled once we have SDK system modules
34 LOCAL_JAVA_LANGUAGE_VERSION := 1.8 34 LOCAL_JAVA_LANGUAGE_VERSION := 1.8
35 else 35 else
@@ -276,7 +276,7 @@ ifndef LOCAL_IS_HOST_MODULE
276 my_system_modules := $(DEFAULT_SYSTEM_MODULES) 276 my_system_modules := $(DEFAULT_SYSTEM_MODULES)
277 endif # LOCAL_NO_STANDARD_LIBRARIES 277 endif # LOCAL_NO_STANDARD_LIBRARIES
278 278
279 ifneq (,$(TARGET_BUILD_APPS)) 279 ifneq (,$(TARGET_BUILD_APPS_USE_PREBUILT_SDK))
280 sdk_libs := $(foreach lib_name,$(LOCAL_SDK_LIBRARIES),$(call resolve-prebuilt-sdk-module,system_current,$(lib_name))) 280 sdk_libs := $(foreach lib_name,$(LOCAL_SDK_LIBRARIES),$(call resolve-prebuilt-sdk-module,system_current,$(lib_name)))
281 else 281 else
282 # When SDK libraries are referenced from modules built without SDK, provide the all APIs to them 282 # When SDK libraries are referenced from modules built without SDK, provide the all APIs to them
@@ -291,7 +291,7 @@ ifndef LOCAL_IS_HOST_MODULE
291 Choices are: $(TARGET_AVAILABLE_SDK_VERSIONS)) 291 Choices are: $(TARGET_AVAILABLE_SDK_VERSIONS))
292 endif 292 endif
293 293
294 ifneq (,$(TARGET_BUILD_APPS)$(filter-out %current,$(LOCAL_SDK_VERSION))) 294 ifneq (,$(TARGET_BUILD_APPS_USE_PREBUILT_SDK)$(filter-out %current,$(LOCAL_SDK_VERSION)))
295 # TARGET_BUILD_APPS mode or numbered SDK. Use prebuilt modules. 295 # TARGET_BUILD_APPS mode or numbered SDK. Use prebuilt modules.
296 sdk_module := $(call resolve-prebuilt-sdk-module,$(LOCAL_SDK_VERSION)) 296 sdk_module := $(call resolve-prebuilt-sdk-module,$(LOCAL_SDK_VERSION))
297 sdk_libs := $(foreach lib_name,$(LOCAL_SDK_LIBRARIES),$(call resolve-prebuilt-sdk-module,$(LOCAL_SDK_VERSION),$(lib_name))) 297 sdk_libs := $(foreach lib_name,$(LOCAL_SDK_LIBRARIES),$(call resolve-prebuilt-sdk-module,$(LOCAL_SDK_VERSION),$(lib_name)))
@@ -333,7 +333,7 @@ ifndef LOCAL_IS_HOST_MODULE
333 # related classes to be present. This change adds stubs needed for 333 # related classes to be present. This change adds stubs needed for
334 # javac to compile lambdas. 334 # javac to compile lambdas.
335 ifneq ($(LOCAL_NO_STANDARD_LIBRARIES),true) 335 ifneq ($(LOCAL_NO_STANDARD_LIBRARIES),true)
336 ifdef TARGET_BUILD_APPS 336 ifdef TARGET_BUILD_APPS_USE_PREBUILT_SDK
337 full_java_bootclasspath_libs += $(call java-lib-header-files,sdk-core-lambda-stubs) 337 full_java_bootclasspath_libs += $(call java-lib-header-files,sdk-core-lambda-stubs)
338 else 338 else
339 full_java_bootclasspath_libs += $(call java-lib-header-files,core-lambda-stubs) 339 full_java_bootclasspath_libs += $(call java-lib-header-files,core-lambda-stubs)
diff --git a/core/java_renderscript.mk b/core/java_renderscript.mk
index 406d679d4..13a6f8e66 100644
--- a/core/java_renderscript.mk
+++ b/core/java_renderscript.mk
@@ -82,8 +82,8 @@ $(rs_generated_src_jar): .KATI_IMPLICIT_OUTPUTS := $(rs_generated_res_zip)
82$(rs_generated_src_jar): $(renderscript_sources_fullpath) $(LOCAL_RENDERSCRIPT_CC) $(SOONG_ZIP) 82$(rs_generated_src_jar): $(renderscript_sources_fullpath) $(LOCAL_RENDERSCRIPT_CC) $(SOONG_ZIP)
83 $(transform-renderscripts-to-java-and-bc) 83 $(transform-renderscripts-to-java-and-bc)
84 84
85# include the dependency files (.d/.P) generated by llvm-rs-cc. 85# include the dependency files (.d) generated by llvm-rs-cc.
86$(call include-depfile,$(rs_generated_src_jar).P,$(rs_generated_src_jar)) 86$(call include-depfile,$(rs_generated_src_jar).d,$(rs_generated_src_jar))
87 87
88ifneq ($(LOCAL_RENDERSCRIPT_COMPATIBILITY),) 88ifneq ($(LOCAL_RENDERSCRIPT_COMPATIBILITY),)
89 89
diff --git a/core/package_internal.mk b/core/package_internal.mk
index 451fce7d9..698784263 100644
--- a/core/package_internal.mk
+++ b/core/package_internal.mk
@@ -309,23 +309,6 @@ endif # LOCAL_EMMA_INSTRUMENT
309 309
310rs_compatibility_jni_libs := 310rs_compatibility_jni_libs :=
311 311
312ifeq ($(LOCAL_DATA_BINDING),true)
313data_binding_intermediates := $(intermediates.COMMON)/data-binding
314
315LOCAL_JAVACFLAGS += -processorpath $(DATA_BINDING_COMPILER) -s $(data_binding_intermediates)/anno-src
316
317LOCAL_STATIC_JAVA_LIBRARIES += databinding-baselibrary
318LOCAL_STATIC_JAVA_AAR_LIBRARIES += databinding-library databinding-adapters
319
320data_binding_res_in := $(LOCAL_RESOURCE_DIR)
321data_binding_res_out := $(data_binding_intermediates)/res
322
323# Replace with the processed merged res dir.
324LOCAL_RESOURCE_DIR := $(data_binding_res_out)
325
326LOCAL_AAPT_FLAGS += --auto-add-overlay --extra-packages com.android.databinding.library
327endif # LOCAL_DATA_BINDING
328
329# If the module is a compressed module, we don't pre-opt it because its final 312# If the module is a compressed module, we don't pre-opt it because its final
330# installation location will be the data partition. 313# installation location will be the data partition.
331ifdef LOCAL_COMPRESSED_MODULE 314ifdef LOCAL_COMPRESSED_MODULE
@@ -460,34 +443,6 @@ endif
460$(LOCAL_INTERMEDIATE_TARGETS): \ 443$(LOCAL_INTERMEDIATE_TARGETS): \
461 PRIVATE_ANDROID_MANIFEST := $(full_android_manifest) 444 PRIVATE_ANDROID_MANIFEST := $(full_android_manifest)
462 445
463ifeq ($(LOCAL_DATA_BINDING),true)
464data_binding_stamp := $(data_binding_intermediates)/data-binding.stamp
465$(data_binding_stamp): PRIVATE_INTERMEDIATES := $(data_binding_intermediates)
466$(data_binding_stamp): PRIVATE_MANIFEST := $(full_android_manifest)
467# Generate code into $(LOCAL_INTERMEDIATE_SOURCE_DIR) so that the generated .java files
468# will be automatically picked up by function compile-java.
469$(data_binding_stamp): PRIVATE_SRC_OUT := $(LOCAL_INTERMEDIATE_SOURCE_DIR)/data-binding
470$(data_binding_stamp): PRIVATE_XML_OUT := $(data_binding_intermediates)/xml
471$(data_binding_stamp): PRIVATE_RES_OUT := $(data_binding_res_out)
472$(data_binding_stamp): PRIVATE_RES_IN := $(data_binding_res_in)
473$(data_binding_stamp): PRIVATE_ANNO_SRC_DIR := $(data_binding_intermediates)/anno-src
474
475$(data_binding_stamp) : $(all_res_assets) $(full_android_manifest) \
476 $(DATA_BINDING_COMPILER)
477 @echo "Data-binding process: $@"
478 @rm -rf $(PRIVATE_INTERMEDIATES) $(PRIVATE_SRC_OUT) && \
479 mkdir -p $(PRIVATE_INTERMEDIATES) $(PRIVATE_SRC_OUT) \
480 $(PRIVATE_XML_OUT) $(PRIVATE_RES_OUT) $(PRIVATE_ANNO_SRC_DIR)
481 $(hide) $(JAVA) -classpath $(DATA_BINDING_COMPILER) android.databinding.tool.MakeCopy \
482 $(PRIVATE_MANIFEST) $(PRIVATE_SRC_OUT) $(PRIVATE_XML_OUT) $(PRIVATE_RES_OUT) $(PRIVATE_RES_IN)
483 $(hide) touch $@
484
485# Make sure the data-binding process happens before javac and generation of R.java.
486$(R_file_stamp): $(data_binding_stamp)
487$(java_source_list_file): $(data_binding_stamp)
488$(full_classes_compiled_jar): $(data_binding_stamp)
489endif # LOCAL_DATA_BINDING
490
491framework_res_package_export := 446framework_res_package_export :=
492 447
493ifneq ($(LOCAL_NO_STANDARD_LIBRARIES),true) 448ifneq ($(LOCAL_NO_STANDARD_LIBRARIES),true)
@@ -496,7 +451,7 @@ ifneq ($(LOCAL_NO_STANDARD_LIBRARIES),true)
496# resources. 451# resources.
497ifeq ($(LOCAL_SDK_RES_VERSION),core_current) 452ifeq ($(LOCAL_SDK_RES_VERSION),core_current)
498# core_current doesn't contain any framework resources. 453# core_current doesn't contain any framework resources.
499else ifneq ($(filter-out current system_current test_current,$(LOCAL_SDK_RES_VERSION))$(if $(TARGET_BUILD_APPS),$(filter current system_current test_current,$(LOCAL_SDK_RES_VERSION))),) 454else ifneq ($(filter-out current system_current test_current,$(LOCAL_SDK_RES_VERSION))$(if $(TARGET_BUILD_APPS_USE_PREBUILT_SDK),$(filter current system_current test_current,$(LOCAL_SDK_RES_VERSION))),)
500# for released sdk versions, the platform resources were built into android.jar. 455# for released sdk versions, the platform resources were built into android.jar.
501framework_res_package_export := \ 456framework_res_package_export := \
502 $(call resolve-prebuilt-sdk-jar-path,$(LOCAL_SDK_RES_VERSION)) 457 $(call resolve-prebuilt-sdk-jar-path,$(LOCAL_SDK_RES_VERSION))
@@ -678,8 +633,8 @@ ifneq ($(BUILD_PLATFORM_ZIP),)
678 @# Keep a copy of apk with classes.dex unstripped 633 @# Keep a copy of apk with classes.dex unstripped
679 $(hide) cp -f $@ $(dir $@)package.dex.apk 634 $(hide) cp -f $@ $(dir $@)package.dex.apk
680endif # BUILD_PLATFORM_ZIP 635endif # BUILD_PLATFORM_ZIP
681 $(PRIVATE_STRIP_SCRIPT) $@ $@.tmp 636 mv -f $@ $@.tmp
682 mv -f $@.tmp $@ 637 $(PRIVATE_STRIP_SCRIPT) $@.tmp $@
683endif # LOCAL_DEX_PREOPT 638endif # LOCAL_DEX_PREOPT
684 $(sign-package) 639 $(sign-package)
685ifdef LOCAL_COMPRESSED_MODULE 640ifdef LOCAL_COMPRESSED_MODULE
diff --git a/core/prebuilt_internal.mk b/core/prebuilt_internal.mk
index 013497f12..66913c1ac 100644
--- a/core/prebuilt_internal.mk
+++ b/core/prebuilt_internal.mk
@@ -357,12 +357,14 @@ endif
357ifneq ($(BUILD_PLATFORM_ZIP),) 357ifneq ($(BUILD_PLATFORM_ZIP),)
358$(built_module) : .KATI_IMPLICIT_OUTPUTS := $(dir $(LOCAL_BUILT_MODULE))package.dex.apk 358$(built_module) : .KATI_IMPLICIT_OUTPUTS := $(dir $(LOCAL_BUILT_MODULE))package.dex.apk
359endif 359endif
360ifneq ($(LOCAL_CERTIFICATE),PRESIGNED)
360ifdef LOCAL_DEX_PREOPT 361ifdef LOCAL_DEX_PREOPT
361$(built_module) : PRIVATE_STRIP_SCRIPT := $(intermediates)/strip.sh 362$(built_module) : PRIVATE_STRIP_SCRIPT := $(intermediates)/strip.sh
362$(built_module) : $(intermediates)/strip.sh 363$(built_module) : $(intermediates)/strip.sh
363$(built_module) : | $(DEXPREOPT_GEN_DEPS) 364$(built_module) : | $(DEXPREOPT_GEN_DEPS)
364$(built_module) : .KATI_DEPFILE := $(built_module).d 365$(built_module) : .KATI_DEPFILE := $(built_module).d
365endif 366endif
367endif
366$(built_module) : $(my_prebuilt_src_file) | $(ZIPALIGN) $(ZIP2ZIP) $(SIGNAPK_JAR) 368$(built_module) : $(my_prebuilt_src_file) | $(ZIPALIGN) $(ZIP2ZIP) $(SIGNAPK_JAR)
367 $(transform-prebuilt-to-target) 369 $(transform-prebuilt-to-target)
368 $(uncompress-prebuilt-embedded-jni-libs) 370 $(uncompress-prebuilt-embedded-jni-libs)
@@ -387,8 +389,8 @@ endif
387 $(run-appcompat) 389 $(run-appcompat)
388endif # module_run_appcompat 390endif # module_run_appcompat
389ifdef LOCAL_DEX_PREOPT 391ifdef LOCAL_DEX_PREOPT
390 $(PRIVATE_STRIP_SCRIPT) $@ $@.tmp 392 mv -f $@ $@.tmp
391 mv -f $@.tmp $@ 393 $(PRIVATE_STRIP_SCRIPT) $@.tmp $@
392endif # LOCAL_DEX_PREOPT 394endif # LOCAL_DEX_PREOPT
393 $(sign-package) 395 $(sign-package)
394 # No need for align-package because sign-package takes care of alignment 396 # No need for align-package because sign-package takes care of alignment
diff --git a/core/product_config.mk b/core/product_config.mk
index ac7fe9108..f0f7da14e 100644
--- a/core/product_config.mk
+++ b/core/product_config.mk
@@ -175,15 +175,9 @@ include $(BUILD_SYSTEM)/node_fns.mk
175include $(BUILD_SYSTEM)/product.mk 175include $(BUILD_SYSTEM)/product.mk
176include $(BUILD_SYSTEM)/device.mk 176include $(BUILD_SYSTEM)/device.mk
177 177
178ifneq ($(strip $(TARGET_BUILD_APPS)),)
179# An unbundled app build needs only the core product makefiles.
180all_product_configs := $(call get-product-makefiles,\
181 $(SRC_TARGET_DIR)/product/AndroidProducts.mk)
182else
183# Read in all of the product definitions specified by the AndroidProducts.mk 178# Read in all of the product definitions specified by the AndroidProducts.mk
184# files in the tree. 179# files in the tree.
185all_product_configs := $(get-all-product-makefiles) 180all_product_configs := $(get-all-product-makefiles)
186endif
187 181
188all_named_products := 182all_named_products :=
189 183
diff --git a/core/soong_config.mk b/core/soong_config.mk
index 3dc6d9ae8..85be1e7a8 100644
--- a/core/soong_config.mk
+++ b/core/soong_config.mk
@@ -36,6 +36,7 @@ $(call add_json_csv, Platform_version_future_codenames, $(PLATFORM_VERSION_FUTU
36 36
37$(call add_json_bool, Allow_missing_dependencies, $(ALLOW_MISSING_DEPENDENCIES)) 37$(call add_json_bool, Allow_missing_dependencies, $(ALLOW_MISSING_DEPENDENCIES))
38$(call add_json_bool, Unbundled_build, $(TARGET_BUILD_APPS)) 38$(call add_json_bool, Unbundled_build, $(TARGET_BUILD_APPS))
39$(call add_json_bool, Unbundled_build_sdks_from_source, $(UNBUNDLED_BUILD_SDKS_FROM_SOURCE))
39$(call add_json_bool, Pdk, $(filter true,$(TARGET_BUILD_PDK))) 40$(call add_json_bool, Pdk, $(filter true,$(TARGET_BUILD_PDK)))
40 41
41$(call add_json_bool, Debuggable, $(filter userdebug eng,$(TARGET_BUILD_VARIANT))) 42$(call add_json_bool, Debuggable, $(filter userdebug eng,$(TARGET_BUILD_VARIANT)))
diff --git a/core/static_java_library.mk b/core/static_java_library.mk
index 2a8770503..cee7c9edf 100644
--- a/core/static_java_library.mk
+++ b/core/static_java_library.mk
@@ -110,7 +110,7 @@ endif
110framework_res_package_export := 110framework_res_package_export :=
111# Please refer to package.mk 111# Please refer to package.mk
112ifneq ($(LOCAL_NO_STANDARD_LIBRARIES),true) 112ifneq ($(LOCAL_NO_STANDARD_LIBRARIES),true)
113ifneq ($(filter-out current system_current test_current,$(LOCAL_SDK_RES_VERSION))$(if $(TARGET_BUILD_APPS),$(filter current system_current test_current,$(LOCAL_SDK_RES_VERSION))),) 113ifneq ($(filter-out current system_current test_current,$(LOCAL_SDK_RES_VERSION))$(if $(TARGET_BUILD_APPS_USE_PREBUILT_SDK),$(filter current system_current test_current,$(LOCAL_SDK_RES_VERSION))),)
114framework_res_package_export := \ 114framework_res_package_export := \
115 $(call resolve-prebuilt-sdk-jar-path,$(LOCAL_SDK_RES_VERSION)) 115 $(call resolve-prebuilt-sdk-jar-path,$(LOCAL_SDK_RES_VERSION))
116else 116else
diff --git a/envsetup.sh b/envsetup.sh
index 561083d38..62a64b605 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -266,7 +266,14 @@ function setpaths()
266 fi 266 fi
267 267
268 export PATH=$ANDROID_BUILD_PATHS$PATH 268 export PATH=$ANDROID_BUILD_PATHS$PATH
269 export PYTHONPATH=$T/development/python-packages:$PYTHONPATH 269
270 # out with the duplicate old
271 if [ -n $ANDROID_PYTHONPATH ]; then
272 export PYTHONPATH=${PYTHONPATH//$ANDROID_PYTHONPATH/}
273 fi
274 # and in with the new
275 export ANDROID_PYTHONPATH=$T/development/python-packages:
276 export PYTHONPATH=$ANDROID_PYTHONPATH$PYTHONPATH
270 277
271 export ANDROID_JAVA_HOME=$(get_abs_build_var ANDROID_JAVA_HOME) 278 export ANDROID_JAVA_HOME=$(get_abs_build_var ANDROID_JAVA_HOME)
272 export JAVA_HOME=$ANDROID_JAVA_HOME 279 export JAVA_HOME=$ANDROID_JAVA_HOME
@@ -765,6 +772,9 @@ function findmakefile()
765{ 772{
766 local TOPFILE=build/make/core/envsetup.mk 773 local TOPFILE=build/make/core/envsetup.mk
767 local HERE=$PWD 774 local HERE=$PWD
775 if [ "$1" ]; then
776 \cd $1
777 fi;
768 local T= 778 local T=
769 while [ \( ! \( -f $TOPFILE \) \) -a \( $PWD != "/" \) ]; do 779 while [ \( ! \( -f $TOPFILE \) \) -a \( $PWD != "/" \) ]; do
770 T=`PWD= /bin/pwd` 780 T=`PWD= /bin/pwd`
@@ -845,24 +855,29 @@ function mmm()
845 # Remove the leading ./ and trailing / if any exists. 855 # Remove the leading ./ and trailing / if any exists.
846 DIR=${DIR#./} 856 DIR=${DIR#./}
847 DIR=${DIR%/} 857 DIR=${DIR%/}
848 if [ -f $DIR/Android.mk -o -f $DIR/Android.bp ]; then 858 local M
849 local TO_CHOP=`(\cd -P -- $T && pwd -P) | wc -c | tr -d ' '` 859 if [ "$DIR_MODULES" = "" ]; then
850 local TO_CHOP=`expr $TO_CHOP + 1` 860 M=$(findmakefile $DIR)
851 local START=`PWD= /bin/pwd` 861 else
852 local MDIR=`echo $START | cut -c${TO_CHOP}-` 862 # Only check the target directory if a module is specified.
853 if [ "$MDIR" = "" ] ; then 863 if [ -f $DIR/Android.mk -o -f $DIR/Android.bp ]; then
854 MDIR=$DIR 864 local HERE=$PWD
855 else 865 cd $DIR
856 MDIR=$MDIR/$DIR 866 M=`PWD= /bin/pwd`
867 M=$M/Android.mk
868 cd $HERE
857 fi 869 fi
858 MDIR=${MDIR%/.} 870 fi
871 if [ "$M" ]; then
872 # Remove the path to top as the makefilepath needs to be relative
873 local M=`echo $M|sed 's:'$T'/::'`
859 if [ "$DIR_MODULES" = "" ]; then 874 if [ "$DIR_MODULES" = "" ]; then
860 MODULES_IN_PATHS="$MODULES_IN_PATHS MODULES-IN-$MDIR" 875 MODULES_IN_PATHS="$MODULES_IN_PATHS MODULES-IN-$(dirname ${M})"
861 GET_INSTALL_PATHS="$GET_INSTALL_PATHS GET-INSTALL-PATH-IN-$MDIR" 876 GET_INSTALL_PATHS="$GET_INSTALL_PATHS GET-INSTALL-PATH-IN-$(dirname ${M})"
862 else 877 else
863 MODULES="$MODULES $DIR_MODULES" 878 MODULES="$MODULES $DIR_MODULES"
864 fi 879 fi
865 MAKEFILE="$MAKEFILE $MDIR/Android.mk" 880 MAKEFILE="$MAKEFILE $M"
866 else 881 else
867 case $DIR in 882 case $DIR in
868 showcommands | snod | dist | *=*) ARGS="$ARGS $DIR";; 883 showcommands | snod | dist | *=*) ARGS="$ARGS $DIR";;
diff --git a/target/Android.mk b/target/Android.mk
deleted file mode 100644
index 9929b0096..000000000
--- a/target/Android.mk
+++ /dev/null
@@ -1,23 +0,0 @@
1#
2# Copyright (C) 2017 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17LOCAL_PATH := $(call my-dir)
18
19# Only if this Android.mk was included not by a symlink should it be used.
20# This facilitates the transition away from symlinks: b/64397960
21ifeq ($(LOCAL_PATH),build/make/target)
22include $(call first-makefiles-under,$(LOCAL_PATH))
23endif
diff --git a/target/board/BoardConfigEmuCommon.mk b/target/board/BoardConfigEmuCommon.mk
index 38f79fdcd..55cd546e1 100644
--- a/target/board/BoardConfigEmuCommon.mk
+++ b/target/board/BoardConfigEmuCommon.mk
@@ -20,8 +20,6 @@ BUILD_QEMU_IMAGES := true
20# the GLES renderer disables itself if host GL acceleration isn't available. 20# the GLES renderer disables itself if host GL acceleration isn't available.
21USE_OPENGL_RENDERER := true 21USE_OPENGL_RENDERER := true
22 22
23TARGET_COPY_OUT_VENDOR := vendor
24
25# ~100 MB vendor image. Please adjust system image / vendor image sizes 23# ~100 MB vendor image. Please adjust system image / vendor image sizes
26# when finalizing them. The partition size needs to be a multiple of image 24# when finalizing them. The partition size needs to be a multiple of image
27# block size: 4096. 25# block size: 4096.
diff --git a/target/board/BoardConfigGsiCommon.mk b/target/board/BoardConfigGsiCommon.mk
index 73af0201a..a853b3c69 100644
--- a/target/board/BoardConfigGsiCommon.mk
+++ b/target/board/BoardConfigGsiCommon.mk
@@ -6,6 +6,9 @@
6 6
7include build/make/target/board/BoardConfigMainlineCommon.mk 7include build/make/target/board/BoardConfigMainlineCommon.mk
8 8
9# Enable system property split for Treble
10BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true
11
9# This flag is set by mainline but isn't desired for GSI. 12# This flag is set by mainline but isn't desired for GSI.
10BOARD_USES_SYSTEM_OTHER_ODEX := 13BOARD_USES_SYSTEM_OTHER_ODEX :=
11 14
@@ -14,9 +17,17 @@ BOARD_USES_SYSTEM_OTHER_ODEX :=
14# we explicit specify this need below (even though it's the current default). 17# we explicit specify this need below (even though it's the current default).
15TARGET_USERIMAGES_SPARSE_EXT_DISABLED := false 18TARGET_USERIMAGES_SPARSE_EXT_DISABLED := false
16 19
20# system.img is always ext4 with sparse option
21# GSI also includes make_f2fs to support userdata parition in f2fs
22# for some devices
23TARGET_USERIMAGES_USE_F2FS := true
24
17# Enable dynamic system image size and reserved 64MB in it. 25# Enable dynamic system image size and reserved 64MB in it.
18BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE := 67108864 26BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE := 67108864
19 27
28# Generic AOSP image always requires separate vendor.img
29TARGET_COPY_OUT_VENDOR := vendor
30
20# Android Verified Boot (AVB): 31# Android Verified Boot (AVB):
21# Set AVB_VBMETA_IMAGE_FLAGS_VERIFICATION_DISABLED (--flag 2) in 32# Set AVB_VBMETA_IMAGE_FLAGS_VERIFICATION_DISABLED (--flag 2) in
22# vbmeta.img to disable AVB verification. 33# vbmeta.img to disable AVB verification.
diff --git a/target/board/generic_arm64_a/BoardConfig.mk b/target/board/generic_arm64_a/BoardConfig.mk
index 34a8ac001..f77dbe5f8 100644
--- a/target/board/generic_arm64_a/BoardConfig.mk
+++ b/target/board/generic_arm64_a/BoardConfig.mk
@@ -14,7 +14,7 @@
14# limitations under the License. 14# limitations under the License.
15# 15#
16 16
17include build/make/target/board/treble_common_64.mk 17include build/make/target/board/BoardConfigGsiCommon.mk
18 18
19TARGET_ARCH := arm64 19TARGET_ARCH := arm64
20TARGET_ARCH_VARIANT := armv8-a 20TARGET_ARCH_VARIANT := armv8-a
diff --git a/target/board/generic_arm64_ab/BoardConfig.mk b/target/board/generic_arm64_ab/BoardConfig.mk
index 88b90a8fb..073eccb9d 100644
--- a/target/board/generic_arm64_ab/BoardConfig.mk
+++ b/target/board/generic_arm64_ab/BoardConfig.mk
@@ -14,7 +14,7 @@
14# limitations under the License. 14# limitations under the License.
15# 15#
16 16
17include build/make/target/board/treble_common_64.mk 17include build/make/target/board/BoardConfigGsiCommon.mk
18 18
19TARGET_ARCH := arm64 19TARGET_ARCH := arm64
20TARGET_ARCH_VARIANT := armv8-a 20TARGET_ARCH_VARIANT := armv8-a
@@ -28,7 +28,7 @@ TARGET_2ND_CPU_ABI := armeabi-v7a
28TARGET_2ND_CPU_ABI2 := armeabi 28TARGET_2ND_CPU_ABI2 := armeabi
29TARGET_2ND_CPU_VARIANT := generic 29TARGET_2ND_CPU_VARIANT := generic
30 30
31# Enable A/B update 31# Enable System-as-Root
32TARGET_NO_RECOVERY := true 32TARGET_NO_RECOVERY := true
33BOARD_BUILD_SYSTEM_ROOT_IMAGE := true 33BOARD_BUILD_SYSTEM_ROOT_IMAGE := true
34 34
diff --git a/target/board/generic_arm_a/BoardConfig.mk b/target/board/generic_arm_a/BoardConfig.mk
index 57a5196a9..cba222a73 100644
--- a/target/board/generic_arm_a/BoardConfig.mk
+++ b/target/board/generic_arm_a/BoardConfig.mk
@@ -14,10 +14,13 @@
14# limitations under the License. 14# limitations under the License.
15# 15#
16 16
17include build/make/target/board/treble_common_32.mk 17include build/make/target/board/BoardConfigGsiCommon.mk
18 18
19TARGET_ARCH := arm 19TARGET_ARCH := arm
20TARGET_ARCH_VARIANT := armv7-a-neon 20TARGET_ARCH_VARIANT := armv7-a-neon
21TARGET_CPU_ABI := armeabi-v7a 21TARGET_CPU_ABI := armeabi-v7a
22TARGET_CPU_ABI2 := armeabi 22TARGET_CPU_ABI2 := armeabi
23TARGET_CPU_VARIANT := generic 23TARGET_CPU_VARIANT := generic
24
25# Legacy GSI keeps 32 bits binder for 32 bits CPU Arch
26TARGET_USES_64_BIT_BINDER := false
diff --git a/target/board/generic_arm_ab/BoardConfig.mk b/target/board/generic_arm_ab/BoardConfig.mk
index 3d1484290..087543e92 100644
--- a/target/board/generic_arm_ab/BoardConfig.mk
+++ b/target/board/generic_arm_ab/BoardConfig.mk
@@ -14,7 +14,7 @@
14# limitations under the License. 14# limitations under the License.
15# 15#
16 16
17include build/make/target/board/treble_common_32.mk 17include build/make/target/board/BoardConfigGsiCommon.mk
18 18
19TARGET_ARCH := arm 19TARGET_ARCH := arm
20TARGET_ARCH_VARIANT := armv7-a-neon 20TARGET_ARCH_VARIANT := armv7-a-neon
@@ -22,7 +22,10 @@ TARGET_CPU_ABI := armeabi-v7a
22TARGET_CPU_ABI2 := armeabi 22TARGET_CPU_ABI2 := armeabi
23TARGET_CPU_VARIANT := generic 23TARGET_CPU_VARIANT := generic
24 24
25# Enable A/B update 25# Legacy GSI keeps 32 bits binder for 32 bits CPU Arch
26TARGET_USES_64_BIT_BINDER := false
27
28# Enable System-as-Root
26TARGET_NO_RECOVERY := true 29TARGET_NO_RECOVERY := true
27BOARD_BUILD_SYSTEM_ROOT_IMAGE := true 30BOARD_BUILD_SYSTEM_ROOT_IMAGE := true
28 31
diff --git a/target/board/generic_x86_64_a/BoardConfig.mk b/target/board/generic_x86_64_a/BoardConfig.mk
index 2c0260439..1dd5e4898 100644
--- a/target/board/generic_x86_64_a/BoardConfig.mk
+++ b/target/board/generic_x86_64_a/BoardConfig.mk
@@ -14,7 +14,7 @@
14# limitations under the License. 14# limitations under the License.
15# 15#
16 16
17include build/make/target/board/treble_common_64.mk 17include build/make/target/board/BoardConfigGsiCommon.mk
18 18
19TARGET_CPU_ABI := x86_64 19TARGET_CPU_ABI := x86_64
20TARGET_ARCH := x86_64 20TARGET_ARCH := x86_64
diff --git a/target/board/generic_x86_64_ab/BoardConfig.mk b/target/board/generic_x86_64_ab/BoardConfig.mk
index a098dfe2a..09ce95d67 100644
--- a/target/board/generic_x86_64_ab/BoardConfig.mk
+++ b/target/board/generic_x86_64_ab/BoardConfig.mk
@@ -14,7 +14,7 @@
14# limitations under the License. 14# limitations under the License.
15# 15#
16 16
17include build/make/target/board/treble_common_64.mk 17include build/make/target/board/BoardConfigGsiCommon.mk
18 18
19TARGET_CPU_ABI := x86_64 19TARGET_CPU_ABI := x86_64
20TARGET_ARCH := x86_64 20TARGET_ARCH := x86_64
@@ -24,11 +24,11 @@ TARGET_2ND_CPU_ABI := x86
24TARGET_2ND_ARCH := x86 24TARGET_2ND_ARCH := x86
25TARGET_2ND_ARCH_VARIANT := x86_64 25TARGET_2ND_ARCH_VARIANT := x86_64
26 26
27# Enable System-as-Root
28TARGET_NO_RECOVERY := true
29BOARD_BUILD_SYSTEM_ROOT_IMAGE := true
30
27# Set this to create /cache mount point for non-A/B devices that mounts /cache. 31# Set this to create /cache mount point for non-A/B devices that mounts /cache.
28# The partition size doesn't matter, just to make build pass. 32# The partition size doesn't matter, just to make build pass.
29BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 33BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4
30BOARD_CACHEIMAGE_PARTITION_SIZE := 16777216 34BOARD_CACHEIMAGE_PARTITION_SIZE := 16777216
31
32# Enable A/B update
33TARGET_NO_RECOVERY := true
34BOARD_BUILD_SYSTEM_ROOT_IMAGE := true
diff --git a/target/board/generic_x86_a/BoardConfig.mk b/target/board/generic_x86_a/BoardConfig.mk
index 67cb07d7f..53acffd23 100644
--- a/target/board/generic_x86_a/BoardConfig.mk
+++ b/target/board/generic_x86_a/BoardConfig.mk
@@ -14,8 +14,11 @@
14# limitations under the License. 14# limitations under the License.
15# 15#
16 16
17include build/make/target/board/treble_common_32.mk 17include build/make/target/board/BoardConfigGsiCommon.mk
18 18
19TARGET_CPU_ABI := x86 19TARGET_CPU_ABI := x86
20TARGET_ARCH := x86 20TARGET_ARCH := x86
21TARGET_ARCH_VARIANT := x86 21TARGET_ARCH_VARIANT := x86
22
23# Legacy GSI keeps 32 bits binder for 32 bits CPU Arch
24TARGET_USES_64_BIT_BINDER := false
diff --git a/target/board/generic_x86_ab/BoardConfig.mk b/target/board/generic_x86_ab/BoardConfig.mk
index db4dacd96..cc8ab70ce 100644
--- a/target/board/generic_x86_ab/BoardConfig.mk
+++ b/target/board/generic_x86_ab/BoardConfig.mk
@@ -14,17 +14,20 @@
14# limitations under the License. 14# limitations under the License.
15# 15#
16 16
17include build/make/target/board/treble_common_32.mk 17include build/make/target/board/BoardConfigGsiCommon.mk
18 18
19TARGET_CPU_ABI := x86 19TARGET_CPU_ABI := x86
20TARGET_ARCH := x86 20TARGET_ARCH := x86
21TARGET_ARCH_VARIANT := x86 21TARGET_ARCH_VARIANT := x86
22 22
23# Legacy GSI keeps 32 bits binder for 32 bits CPU Arch
24TARGET_USES_64_BIT_BINDER := false
25
26# Enable System-as-Root
27TARGET_NO_RECOVERY := true
28BOARD_BUILD_SYSTEM_ROOT_IMAGE := true
29
23# Set this to create /cache mount point for non-A/B devices that mounts /cache. 30# Set this to create /cache mount point for non-A/B devices that mounts /cache.
24# The partition size doesn't matter, just to make build pass. 31# The partition size doesn't matter, just to make build pass.
25BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 32BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4
26BOARD_CACHEIMAGE_PARTITION_SIZE := 16777216 33BOARD_CACHEIMAGE_PARTITION_SIZE := 16777216
27
28# Enable A/B update
29TARGET_NO_RECOVERY := true
30BOARD_BUILD_SYSTEM_ROOT_IMAGE := true
diff --git a/target/board/treble_common.mk b/target/board/treble_common.mk
deleted file mode 100644
index eda5b3770..000000000
--- a/target/board/treble_common.mk
+++ /dev/null
@@ -1,69 +0,0 @@
1#
2# Copyright (C) 2017 The Android Open-Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17# Common boardconfig settings for generic AOSP products targetting mobile
18# (phone/table) devices.
19
20# VNDK
21BOARD_VNDK_VERSION := current
22
23# Properties
24TARGET_SYSTEM_PROP := build/make/target/board/treble_system.prop
25BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true
26
27# Bootloader, kernel and recovery are not part of generic AOSP image
28TARGET_NO_BOOTLOADER := true
29TARGET_NO_KERNEL := true
30
31# system.img is always ext4 with sparse option
32# GSI also includes make_f2fs to support userdata parition in f2fs
33# for some devices
34TARGET_USERIMAGES_USE_EXT4 := true
35TARGET_USERIMAGES_USE_F2FS := true
36TARGET_USERIMAGES_SPARSE_EXT_DISABLED := false
37
38# Enable dynamic system image size and reserved 64MB in it.
39BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE := 67108864
40
41# Generic AOSP image always requires separate vendor.img
42TARGET_COPY_OUT_VENDOR := vendor
43
44# Android generic system image always create metadata partition
45BOARD_USES_METADATA_PARTITION := true
46
47# Set emulator framebuffer display device buffer count to 3
48NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3
49
50# Audio
51USE_XML_AUDIO_POLICY_CONF := 1
52
53# Android Verified Boot (AVB):
54# 1) Sets BOARD_AVB_ENABLE to sign the GSI image.
55# 2) Sets AVB_VBMETA_IMAGE_FLAGS_VERIFICATION_DISABLED (--flag 2) in
56# vbmeta.img to disable AVB verification.
57#
58# To disable AVB for GSI, use the vbmeta.img and the GSI together.
59# To enable AVB for GSI, include the GSI public key into the device-specific
60# vbmeta.img.
61BOARD_AVB_ENABLE := true
62BOARD_AVB_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP)
63BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --flag 2
64
65# Enable chain partition for system.
66BOARD_AVB_SYSTEM_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem
67BOARD_AVB_SYSTEM_ALGORITHM := SHA256_RSA2048
68BOARD_AVB_SYSTEM_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP)
69BOARD_AVB_SYSTEM_ROLLBACK_INDEX_LOCATION := 1
diff --git a/target/board/treble_common_32.mk b/target/board/treble_common_32.mk
deleted file mode 100644
index b66c41eb0..000000000
--- a/target/board/treble_common_32.mk
+++ /dev/null
@@ -1,17 +0,0 @@
1#
2# Copyright (C) 2017 The Android Open-Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17include build/make/target/board/treble_common.mk
diff --git a/target/board/treble_system.prop b/target/board/treble_system.prop
deleted file mode 100644
index 0c04a9529..000000000
--- a/target/board/treble_system.prop
+++ /dev/null
@@ -1,8 +0,0 @@
1# GSI always generate dex pre-opt in system image
2ro.cp_system_other_odex=0
3
4# GSI always disables adb authentication
5ro.adb.secure=0
6
7# TODO(b/78105955): disable privapp_permissions checking before the bug solved
8ro.control_privapp_permissions=disable
diff --git a/target/product/aosp_arm64_a.mk b/target/product/aosp_arm64_a.mk
index 3c7af334d..b1c4b7dba 100644
--- a/target/product/aosp_arm64_a.mk
+++ b/target/product/aosp_arm64_a.mk
@@ -17,7 +17,7 @@
17# PRODUCT_PROPERTY_OVERRIDES cannot be used here because sysprops will be at 17# PRODUCT_PROPERTY_OVERRIDES cannot be used here because sysprops will be at
18# /vendor/[build|default].prop when build split is on. In order to have sysprops 18# /vendor/[build|default].prop when build split is on. In order to have sysprops
19# on the generic system image, place them in build/make/target/board/ 19# on the generic system image, place them in build/make/target/board/
20# treble_system.prop. 20# gsi_system.prop.
21 21
22include build/make/target/product/treble_common_64.mk 22include build/make/target/product/treble_common_64.mk
23 23
diff --git a/target/product/aosp_arm64_ab.mk b/target/product/aosp_arm64_ab.mk
index d389c74d0..92f50553a 100644
--- a/target/product/aosp_arm64_ab.mk
+++ b/target/product/aosp_arm64_ab.mk
@@ -17,7 +17,7 @@
17# PRODUCT_PROPERTY_OVERRIDES cannot be used here because sysprops will be at 17# PRODUCT_PROPERTY_OVERRIDES cannot be used here because sysprops will be at
18# /vendor/[build|default].prop when build split is on. In order to have sysprops 18# /vendor/[build|default].prop when build split is on. In order to have sysprops
19# on the generic system image, place them in build/make/target/board/ 19# on the generic system image, place them in build/make/target/board/
20# treble_system.prop. 20# gsi_system.prop.
21 21
22# aosp_arm64_ab-userdebug is a Legacy GSI for the devices with: 22# aosp_arm64_ab-userdebug is a Legacy GSI for the devices with:
23# - ARM 64 bits user space 23# - ARM 64 bits user space
diff --git a/target/product/aosp_arm_a.mk b/target/product/aosp_arm_a.mk
index 3060fa920..d89a326c9 100644
--- a/target/product/aosp_arm_a.mk
+++ b/target/product/aosp_arm_a.mk
@@ -17,7 +17,7 @@
17# PRODUCT_PROPERTY_OVERRIDES cannot be used here because sysprops will be at 17# PRODUCT_PROPERTY_OVERRIDES cannot be used here because sysprops will be at
18# /vendor/[build|default].prop when build split is on. In order to have sysprops 18# /vendor/[build|default].prop when build split is on. In order to have sysprops
19# on the generic system image, place them in build/make/target/board/ 19# on the generic system image, place them in build/make/target/board/
20# treble_system.prop. 20# gsi_system.prop.
21 21
22include build/make/target/product/treble_common_32.mk 22include build/make/target/product/treble_common_32.mk
23 23
diff --git a/target/product/aosp_arm_ab.mk b/target/product/aosp_arm_ab.mk
index 5845d3ba8..b35e51775 100644
--- a/target/product/aosp_arm_ab.mk
+++ b/target/product/aosp_arm_ab.mk
@@ -17,7 +17,7 @@
17# PRODUCT_PROPERTY_OVERRIDES cannot be used here because sysprops will be at 17# PRODUCT_PROPERTY_OVERRIDES cannot be used here because sysprops will be at
18# /vendor/[build|default].prop when build split is on. In order to have sysprops 18# /vendor/[build|default].prop when build split is on. In order to have sysprops
19# on the generic system image, place them in build/make/target/board/ 19# on the generic system image, place them in build/make/target/board/
20# treble_system.prop. 20# gsi_system.prop.
21 21
22# aosp_arm_ab-userdebug is a Legacy GSI for the devices with: 22# aosp_arm_ab-userdebug is a Legacy GSI for the devices with:
23# - ARM 32 bits user space 23# - ARM 32 bits user space
diff --git a/target/product/aosp_x86_64_a.mk b/target/product/aosp_x86_64_a.mk
index a7fb74097..6b6785a49 100644
--- a/target/product/aosp_x86_64_a.mk
+++ b/target/product/aosp_x86_64_a.mk
@@ -17,7 +17,7 @@
17# PRODUCT_PROPERTY_OVERRIDES cannot be used here because sysprops will be at 17# PRODUCT_PROPERTY_OVERRIDES cannot be used here because sysprops will be at
18# /vendor/[build|default].prop when build split is on. In order to have sysprops 18# /vendor/[build|default].prop when build split is on. In order to have sysprops
19# on the generic system image, place them in build/make/target/board/ 19# on the generic system image, place them in build/make/target/board/
20# treble_system.prop. 20# gsi_system.prop.
21 21
22include build/make/target/product/treble_common_64.mk 22include build/make/target/product/treble_common_64.mk
23 23
diff --git a/target/product/aosp_x86_64_ab.mk b/target/product/aosp_x86_64_ab.mk
index d9163d76b..35bf61a1f 100644
--- a/target/product/aosp_x86_64_ab.mk
+++ b/target/product/aosp_x86_64_ab.mk
@@ -17,7 +17,7 @@
17# PRODUCT_PROPERTY_OVERRIDES cannot be used here because sysprops will be at 17# PRODUCT_PROPERTY_OVERRIDES cannot be used here because sysprops will be at
18# /vendor/[build|default].prop when build split is on. In order to have sysprops 18# /vendor/[build|default].prop when build split is on. In order to have sysprops
19# on the generic system image, place them in build/make/target/board/ 19# on the generic system image, place them in build/make/target/board/
20# treble_system.prop. 20# gsi_system.prop.
21 21
22# aosp_x86_64_ab-userdebug is a Legacy GSI for the devices with: 22# aosp_x86_64_ab-userdebug is a Legacy GSI for the devices with:
23# - x86 64 bits user space 23# - x86 64 bits user space
diff --git a/target/product/aosp_x86_a.mk b/target/product/aosp_x86_a.mk
index 9ed29955e..99ed7e441 100644
--- a/target/product/aosp_x86_a.mk
+++ b/target/product/aosp_x86_a.mk
@@ -17,7 +17,7 @@
17# PRODUCT_PROPERTY_OVERRIDES cannot be used here because sysprops will be at 17# PRODUCT_PROPERTY_OVERRIDES cannot be used here because sysprops will be at
18# /vendor/[build|default].prop when build split is on. In order to have sysprops 18# /vendor/[build|default].prop when build split is on. In order to have sysprops
19# on the generic system image, place them in build/make/target/board/ 19# on the generic system image, place them in build/make/target/board/
20# treble_system.prop. 20# gsi_system.prop.
21 21
22include build/make/target/product/treble_common_32.mk 22include build/make/target/product/treble_common_32.mk
23 23
diff --git a/target/product/aosp_x86_ab.mk b/target/product/aosp_x86_ab.mk
index 4fff3d155..185e2f0a3 100644
--- a/target/product/aosp_x86_ab.mk
+++ b/target/product/aosp_x86_ab.mk
@@ -17,7 +17,7 @@
17# PRODUCT_PROPERTY_OVERRIDES cannot be used here because sysprops will be at 17# PRODUCT_PROPERTY_OVERRIDES cannot be used here because sysprops will be at
18# /vendor/[build|default].prop when build split is on. In order to have sysprops 18# /vendor/[build|default].prop when build split is on. In order to have sysprops
19# on the generic system image, place them in build/make/target/board/ 19# on the generic system image, place them in build/make/target/board/
20# treble_system.prop. 20# gsi_system.prop.
21 21
22# aosp_x86_ab-userdebug is a Legacy GSI for the devices with: 22# aosp_x86_ab-userdebug is a Legacy GSI for the devices with:
23# - x86 32 bits user space 23# - x86 32 bits user space
diff --git a/target/product/base_system.mk b/target/product/base_system.mk
index 428e2849f..07fea22f1 100644
--- a/target/product/base_system.mk
+++ b/target/product/base_system.mk
@@ -16,6 +16,7 @@
16 16
17# Base modules and settings for the system partition. 17# Base modules and settings for the system partition.
18PRODUCT_PACKAGES += \ 18PRODUCT_PACKAGES += \
19 abb \
19 adb \ 20 adb \
20 adbd \ 21 adbd \
21 am \ 22 am \
@@ -48,7 +49,6 @@ PRODUCT_PACKAGES += \
48 bu \ 49 bu \
49 bugreport \ 50 bugreport \
50 bugreportz \ 51 bugreportz \
51 cameraserver \
52 charger \ 52 charger \
53 cmd \ 53 cmd \
54 com.android.conscrypt \ 54 com.android.conscrypt \
@@ -82,7 +82,6 @@ PRODUCT_PACKAGES += \
82 heapprofd_client \ 82 heapprofd_client \
83 gatekeeperd \ 83 gatekeeperd \
84 gpuservice \ 84 gpuservice \
85 healthd \
86 hid \ 85 hid \
87 hwservicemanager \ 86 hwservicemanager \
88 idmap \ 87 idmap \
@@ -195,6 +194,7 @@ PRODUCT_PACKAGES += \
195 locksettings \ 194 locksettings \
196 logcat \ 195 logcat \
197 logd \ 196 logd \
197 lpdump \
198 lshal \ 198 lshal \
199 mdnsd \ 199 mdnsd \
200 media \ 200 media \
@@ -206,10 +206,12 @@ PRODUCT_PACKAGES += \
206 MediaProvider \ 206 MediaProvider \
207 mediaserver \ 207 mediaserver \
208 mke2fs \ 208 mke2fs \
209 ModuleMetadata \
209 monkey \ 210 monkey \
210 mtpd \ 211 mtpd \
211 ndc \ 212 ndc \
212 netd \ 213 netd \
214 NetworkStack \
213 org.apache.http.legacy \ 215 org.apache.http.legacy \
214 perfetto \ 216 perfetto \
215 ping \ 217 ping \
@@ -314,10 +316,7 @@ PRODUCT_SYSTEM_DEFAULT_PROPERTIES += debug.atrace.tags.enableflags=0
314# Packages included only for eng or userdebug builds, previously debug tagged 316# Packages included only for eng or userdebug builds, previously debug tagged
315PRODUCT_PACKAGES_DEBUG := \ 317PRODUCT_PACKAGES_DEBUG := \
316 adb_keys \ 318 adb_keys \
317 apex.test.key \
318 arping \ 319 arping \
319 com.android.apex.test_package.key \
320 com.android.apex.test_package.preinstall.key \
321 iotop \ 320 iotop \
322 iw \ 321 iw \
323 logpersist.start \ 322 logpersist.start \
diff --git a/target/product/base_vendor.mk b/target/product/base_vendor.mk
index 9bb45d158..1bb4beede 100644
--- a/target/product/base_vendor.mk
+++ b/target/product/base_vendor.mk
@@ -53,6 +53,10 @@ PRODUCT_PACKAGES += \
53 vndservice \ 53 vndservice \
54 vndservicemanager \ 54 vndservicemanager \
55 55
56# Base modules and settings for the product partition.
57PRODUCT_PACKAGES += \
58 healthd \
59
56# VINTF data for vendor image 60# VINTF data for vendor image
57PRODUCT_PACKAGES += \ 61PRODUCT_PACKAGES += \
58 device_manifest.xml \ 62 device_manifest.xml \
diff --git a/target/product/go_defaults_common.mk b/target/product/go_defaults_common.mk
index 18907c142..06bdec97e 100644
--- a/target/product/go_defaults_common.mk
+++ b/target/product/go_defaults_common.mk
@@ -61,6 +61,10 @@ PRODUCT_PROPERTY_OVERRIDES += dalvik.vm.heapsize=256m
61# Do not generate libartd. 61# Do not generate libartd.
62PRODUCT_ART_TARGET_INCLUDE_DEBUG_BUILD := false 62PRODUCT_ART_TARGET_INCLUDE_DEBUG_BUILD := false
63 63
64# Do not spin up a separate process for the network stack on go devices, use an in-process lib.
65PRODUCT_PACKAGES += NetworkStackLib
66PRODUCT_SYSTEM_SERVER_JARS += NetworkStackLib
67
64# Strip the local variable table and the local variable type table to reduce 68# Strip the local variable table and the local variable type table to reduce
65# the size of the system image. This has no bearing on stack traces, but will 69# the size of the system image. This has no bearing on stack traces, but will
66# leave less information available via JDWP. 70# leave less information available via JDWP.
diff --git a/target/product/gsi/current.txt b/target/product/gsi/current.txt
index 0b99000f3..17d2f1bd5 100644
--- a/target/product/gsi/current.txt
+++ b/target/product/gsi/current.txt
@@ -118,7 +118,9 @@ VNDK-core: android.hardware.neuralnetworks@1.1.so
118VNDK-core: android.hardware.neuralnetworks@1.2.so 118VNDK-core: android.hardware.neuralnetworks@1.2.so
119VNDK-core: android.hardware.nfc@1.0.so 119VNDK-core: android.hardware.nfc@1.0.so
120VNDK-core: android.hardware.nfc@1.1.so 120VNDK-core: android.hardware.nfc@1.1.so
121VNDK-core: android.hardware.nfc@1.2.so
121VNDK-core: android.hardware.oemlock@1.0.so 122VNDK-core: android.hardware.oemlock@1.0.so
123VNDK-core: android.hardware.power.stats@1.0.so
122VNDK-core: android.hardware.power@1.0.so 124VNDK-core: android.hardware.power@1.0.so
123VNDK-core: android.hardware.power@1.1.so 125VNDK-core: android.hardware.power@1.1.so
124VNDK-core: android.hardware.power@1.2.so 126VNDK-core: android.hardware.power@1.2.so
diff --git a/target/product/handheld_system.mk b/target/product/handheld_system.mk
index a961d1e8b..acafe802d 100644
--- a/target/product/handheld_system.mk
+++ b/target/product/handheld_system.mk
@@ -36,52 +36,34 @@ PRODUCT_PACKAGES += \
36 Bluetooth \ 36 Bluetooth \
37 BluetoothMidiService \ 37 BluetoothMidiService \
38 BookmarkProvider \ 38 BookmarkProvider \
39 Browser2 \
40 BuiltInPrintService \ 39 BuiltInPrintService \
41 Calendar \
42 CalendarProvider \ 40 CalendarProvider \
43 Camera2 \ 41 cameraserver \
44 CaptivePortalLogin \ 42 CaptivePortalLogin \
45 CertInstaller \ 43 CertInstaller \
46 clatd \ 44 clatd \
47 clatd.conf \ 45 clatd.conf \
48 Contacts \
49 DeskClock \
50 DocumentsUI \ 46 DocumentsUI \
51 DownloadProviderUi \ 47 DownloadProviderUi \
52 EasterEgg \ 48 EasterEgg \
53 Email \
54 ExactCalculator \ 49 ExactCalculator \
55 ExternalStorageProvider \ 50 ExternalStorageProvider \
56 FusedLocation \ 51 FusedLocation \
57 Gallery2 \
58 Home \
59 InputDevices \ 52 InputDevices \
60 KeyChain \ 53 KeyChain \
61 LatinIME \
62 Launcher3QuickStep \
63 librs_jni \ 54 librs_jni \
64 ManagedProvisioning \ 55 ManagedProvisioning \
65 MmsService \ 56 MmsService \
66 MtpDocumentsProvider \ 57 MtpDocumentsProvider \
67 Music \
68 MusicFX \ 58 MusicFX \
69 NfcNci \ 59 NfcNci \
70 OneTimeInitializer \
71 PacProcessor \ 60 PacProcessor \
72 PrintRecommendationService \
73 PrintSpooler \ 61 PrintSpooler \
74 Provision \
75 ProxyHandler \ 62 ProxyHandler \
76 QuickSearchBox \
77 screenrecord \ 63 screenrecord \
78 SecureElement \ 64 SecureElement \
79 Settings \
80 SettingsIntelligence \
81 SharedStorageBackup \ 65 SharedStorageBackup \
82 SimAppDialog \ 66 SimAppDialog \
83 StorageManager \
84 SystemUI \
85 Telecom \ 67 Telecom \
86 TelephonyProvider \ 68 TelephonyProvider \
87 TeleService \ 69 TeleService \
@@ -89,7 +71,6 @@ PRODUCT_PACKAGES += \
89 UserDictionaryProvider \ 71 UserDictionaryProvider \
90 VpnDialogs \ 72 VpnDialogs \
91 vr \ 73 vr \
92 WallpaperCropper \
93 74
94 75
95PRODUCT_SYSTEM_SERVER_APPS += \ 76PRODUCT_SYSTEM_SERVER_APPS += \
diff --git a/target/product/handheld_vendor.mk b/target/product/handheld_vendor.mk
index 0f7387559..b9970e9dd 100644
--- a/target/product/handheld_vendor.mk
+++ b/target/product/handheld_vendor.mk
@@ -19,6 +19,8 @@
19# it definitely doesn't belong on other types of devices (if it 19# it definitely doesn't belong on other types of devices (if it
20# does, use base_vendor.mk). 20# does, use base_vendor.mk).
21$(call inherit-product, $(SRC_TARGET_DIR)/product/media_vendor.mk) 21$(call inherit-product, $(SRC_TARGET_DIR)/product/media_vendor.mk)
22
23# /vendor packages
22PRODUCT_PACKAGES += \ 24PRODUCT_PACKAGES += \
23 audio.primary.default \ 25 audio.primary.default \
24 DisplayCutoutEmulationCornerOverlay \ 26 DisplayCutoutEmulationCornerOverlay \
@@ -28,3 +30,25 @@ PRODUCT_PACKAGES += \
28 power.default \ 30 power.default \
29 SysuiDarkThemeOverlay \ 31 SysuiDarkThemeOverlay \
30 vibrator.default \ 32 vibrator.default \
33
34# /product packages
35PRODUCT_PACKAGES += \
36 Browser2 \
37 Calendar \
38 Camera2 \
39 Contacts \
40 DeskClock \
41 Email \
42 Gallery2 \
43 LatinIME \
44 Launcher3QuickStep \
45 Music \
46 OneTimeInitializer \
47 PrintRecommendationService \
48 Provision \
49 QuickSearchBox \
50 Settings \
51 SettingsIntelligence \
52 StorageManager \
53 SystemUI \
54 WallpaperCropper \
diff --git a/target/product/languages_default.mk b/target/product/languages_default.mk
new file mode 100644
index 000000000..a13a23c56
--- /dev/null
+++ b/target/product/languages_default.mk
@@ -0,0 +1,105 @@
1#
2# Copyright (C) 2009 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17# This is a build configuration that just contains a list of languages, with
18# en_US set as the default language.
19PRODUCT_LOCALES := \
20 en_US \
21 af_ZA \
22 am_ET \
23 ar_EG \
24 ar_XB \
25 as_IN \
26 az_AZ \
27 be_BY \
28 bg_BG \
29 bn_BD \
30 bs_BA \
31 ca_ES \
32 cs_CZ \
33 da_DK \
34 de_DE \
35 el_GR \
36 en_AU \
37 en_CA \
38 en_GB \
39 en_IN \
40 en_XA \
41 es_ES \
42 es_US \
43 et_EE \
44 eu_ES \
45 fa_IR \
46 fi_FI \
47 fr_CA \
48 fr_FR \
49 gl_ES \
50 gu_IN \
51 hi_IN \
52 hr_HR \
53 hu_HU \
54 hy_AM \
55 in_ID \
56 is_IS \
57 it_IT \
58 iw_IL \
59 ja_JP \
60 ka_GE \
61 kk_KZ \
62 km_KH \
63 kn_IN \
64 ko_KR \
65 ky_KG \
66 lo_LA \
67 lt_LT \
68 lv_LV \
69 mk_MK \
70 ml_IN \
71 mn_MN \
72 mr_IN \
73 ms_MY \
74 my_MM \
75 nb_NO \
76 ne_NP \
77 nl_NL \
78 or_IN \
79 pa_IN \
80 pl_PL \
81 pt_BR \
82 pt_PT \
83 ro_RO \
84 ru_RU \
85 si_LK \
86 sk_SK \
87 sl_SI \
88 sq_AL \
89 sr_Latn_RS \
90 sr_RS \
91 sv_SE \
92 sw_TZ \
93 ta_IN \
94 te_IN \
95 th_TH \
96 tl_PH \
97 tr_TR \
98 uk_UA \
99 ur_PK \
100 uz_UZ \
101 vi_VN \
102 zh_CN \
103 zh_HK \
104 zh_TW \
105 zu_ZA \
diff --git a/target/product/languages_full.mk b/target/product/languages_full.mk
index 5f3795f21..43a40a7e9 100644
--- a/target/product/languages_full.mk
+++ b/target/product/languages_full.mk
@@ -14,94 +14,9 @@
14# limitations under the License. 14# limitations under the License.
15# 15#
16 16
17# This is a build configuration that just contains a list of languages. 17# This is a build configuration that contains the default list of languages,
18# 18# as well as the en_XC pseudo-locale, which is useful for localization test
19# These are all the locales that have translations. 19# builds.
20PRODUCT_LOCALES := \ 20
21 en_US \ 21$(call inherit-product, $(SRC_TARGET_DIR)/product/languages_default.mk)
22 af_ZA \ 22PRODUCT_LOCALES += en_XC
23 am_ET \
24 ar_EG \
25 ar_XB \
26 as_IN \
27 az_AZ \
28 be_BY \
29 bg_BG \
30 bn_BD \
31 bs_BA \
32 ca_ES \
33 cs_CZ \
34 da_DK \
35 de_DE \
36 el_GR \
37 en_AU \
38 en_CA \
39 en_GB \
40 en_IN \
41 en_XA \
42 en_XC \
43 es_ES \
44 es_US \
45 et_EE \
46 eu_ES \
47 fa_IR \
48 fi_FI \
49 fr_CA \
50 fr_FR \
51 gl_ES \
52 gu_IN \
53 hi_IN \
54 hr_HR \
55 hu_HU \
56 hy_AM \
57 in_ID \
58 is_IS \
59 it_IT \
60 iw_IL \
61 ja_JP \
62 ka_GE \
63 kk_KZ \
64 km_KH \
65 kn_IN \
66 ko_KR \
67 ky_KG \
68 lo_LA \
69 lt_LT \
70 lv_LV \
71 mk_MK \
72 ml_IN \
73 mn_MN \
74 mr_IN \
75 ms_MY \
76 my_MM \
77 nb_NO \
78 ne_NP \
79 nl_NL \
80 or_IN \
81 pa_IN \
82 pl_PL \
83 pt_BR \
84 pt_PT \
85 ro_RO \
86 ru_RU \
87 si_LK \
88 sk_SK \
89 sl_SI \
90 sq_AL \
91 sr_Latn_RS \
92 sr_RS \
93 sv_SE \
94 sw_TZ \
95 ta_IN \
96 te_IN \
97 th_TH \
98 tl_PH \
99 tr_TR \
100 uk_UA \
101 ur_PK \
102 uz_UZ \
103 vi_VN \
104 zh_CN \
105 zh_HK \
106 zh_TW \
107 zu_ZA
diff --git a/target/product/languages_small.mk b/target/product/languages_small.mk
deleted file mode 100644
index d695ca8da..000000000
--- a/target/product/languages_small.mk
+++ /dev/null
@@ -1,24 +0,0 @@
1#
2# Copyright (C) 2009 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17# This is a build configuration that just contains a list of languages.
18# It helps in situations where laugnages must come first in the list,
19# mostly because screen densities interfere with the list of locales and
20# the system misbehaves when a density is the first locale.
21
22# This is the list of languages that originally shipped on ADP1
23
24PRODUCT_LOCALES := en_US en_GB fr_FR it_IT de_DE es_ES
diff --git a/target/board/treble_common_64.mk b/target/product/mainline.mk
index 8980dfde1..44dcd6083 100644
--- a/target/board/treble_common_64.mk
+++ b/target/product/mainline.mk
@@ -1,5 +1,5 @@
1# 1#
2# Copyright (C) 2017 The Android Open-Source Project 2# Copyright (C) 2019 The Android Open Source Project
3# 3#
4# Licensed under the Apache License, Version 2.0 (the "License"); 4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License. 5# you may not use this file except in compliance with the License.
@@ -14,7 +14,8 @@
14# limitations under the License. 14# limitations under the License.
15# 15#
16 16
17include build/make/target/board/treble_common.mk 17# Makefile including the mainline system image, and the relevant AOSP portions
18 18# for the other partitions.
19# Enable 64-bits binder 19$(call inherit-product, $(SRC_TARGET_DIR)/product/mainline_system.mk)
20TARGET_USES_64_BIT_BINDER := true 20$(call inherit-product, $(SRC_TARGET_DIR)/product/handheld_vendor.mk)
21$(call inherit-product, $(SRC_TARGET_DIR)/product/telephony_vendor.mk)
diff --git a/target/product/mainline_arm64.mk b/target/product/mainline_arm64.mk
index f93d7e412..6122ac1d9 100644
--- a/target/product/mainline_arm64.mk
+++ b/target/product/mainline_arm64.mk
@@ -15,9 +15,7 @@
15# 15#
16 16
17$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) 17$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
18$(call inherit-product, $(SRC_TARGET_DIR)/product/mainline_system.mk) 18$(call inherit-product, $(SRC_TARGET_DIR)/product/mainline.mk)
19$(call inherit-product, $(SRC_TARGET_DIR)/product/handheld_vendor.mk)
20$(call inherit-product, $(SRC_TARGET_DIR)/product/telephony_vendor.mk)
21 19
22PRODUCT_NAME := mainline_arm64 20PRODUCT_NAME := mainline_arm64
23PRODUCT_DEVICE := generic_arm64 21PRODUCT_DEVICE := generic_arm64
@@ -32,3 +30,40 @@ PRODUCT_ARTIFACT_PATH_REQUIREMENT_WHITELIST += \
32 root/init.zygote64_32.rc \ 30 root/init.zygote64_32.rc \
33 system/etc/seccomp_policy/crash_dump.arm.policy \ 31 system/etc/seccomp_policy/crash_dump.arm.policy \
34 system/etc/seccomp_policy/mediacodec.policy \ 32 system/etc/seccomp_policy/mediacodec.policy \
33
34# Modules that are to be moved to /product
35PRODUCT_ARTIFACT_PATH_REQUIREMENT_WHITELIST += \
36 system/app/Browser2/Browser2.apk \
37 system/app/Calendar/Calendar.apk \
38 system/app/Camera2/Camera2.apk \
39 system/app/DeskClock/DeskClock.apk \
40 system/app/Email/Email.apk \
41 system/app/Gallery2/Gallery2.apk \
42 system/app/LatinIME/LatinIME.apk \
43 system/app/LatinIME/oat/arm64/LatinIME.odex \
44 system/app/LatinIME/oat/arm64/LatinIME.vdex \
45 system/app/Music/Music.apk \
46 system/app/PrintRecommendationService/PrintRecommendationService.apk \
47 system/app/QuickSearchBox/QuickSearchBox.apk \
48 system/bin/healthd \
49 system/etc/init/healthd.rc \
50 system/etc/vintf/manifest/manifest_healthd.xml \
51 system/lib64/libjni_eglfence.so \
52 system/lib64/libjni_filtershow_filters.so \
53 system/lib64/libjni_jpegstream.so \
54 system/lib64/libjni_jpegutil.so \
55 system/lib64/libjni_latinime.so \
56 system/lib64/libjni_tinyplanet.so \
57 system/priv-app/CarrierConfig/CarrierConfig.apk \
58 system/priv-app/Contacts/Contacts.apk \
59 system/priv-app/Dialer/Dialer.apk \
60 system/priv-app/Launcher3QuickStep/Launcher3QuickStep.apk \
61 system/priv-app/OneTimeInitializer/OneTimeInitializer.apk \
62 system/priv-app/Provision/Provision.apk \
63 system/priv-app/Settings/Settings.apk \
64 system/priv-app/SettingsIntelligence/SettingsIntelligence.apk \
65 system/priv-app/StorageManager/StorageManager.apk \
66 system/priv-app/SystemUI/SystemUI.apk \
67 system/priv-app/SystemUI/oat/arm64/SystemUI.odex \
68 system/priv-app/SystemUI/oat/arm64/SystemUI.vdex \
69 system/priv-app/WallpaperCropper/WallpaperCropper.apk \
diff --git a/target/product/mainline_system.mk b/target/product/mainline_system.mk
index c41e1d7c6..b9b422f24 100644
--- a/target/product/mainline_system.mk
+++ b/target/product/mainline_system.mk
@@ -17,6 +17,9 @@
17# This makefile is the basis of a generic system image for a handheld device. 17# This makefile is the basis of a generic system image for a handheld device.
18$(call inherit-product, $(SRC_TARGET_DIR)/product/handheld_system.mk) 18$(call inherit-product, $(SRC_TARGET_DIR)/product/handheld_system.mk)
19$(call inherit-product, $(SRC_TARGET_DIR)/product/telephony_system.mk) 19$(call inherit-product, $(SRC_TARGET_DIR)/product/telephony_system.mk)
20$(call inherit-product, $(SRC_TARGET_DIR)/product/languages_default.mk)
21# Add adb keys to debuggable AOSP builds (if they exist)
22$(call inherit-product-if-exists, vendor/google/security/adb/vendor_key.mk)
20 23
21# Shared java libs 24# Shared java libs
22PRODUCT_PACKAGES += \ 25PRODUCT_PACKAGES += \
@@ -31,6 +34,7 @@ PRODUCT_PACKAGES += \
31 RcsService \ 34 RcsService \
32 SafetyRegulatoryInfo \ 35 SafetyRegulatoryInfo \
33 Stk \ 36 Stk \
37 Tag \
34 TimeZoneUpdater \ 38 TimeZoneUpdater \
35 39
36# Binaries 40# Binaries
@@ -71,6 +75,7 @@ PRODUCT_PACKAGES += \
71 android.hardware.radio.deprecated@1.0 \ 75 android.hardware.radio.deprecated@1.0 \
72 android.hardware.secure_element@1.0 \ 76 android.hardware.secure_element@1.0 \
73 android.hardware.tests.libhwbinder@1.0-impl \ 77 android.hardware.tests.libhwbinder@1.0-impl \
78 android.hardware.wifi@1.0 \
74 android.hidl.base@1.0 \ 79 android.hidl.base@1.0 \
75 libaudio-resampler \ 80 libaudio-resampler \
76 liblogwrap \ 81 liblogwrap \
@@ -97,8 +102,6 @@ PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
97# Enable dynamic partition size 102# Enable dynamic partition size
98PRODUCT_USE_DYNAMIC_PARTITION_SIZE := true 103PRODUCT_USE_DYNAMIC_PARTITION_SIZE := true
99 104
100PRODUCT_LOCALES := en_US af_ZA am_ET ar_EG as_IN az_AZ be_BY bg_BG bn_BD bs_BA ca_ES cs_CZ da_DK de_DE el_GR en_AU en_CA en_GB en_IN es_ES es_US et_EE eu_ES fa_IR fi_FI fr_CA fr_FR gl_ES gu_IN hi_IN hr_HR hu_HU hy_AM in_ID is_IS it_IT iw_IL ja_JP ka_GE kk_KZ km_KH ko_KR ky_KG lo_LA lt_LT lv_LV km_MH kn_IN mn_MN ml_IN mk_MK mr_IN ms_MY my_MM ne_NP nb_NO nl_NL or_IN pa_IN pl_PL pt_BR pt_PT ro_RO ru_RU si_LK sk_SK sl_SI sq_AL sr_Latn_RS sr_RS sv_SE sw_TZ ta_IN te_IN th_TH tl_PH tr_TR uk_UA ur_PK uz_UZ vi_VN zh_CN zh_HK zh_TW zu_ZA en_XA ar_XB
101
102PRODUCT_NAME := mainline_system 105PRODUCT_NAME := mainline_system
103PRODUCT_BRAND := generic 106PRODUCT_BRAND := generic
104 107
diff --git a/target/product/media_vendor.mk b/target/product/media_vendor.mk
index 1db0b587e..f30e6f361 100644
--- a/target/product/media_vendor.mk
+++ b/target/product/media_vendor.mk
@@ -20,6 +20,11 @@
20# base_vendor.mk. 20# base_vendor.mk.
21$(call inherit-product, $(SRC_TARGET_DIR)/product/base_vendor.mk) 21$(call inherit-product, $(SRC_TARGET_DIR)/product/base_vendor.mk)
22 22
23# /vendor packages
23PRODUCT_PACKAGES += \ 24PRODUCT_PACKAGES += \
24 libaudiopreprocessing \ 25 libaudiopreprocessing \
25 libwebrtc_audio_preprocessing \ 26 libwebrtc_audio_preprocessing \
27
28# /product packages
29PRODUCT_PACKAGES += \
30 webview \
diff --git a/target/product/telephony_system.mk b/target/product/telephony_system.mk
index 0b1e8a2a6..e30f0364f 100644
--- a/target/product/telephony_system.mk
+++ b/target/product/telephony_system.mk
@@ -19,9 +19,7 @@
19 19
20PRODUCT_PACKAGES := \ 20PRODUCT_PACKAGES := \
21 ANS \ 21 ANS \
22 CarrierConfig \
23 CarrierDefaultApp \ 22 CarrierDefaultApp \
24 Dialer \
25 CallLogBackup \ 23 CallLogBackup \
26 CellBroadcastReceiver \ 24 CellBroadcastReceiver \
27 EmergencyInfo \ 25 EmergencyInfo \
diff --git a/target/product/telephony_vendor.mk b/target/product/telephony_vendor.mk
index bddd3834e..4cff16dc8 100644
--- a/target/product/telephony_vendor.mk
+++ b/target/product/telephony_vendor.mk
@@ -17,7 +17,13 @@
17# This is the list of modules that are specific to products that have telephony 17# This is the list of modules that are specific to products that have telephony
18# hardware, and install outside the system partition. 18# hardware, and install outside the system partition.
19 19
20# /vendor packages
20PRODUCT_PACKAGES := \ 21PRODUCT_PACKAGES := \
21 rild \ 22 rild \
22 23
24# /product packages
25PRODUCT_PACKAGES += \
26 CarrierConfig \
27 Dialer \
28
23PRODUCT_COPY_FILES := \ 29PRODUCT_COPY_FILES := \
diff --git a/target/product/treble_common.mk b/target/product/treble_common.mk
index 040802843..7642876af 100644
--- a/target/product/treble_common.mk
+++ b/target/product/treble_common.mk
@@ -38,7 +38,7 @@ PRODUCT_PACKAGES += \
38# Telephony: 38# Telephony:
39# Provide a default APN configuration 39# Provide a default APN configuration
40PRODUCT_COPY_FILES += \ 40PRODUCT_COPY_FILES += \
41 device/generic/goldfish/data/etc/apns-conf.xml:system/etc/apns-conf.xml 41 device/sample/etc/apns-full-conf.xml:system/etc/apns-conf.xml
42 42
43# NFC: 43# NFC:
44# Provide default libnfc-nci.conf file for devices that does not have one in 44# Provide default libnfc-nci.conf file for devices that does not have one in
diff --git a/tools/Android.mk b/tools/Android.mk
deleted file mode 100644
index c05d68155..000000000
--- a/tools/Android.mk
+++ /dev/null
@@ -1,23 +0,0 @@
1#
2# Copyright (C) 2010 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17LOCAL_PATH := $(call my-dir)
18
19# Only if this Android.mk was included not by a symlink should it be used.
20# This facilitates the transition away from symlinks: b/64397960
21ifeq ($(LOCAL_PATH),build/make/tools)
22include $(call all-makefiles-under,$(LOCAL_PATH))
23endif
diff --git a/tools/buildinfo.sh b/tools/buildinfo.sh
index c2e6f8528..b76c08954 100755
--- a/tools/buildinfo.sh
+++ b/tools/buildinfo.sh
@@ -8,6 +8,7 @@ echo "ro.build.display.id=$BUILD_DISPLAY_ID"
8echo "ro.build.version.incremental=$BUILD_NUMBER" 8echo "ro.build.version.incremental=$BUILD_NUMBER"
9echo "ro.build.version.sdk=$PLATFORM_SDK_VERSION" 9echo "ro.build.version.sdk=$PLATFORM_SDK_VERSION"
10echo "ro.build.version.preview_sdk=$PLATFORM_PREVIEW_SDK_VERSION" 10echo "ro.build.version.preview_sdk=$PLATFORM_PREVIEW_SDK_VERSION"
11echo "ro.build.version.preview_sdk_fingerprint=$PLATFORM_PREVIEW_SDK_FINGERPRINT"
11echo "ro.build.version.codename=$PLATFORM_VERSION_CODENAME" 12echo "ro.build.version.codename=$PLATFORM_VERSION_CODENAME"
12echo "ro.build.version.all_codenames=$PLATFORM_VERSION_ALL_CODENAMES" 13echo "ro.build.version.all_codenames=$PLATFORM_VERSION_ALL_CODENAMES"
13echo "ro.build.version.release=$PLATFORM_VERSION" 14echo "ro.build.version.release=$PLATFORM_VERSION"
diff --git a/tools/droiddoc/Android.mk b/tools/droiddoc/Android.mk
deleted file mode 100644
index ff08edc10..000000000
--- a/tools/droiddoc/Android.mk
+++ /dev/null
@@ -1,17 +0,0 @@
1# Copyright (C) 2008 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15LOCAL_PATH := $(call my-dir)
16
17# Droiddoc is now Doclava -- See external/doclava.
diff --git a/tools/releasetools/add_img_to_target_files.py b/tools/releasetools/add_img_to_target_files.py
index 1872a5812..da5ea4aa1 100755
--- a/tools/releasetools/add_img_to_target_files.py
+++ b/tools/releasetools/add_img_to_target_files.py
@@ -859,11 +859,12 @@ def AddImagesToTargetFiles(filename):
859 banner("vbmeta") 859 banner("vbmeta")
860 AddVBMeta(output_zip, partitions, "vbmeta", vbmeta_partitions) 860 AddVBMeta(output_zip, partitions, "vbmeta", vbmeta_partitions)
861 861
862 if OPTIONS.info_dict.get("build_super_partition"): 862 if OPTIONS.info_dict.get("build_super_partition") == "true":
863 banner("super_empty") 863 banner("super_empty")
864 AddSuperEmpty(output_zip) 864 AddSuperEmpty(output_zip)
865 865
866 if OPTIONS.info_dict.get("dynamic_partition_retrofit") == "true": 866 if OPTIONS.info_dict.get(
867 "build_retrofit_dynamic_partitions_ota_package") == "true":
867 banner("super split images") 868 banner("super split images")
868 AddSuperSplit(output_zip) 869 AddSuperSplit(output_zip)
869 870
diff --git a/tools/releasetools/blockimgdiff.py b/tools/releasetools/blockimgdiff.py
index b5e01d332..80d402371 100644
--- a/tools/releasetools/blockimgdiff.py
+++ b/tools/releasetools/blockimgdiff.py
@@ -471,6 +471,23 @@ class BlockImageDiff(object):
471 471
472 # Ensure the runtime stash size is under the limit. 472 # Ensure the runtime stash size is under the limit.
473 if common.OPTIONS.cache_size is not None: 473 if common.OPTIONS.cache_size is not None:
474 stash_limit = (common.OPTIONS.cache_size *
475 common.OPTIONS.stash_threshold / self.tgt.blocksize)
476 # Ignore the stash limit and calculate the maximum simultaneously stashed
477 # blocks needed.
478 _, max_stashed_blocks = self.ReviseStashSize(ignore_stash_limit=True)
479
480 # We cannot stash more blocks than the stash limit simultaneously. As a
481 # result, some 'diff' commands will be converted to new; leading to an
482 # unintended large package. To mitigate this issue, we can carefully
483 # choose the transfers for conversion. The number '1024' can be further
484 # tweaked here to balance the package size and build time.
485 if max_stashed_blocks > stash_limit + 1024:
486 self.SelectAndConvertDiffTransfersToNew()
487 # Regenerate the sequence as the graph has changed.
488 self.FindSequenceForTransfers()
489
490 # Revise the stash size again to keep the size under limit.
474 self.ReviseStashSize() 491 self.ReviseStashSize()
475 492
476 # Double-check our work. 493 # Double-check our work.
@@ -700,7 +717,21 @@ class BlockImageDiff(object):
700 "max stashed blocks: %d (%d bytes), limit: <unknown>\n", 717 "max stashed blocks: %d (%d bytes), limit: <unknown>\n",
701 max_stashed_blocks, self._max_stashed_size) 718 max_stashed_blocks, self._max_stashed_size)
702 719
703 def ReviseStashSize(self): 720 def ReviseStashSize(self, ignore_stash_limit=False):
721 """ Revises the transfers to keep the stash size within the size limit.
722
723 Iterates through the transfer list and calculates the stash size each
724 transfer generates. Converts the affected transfers to new if we reach the
725 stash limit.
726
727 Args:
728 ignore_stash_limit: Ignores the stash limit and calculates the max
729 simultaneous stashed blocks instead. No change will be made to the
730 transfer list with this flag.
731
732 Return:
733 A tuple of (tgt blocks converted to new, max stashed blocks)
734 """
704 logger.info("Revising stash size...") 735 logger.info("Revising stash size...")
705 stash_map = {} 736 stash_map = {}
706 737
@@ -715,16 +746,19 @@ class BlockImageDiff(object):
715 for stash_raw_id, _ in xf.use_stash: 746 for stash_raw_id, _ in xf.use_stash:
716 stash_map[stash_raw_id] += (xf,) 747 stash_map[stash_raw_id] += (xf,)
717 748
718 # Compute the maximum blocks available for stash based on /cache size and 749 max_allowed_blocks = None
719 # the threshold. 750 if not ignore_stash_limit:
720 cache_size = common.OPTIONS.cache_size 751 # Compute the maximum blocks available for stash based on /cache size and
721 stash_threshold = common.OPTIONS.stash_threshold 752 # the threshold.
722 max_allowed = cache_size * stash_threshold / self.tgt.blocksize 753 cache_size = common.OPTIONS.cache_size
754 stash_threshold = common.OPTIONS.stash_threshold
755 max_allowed_blocks = cache_size * stash_threshold / self.tgt.blocksize
723 756
724 # See the comments for 'stashes' in WriteTransfers(). 757 # See the comments for 'stashes' in WriteTransfers().
725 stashes = {} 758 stashes = {}
726 stashed_blocks = 0 759 stashed_blocks = 0
727 new_blocks = 0 760 new_blocks = 0
761 max_stashed_blocks = 0
728 762
729 # Now go through all the commands. Compute the required stash size on the 763 # Now go through all the commands. Compute the required stash size on the
730 # fly. If a command requires excess stash than available, it deletes the 764 # fly. If a command requires excess stash than available, it deletes the
@@ -741,7 +775,7 @@ class BlockImageDiff(object):
741 if sh not in stashes: 775 if sh not in stashes:
742 stashed_blocks_after += sr.size() 776 stashed_blocks_after += sr.size()
743 777
744 if stashed_blocks_after > max_allowed: 778 if max_allowed_blocks and stashed_blocks_after > max_allowed_blocks:
745 # We cannot stash this one for a later command. Find out the command 779 # We cannot stash this one for a later command. Find out the command
746 # that will use this stash and replace the command with "new". 780 # that will use this stash and replace the command with "new".
747 use_cmd = stash_map[stash_raw_id][2] 781 use_cmd = stash_map[stash_raw_id][2]
@@ -754,15 +788,21 @@ class BlockImageDiff(object):
754 else: 788 else:
755 stashes[sh] = 1 789 stashes[sh] = 1
756 stashed_blocks = stashed_blocks_after 790 stashed_blocks = stashed_blocks_after
791 max_stashed_blocks = max(max_stashed_blocks, stashed_blocks)
757 792
758 # "move" and "diff" may introduce implicit stashes in BBOTA v3. Prior to 793 # "move" and "diff" may introduce implicit stashes in BBOTA v3. Prior to
759 # ComputePatches(), they both have the style of "diff". 794 # ComputePatches(), they both have the style of "diff".
760 if xf.style == "diff": 795 if xf.style == "diff":
761 assert xf.tgt_ranges and xf.src_ranges 796 assert xf.tgt_ranges and xf.src_ranges
762 if xf.src_ranges.overlaps(xf.tgt_ranges): 797 if xf.src_ranges.overlaps(xf.tgt_ranges):
763 if stashed_blocks + xf.src_ranges.size() > max_allowed: 798 if (max_allowed_blocks and
799 stashed_blocks + xf.src_ranges.size() > max_allowed_blocks):
764 replaced_cmds.append(xf) 800 replaced_cmds.append(xf)
765 logger.info("%10d %9s %s", xf.src_ranges.size(), "implicit", xf) 801 logger.info("%10d %9s %s", xf.src_ranges.size(), "implicit", xf)
802 else:
803 # The whole source ranges will be stashed for implicit stashes.
804 max_stashed_blocks = max(max_stashed_blocks,
805 stashed_blocks + xf.src_ranges.size())
766 806
767 # Replace the commands in replaced_cmds with "new"s. 807 # Replace the commands in replaced_cmds with "new"s.
768 for cmd in replaced_cmds: 808 for cmd in replaced_cmds:
@@ -791,7 +831,7 @@ class BlockImageDiff(object):
791 logger.info( 831 logger.info(
792 " Total %d blocks (%d bytes) are packed as new blocks due to " 832 " Total %d blocks (%d bytes) are packed as new blocks due to "
793 "insufficient cache size.", new_blocks, num_of_bytes) 833 "insufficient cache size.", new_blocks, num_of_bytes)
794 return new_blocks 834 return new_blocks, max_stashed_blocks
795 835
796 def ComputePatches(self, prefix): 836 def ComputePatches(self, prefix):
797 logger.info("Reticulating splines...") 837 logger.info("Reticulating splines...")
@@ -1299,6 +1339,53 @@ class BlockImageDiff(object):
1299 1339
1300 return patches 1340 return patches
1301 1341
1342 def SelectAndConvertDiffTransfersToNew(self):
1343 """Converts the diff transfers to reduce the max simultaneous stash.
1344
1345 Since the 'new' data is compressed with deflate, we can select the 'diff'
1346 transfers for conversion by comparing its patch size with the size of the
1347 compressed data. Ideally, we want to convert the transfers with a small
1348 size increase, but using a large number of stashed blocks.
1349 """
1350
1351 logger.info("Selecting diff commands to convert to new.")
1352 diff_queue = []
1353 for xf in self.transfers:
1354 if xf.style == "diff" and xf.src_sha1 != xf.tgt_sha1:
1355 use_imgdiff = self.CanUseImgdiff(xf.tgt_name, xf.tgt_ranges,
1356 xf.src_ranges)
1357 diff_queue.append((xf.order, use_imgdiff, len(diff_queue)))
1358
1359 # Remove the 'move' transfers, and compute the patch & compressed size
1360 # for the remaining.
1361 result = self.ComputePatchesForInputList(diff_queue, True)
1362
1363 removed_stashed_blocks = 0
1364 for xf_index, patch_info, compressed_size in result:
1365 xf = self.transfers[xf_index]
1366 if not xf.patch_info:
1367 xf.patch_info = patch_info
1368
1369 size_ratio = len(xf.patch_info.content) * 100.0 / compressed_size
1370 diff_style = "imgdiff" if xf.patch_info.imgdiff else "bsdiff"
1371 logger.info("%s, target size: %d, style: %s, patch size: %d,"
1372 " compression_size: %d, ratio %.2f%%", xf.tgt_name,
1373 xf.tgt_ranges.size(), diff_style,
1374 len(xf.patch_info.content), compressed_size, size_ratio)
1375
1376 # Convert the transfer to new if the compressed size is smaller or equal.
1377 # We don't need to maintain the stash_before lists here because the
1378 # graph will be regenerated later.
1379 if len(xf.patch_info.content) >= compressed_size:
1380 removed_stashed_blocks += sum(sr.size() for _, sr in xf.use_stash)
1381 logger.info("Converting %s to new", xf.tgt_name)
1382 xf.ConvertToNew()
1383
1384 # TODO(xunchang) convert more transfers by sorting:
1385 # (compressed size - patch_size) / used_stashed_blocks
1386
1387 logger.info("Removed %d stashed blocks", removed_stashed_blocks)
1388
1302 def FindTransfers(self): 1389 def FindTransfers(self):
1303 """Parse the file_map to generate all the transfers.""" 1390 """Parse the file_map to generate all the transfers."""
1304 1391
diff --git a/tools/releasetools/build_image.py b/tools/releasetools/build_image.py
index 146b8683b..d71060394 100755
--- a/tools/releasetools/build_image.py
+++ b/tools/releasetools/build_image.py
@@ -75,8 +75,8 @@ def GetInodeUsage(path):
75 """ 75 """
76 cmd = ["find", path, "-print"] 76 cmd = ["find", path, "-print"]
77 output = common.RunAndCheckOutput(cmd, verbose=False) 77 output = common.RunAndCheckOutput(cmd, verbose=False)
78 # increase by 25 % as number of files and directories is not whole picture. 78 # TODO(b/122328872) Fix estimation algorithm to not need the multiplier.
79 return output.count('\n') * 30 // 24 79 return output.count('\n') * 2
80 80
81 81
82def GetFilesystemCharacteristics(sparse_image_path): 82def GetFilesystemCharacteristics(sparse_image_path):
diff --git a/tools/releasetools/build_super_image.py b/tools/releasetools/build_super_image.py
index e8730ae19..bb0e6413a 100755
--- a/tools/releasetools/build_super_image.py
+++ b/tools/releasetools/build_super_image.py
@@ -67,6 +67,17 @@ def GetPartitionSizeFromImage(img):
67 return os.path.getsize(img) 67 return os.path.getsize(img)
68 68
69 69
70def GetArgumentsForImage(partition, group, image=None):
71 image_size = GetPartitionSizeFromImage(image) if image else 0
72
73 cmd = ["--partition",
74 "{}:readonly:{}:{}".format(partition, image_size, group)]
75 if image:
76 cmd += ["--image", "{}={}".format(partition, image)]
77
78 return cmd
79
80
70def BuildSuperImageFromDict(info_dict, output): 81def BuildSuperImageFromDict(info_dict, output):
71 82
72 cmd = [info_dict["lpmake"], 83 cmd = [info_dict["lpmake"],
@@ -105,26 +116,25 @@ def BuildSuperImageFromDict(info_dict, output):
105 116
106 for partition in partition_list: 117 for partition in partition_list:
107 image = info_dict.get("{}_image".format(partition)) 118 image = info_dict.get("{}_image".format(partition))
108 image_size = 0
109 if image: 119 if image:
110 image_size = GetPartitionSizeFromImage(image)
111 has_image = True 120 has_image = True
112 if append_suffix: 121
113 cmd += ["--partition", 122 if not append_suffix:
114 "{}_a:readonly:{}:{}_a".format(partition, image_size, group), 123 cmd += GetArgumentsForImage(partition, group, image)
115 "--partition", 124 continue
116 "{}_b:readonly:0:{}_b".format(partition, group)] 125
117 if image: 126 # For A/B devices, super partition always contains sub-partitions in
118 # For A/B devices, super partition always contains sub-partitions in 127 # the _a slot, because this image should only be used for
119 # the _a slot, because this image should only be used for 128 # bootstrapping / initializing the device. When flashing the image,
120 # bootstrapping / initializing the device. When flashing the image, 129 # bootloader fastboot should always mark _a slot as bootable.
121 # bootloader fastboot should always mark _a slot as bootable. 130 cmd += GetArgumentsForImage(partition + "_a", group + "_a", image)
122 cmd += ["--image", "{}_a={}".format(partition, image)] 131
123 else: 132 other_image = None
124 cmd += ["--partition", 133 if partition == "system" and "system_other_image" in info_dict:
125 "{}:readonly:{}:{}".format(partition, image_size, group)] 134 other_image = info_dict["system_other_image"]
126 if image: 135 has_image = True
127 cmd += ["--image", "{}={}".format(partition, image)] 136
137 cmd += GetArgumentsForImage(partition + "_b", group + "_b", other_image)
128 138
129 if has_image: 139 if has_image:
130 cmd.append("--sparse") 140 cmd.append("--sparse")
@@ -145,6 +155,12 @@ def BuildSuperImageFromExtractedTargetFiles(inp, out):
145 info_dict = common.LoadInfoDict(inp) 155 info_dict = common.LoadInfoDict(inp)
146 partition_list = shlex.split( 156 partition_list = shlex.split(
147 info_dict.get("dynamic_partition_list", "").strip()) 157 info_dict.get("dynamic_partition_list", "").strip())
158
159 if "system" in partition_list:
160 image_path = os.path.join(inp, "IMAGES", "system_other.img")
161 if os.path.isfile(image_path):
162 info_dict["system_other_image"] = image_path
163
148 missing_images = [] 164 missing_images = []
149 for partition in partition_list: 165 for partition in partition_list:
150 image_path = os.path.join(inp, "IMAGES", "{}.img".format(partition)) 166 image_path = os.path.join(inp, "IMAGES", "{}.img".format(partition))
diff --git a/tools/releasetools/test_blockimgdiff.py b/tools/releasetools/test_blockimgdiff.py
index 857026e34..806ff4b95 100644
--- a/tools/releasetools/test_blockimgdiff.py
+++ b/tools/releasetools/test_blockimgdiff.py
@@ -127,11 +127,11 @@ class BlockImageDiffTest(ReleaseToolsTestCase):
127 127
128 # Sufficient cache to stash 5 blocks (size * 0.8 >= 5). 128 # Sufficient cache to stash 5 blocks (size * 0.8 >= 5).
129 common.OPTIONS.cache_size = 7 * 4096 129 common.OPTIONS.cache_size = 7 * 4096
130 self.assertEqual(0, block_image_diff.ReviseStashSize()) 130 self.assertEqual((0, 5), block_image_diff.ReviseStashSize())
131 131
132 # Insufficient cache to stash 5 blocks (size * 0.8 < 5). 132 # Insufficient cache to stash 5 blocks (size * 0.8 < 5).
133 common.OPTIONS.cache_size = 6 * 4096 133 common.OPTIONS.cache_size = 6 * 4096
134 self.assertEqual(10, block_image_diff.ReviseStashSize()) 134 self.assertEqual((10, 0), block_image_diff.ReviseStashSize())
135 135
136 def test_ReviseStashSize_bug_33687949(self): 136 def test_ReviseStashSize_bug_33687949(self):
137 """ReviseStashSize() should "free" the used stash _after_ the command. 137 """ReviseStashSize() should "free" the used stash _after_ the command.
@@ -169,7 +169,7 @@ class BlockImageDiffTest(ReleaseToolsTestCase):
169 169
170 # Insufficient cache to stash 15 blocks (size * 0.8 < 15). 170 # Insufficient cache to stash 15 blocks (size * 0.8 < 15).
171 common.OPTIONS.cache_size = 15 * 4096 171 common.OPTIONS.cache_size = 15 * 4096
172 self.assertEqual(15, block_image_diff.ReviseStashSize()) 172 self.assertEqual((15, 5), block_image_diff.ReviseStashSize())
173 173
174 def test_FileTypeSupportedByImgdiff(self): 174 def test_FileTypeSupportedByImgdiff(self):
175 self.assertTrue( 175 self.assertTrue(
diff --git a/tools/signapk/Android.bp b/tools/signapk/Android.bp
index e95205d04..ad9d957dd 100644
--- a/tools/signapk/Android.bp
+++ b/tools/signapk/Android.bp
@@ -28,4 +28,10 @@ java_library_host {
28 ], 28 ],
29 29
30 required: ["libconscrypt_openjdk_jni"], 30 required: ["libconscrypt_openjdk_jni"],
31
32 // The post-build signing tools need signapk.jar (and its shared libraries,
33 // handled in their own Android.bp files)
34 dist: {
35 targets: ["droidcore"],
36 },
31} 37}
diff --git a/tools/signapk/Android.mk b/tools/signapk/Android.mk
deleted file mode 100644
index ff54d6d84..000000000
--- a/tools/signapk/Android.mk
+++ /dev/null
@@ -1,26 +0,0 @@
1#
2# Copyright (C) 2008 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16LOCAL_PATH := $(call my-dir)
17
18ifeq ($(TARGET_BUILD_APPS),)
19# The post-build signing tools need signapk.jar and its shared libraries,
20# but we don't need this if we're just doing unbundled apps.
21my_dist_files := $(HOST_OUT_JAVA_LIBRARIES)/signapk.jar \
22 $(HOST_OUT_SHARED_LIBRARIES)/libconscrypt_openjdk_jni$(HOST_SHLIB_SUFFIX)
23
24$(call dist-for-goals,droidcore,$(my_dist_files))
25my_dist_files :=
26endif