Merge "Remove ro.expect.recovery_id"
diff --git a/core/Makefile b/core/Makefile
index 9561146..ad9b452 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -577,7 +577,12 @@
$(hide) build/make/tools/post_process_props.py $@
# -----------------------------------------------------------------
-# product_services build.prop
+# product_services build.prop (unless it's merged into /product)
+ifdef MERGE_PRODUCT_SERVICES_INTO_PRODUCT
+ ifneq (,$(PRODUCT_PRODUCT_SERVICES_PROPERTIES))
+ $(error PRODUCT_PRODUCT_SERVICES_PROPERTIES is not supported in this build.)
+ endif
+else
INSTALLED_PRODUCT_SERVICES_BUILD_PROP_TARGET := $(TARGET_OUT_PRODUCT_SERVICES)/build.prop
ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_PRODUCT_SERVICES_BUILD_PROP_TARGET)
@@ -585,7 +590,6 @@
$(call collapse-pairs, $(PRODUCT_PRODUCT_SERVICES_PROPERTIES))
FINAL_PRODUCT_SERVICES_PROPERTIES := $(call uniq-pairs-by-first-component, \
$(FINAL_PRODUCT_SERVICES_PROPERTIES),=)
-
$(INSTALLED_PRODUCT_SERVICES_BUILD_PROP_TARGET): $(BUILDINFO_COMMON_SH)
@echo Target product_services buildinfo: $@
@mkdir -p $(dir $@)
@@ -599,6 +603,7 @@
$(hide) $(foreach line,$(FINAL_PRODUCT_SERVICES_PROPERTIES), \
echo "$(line)" >> $@;)
$(hide) build/make/tools/post_process_props.py $@
+endif # MERGE_PRODUCT_SERVICES_INTO_PRODUCT
# ----------------------------------------------------------------
@@ -1153,8 +1158,13 @@
$(copy-file-to-target)
$(installed_product_notice_xml_gz): $(target_product_notice_file_xml_gz)
$(copy-file-to-target)
+
+# No notice file for product_services if its contents are merged into /product.
+# The notices will be part of the /product notice file.
+ifndef MERGE_PRODUCT_SERVICES_INTO_PRODUCT
$(installed_product_services_notice_xml_gz): $(target_product_services_notice_file_xml_gz)
$(copy-file-to-target)
+endif
# if we've been run my mm, mmm, etc, don't reinstall this every time
ifeq ($(ONE_SHOT_MAKEFILE),)
@@ -2556,10 +2566,9 @@
ifdef BUILT_VENDOR_MANIFEST
BUILT_ASSEMBLED_VENDOR_MANIFEST := $(PRODUCT_OUT)/verified_assembled_vendor_manifest.xml
ifeq (true,$(strip $(PRODUCT_ENFORCE_VINTF_MANIFEST)))
-ifdef DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE
-# TODO(b/65028233): turn this on globally
+ifneq ($(strip $(DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE) $(DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE)),)
$(BUILT_ASSEMBLED_VENDOR_MANIFEST): PRIVATE_SYSTEM_ASSEMBLE_VINTF_ENV_VARS := VINTF_ENFORCE_NO_UNUSED_HALS=true
-endif # DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE
+endif # DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE or DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE
endif # PRODUCT_ENFORCE_VINTF_MANIFEST
$(BUILT_ASSEMBLED_VENDOR_MANIFEST): $(HOST_OUT_EXECUTABLES)/assemble_vintf
$(BUILT_ASSEMBLED_VENDOR_MANIFEST): $(BUILT_SYSTEM_MATRIX)
diff --git a/core/envsetup.mk b/core/envsetup.mk
index bd632bf..17448f1 100644
--- a/core/envsetup.mk
+++ b/core/envsetup.mk
@@ -444,11 +444,16 @@
###########################################
# Now we can substitute with the real value of TARGET_COPY_OUT_PRODUCT_SERVICES
+MERGE_PRODUCT_SERVICES_INTO_PRODUCT :=
ifeq ($(TARGET_COPY_OUT_PRODUCT_SERVICES),$(_product_services_path_placeholder))
TARGET_COPY_OUT_PRODUCT_SERVICES := system/product_services
+else ifeq ($(TARGET_COPY_OUT_PRODUCT),$(TARGET_COPY_OUT_PRODUCT_SERVICES))
+ MERGE_PRODUCT_SERVICES_INTO_PRODUCT := true
else ifeq ($(filter product_services system/product_services,$(TARGET_COPY_OUT_PRODUCT_SERVICES)),)
- $(error TARGET_COPY_OUT_PRODUCT_SERVICES must be either 'product_services' or 'system/product_services', seeing '$(TARGET_COPY_OUT_PRODUCT_SERVICES)'.)
+ $(error TARGET_COPY_OUT_PRODUCT_SERVICES must be either 'product_services',\
+ '$(TARGET_COPY_OUT_PRODUCT)' or 'system/product_services', seeing '$(TARGET_COPY_OUT_PRODUCT_SERVICES)'.)
endif
+.KATI_READONLY := MERGE_PRODUCT_SERVICES_INTO_PRODUCT
PRODUCT_COPY_FILES := $(subst $(_product_services_path_placeholder),$(TARGET_COPY_OUT_PRODUCT_SERVICES),$(PRODUCT_COPY_FILES))
BOARD_USES_PRODUCT_SERVICESIMAGE :=
diff --git a/target/product/base_product.mk b/target/product/base_product.mk
index bd53fb1..1ed9e83 100644
--- a/target/product/base_product.mk
+++ b/target/product/base_product.mk
@@ -18,3 +18,4 @@
PRODUCT_PACKAGES += \
healthd \
ModuleMetadata \
+ product_compatibility_matrix.xml \
diff --git a/target/product/base_system.mk b/target/product/base_system.mk
index d6c8421..422683a 100644
--- a/target/product/base_system.mk
+++ b/target/product/base_system.mk
@@ -271,7 +271,7 @@
# VINTF data for system image
PRODUCT_PACKAGES += \
framework_manifest.xml \
- framework_compatibility_matrix.xml \
+ system_compatibility_matrix.xml \
ifeq ($(TARGET_CORE_JARS),)
$(error TARGET_CORE_JARS is empty; cannot initialize PRODUCT_BOOT_JARS variable)
diff --git a/target/product/base_vendor.mk b/target/product/base_vendor.mk
index 269a6af..e8f9e0c 100644
--- a/target/product/base_vendor.mk
+++ b/target/product/base_vendor.mk
@@ -30,6 +30,7 @@
android.hardware.cas@1.0-service \
android.hardware.configstore@1.1-service \
android.hardware.media.omx@1.0-service \
+ dumpsys_vendor \
fs_config_files_nonsystem \
fs_config_dirs_nonsystem \
gralloc.default \
diff --git a/target/product/gsi/current.txt b/target/product/gsi/current.txt
index e70ab5b..3ceeda1 100644
--- a/target/product/gsi/current.txt
+++ b/target/product/gsi/current.txt
@@ -137,6 +137,7 @@
VNDK-core: android.hardware.radio@1.3.so
VNDK-core: android.hardware.radio@1.4.so
VNDK-core: android.hardware.secure_element@1.0.so
+VNDK-core: android.hardware.secure_element@1.1.so
VNDK-core: android.hardware.sensors@1.0.so
VNDK-core: android.hardware.soundtrigger@2.0.so
VNDK-core: android.hardware.soundtrigger@2.0-core.so
diff --git a/tools/releasetools/blockimgdiff.py b/tools/releasetools/blockimgdiff.py
index 456f791..e5a9050 100644
--- a/tools/releasetools/blockimgdiff.py
+++ b/tools/releasetools/blockimgdiff.py
@@ -84,6 +84,7 @@
self.extended = RangeSet()
self.total_blocks = 0
self.file_map = {}
+ self.hashtree_info = None
def RangeSha1(self, ranges):
return sha1().hexdigest()
diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py
index de3e3b8..5d310d2 100644
--- a/tools/releasetools/common.py
+++ b/tools/releasetools/common.py
@@ -1770,15 +1770,21 @@
if OPTIONS.source_info_dict is None:
is_dynamic_build = OPTIONS.info_dict.get(
"use_dynamic_partitions") == "true"
+ is_dynamic_source = False
else:
is_dynamic_build = OPTIONS.source_info_dict.get(
"use_dynamic_partitions") == "true"
+ is_dynamic_source = partition in shlex.split(
+ OPTIONS.source_info_dict.get("dynamic_partition_list", "").strip())
- # For dynamic partitions builds, always check partition list in target build
- # because new partitions may be added.
- is_dynamic = is_dynamic_build and partition in shlex.split(
+ is_dynamic_target = partition in shlex.split(
OPTIONS.info_dict.get("dynamic_partition_list", "").strip())
+ # For dynamic partitions builds, check partition list in both source
+ # and target build because new partitions may be added, and existing
+ # partitions may be removed.
+ is_dynamic = is_dynamic_build and (is_dynamic_source or is_dynamic_target)
+
if is_dynamic:
self.device = 'map_partition("%s")' % partition
else:
@@ -2226,7 +2232,7 @@
collections.Counter(e.partition for e in block_diffs).items()
if count > 1])
- self._partition_updates = dict()
+ self._partition_updates = collections.OrderedDict()
for p, block_diff in block_diff_dict.items():
self._partition_updates[p] = DynamicPartitionUpdate()
@@ -2277,7 +2283,7 @@
logger.info("Updating dynamic partitions %s",
self._partition_updates.keys())
- self._group_updates = dict()
+ self._group_updates = collections.OrderedDict()
for g in tgt_groups:
self._group_updates[g] = DynamicGroupUpdate()
diff --git a/tools/releasetools/test_common.py b/tools/releasetools/test_common.py
index 3619633..cfd070d 100644
--- a/tools/releasetools/test_common.py
+++ b/tools/releasetools/test_common.py
@@ -27,6 +27,7 @@
import validate_target_files
from rangelib import RangeSet
+from blockimgdiff import EmptyImage, DataImage
KiB = 1024
MiB = 1024 * KiB
@@ -1113,7 +1114,7 @@
"ops that remove / shrink partitions must precede ops that "
"grow / add partitions")
- def test_inc_partitions(self):
+ def test_incremental(self):
source_info = common.LoadDictionaryFromLines("""
dynamic_partition_list=system vendor product product_services
super_partition_groups=group_foo
@@ -1186,3 +1187,38 @@
min_idx_move_partition_in_foo,
"Must shrink partitions / remove partitions from group"
"before adding / moving partitions into group")
+
+ def test_remove_partition(self):
+ source_info = common.LoadDictionaryFromLines("""
+blockimgdiff_versions=3,4
+use_dynamic_partitions=true
+dynamic_partition_list=foo
+super_partition_groups=group_foo
+super_group_foo_group_size={group_foo_size}
+super_group_foo_partition_list=foo
+""".format(group_foo_size=4 * GiB).split("\n"))
+ target_info = common.LoadDictionaryFromLines("""
+blockimgdiff_versions=3,4
+use_dynamic_partitions=true
+super_partition_groups=group_foo
+super_group_foo_group_size={group_foo_size}
+""".format(group_foo_size=4 * GiB).split("\n"))
+
+ common.OPTIONS.info_dict = target_info
+ common.OPTIONS.target_info_dict = target_info
+ common.OPTIONS.source_info_dict = source_info
+ common.OPTIONS.cache_size = 4 * 4096
+
+ block_diffs = [common.BlockDifference("foo", EmptyImage(),
+ src=DataImage("source", pad=True))]
+
+ dp_diff = common.DynamicPartitionsDifference(target_info, block_diffs,
+ source_info_dict=source_info)
+ with zipfile.ZipFile(self.output_path, 'w') as output_zip:
+ dp_diff.WriteScript(self.script, output_zip, write_verify_script=True)
+
+ self.assertNotIn("block_image_update", str(self.script),
+ "Removed partition should not be patched.")
+
+ lines = self.get_op_list(self.output_path)
+ self.assertEqual(lines, ["remove foo"])