[automerger skipped] Update Security String to 2025-03-01 am: 4db43f45bc am: e0aca2f0f1 am: 3a80588af1 am: 3a52f60a4a am: 123710a05f am: eea0c8c857 am: ac5e0aa65a am: c45654d769 -s ours am: 3c10d8ea59 -s ours am: c815fcca18 -s ours
am skip reason: Merged-In Ic0ccc796eac281a3caa87f1bd01eafa470ed2c64 with SHA-1 4db43f45bc is already in history
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/+/31207471
Change-Id: I7b41da184443068d9e4759b4a4502a36b704757c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/core/sysprop.mk b/core/sysprop.mk
index bd6f3d9..44af367 100644
--- a/core/sysprop.mk
+++ b/core/sysprop.mk
@@ -47,9 +47,21 @@
echo "ro.product.$(1).model=$(PRODUCT_MODEL)" >> $(2);\
echo "ro.product.$(1).name=$(TARGET_PRODUCT)" >> $(2);\
# Attestation specific properties for AOSP/GSI build running on device.
- echo "ro.product.model_for_attestation=$(PRODUCT_MODEL_FOR_ATTESTATION)" >> $(2);\
- echo "ro.product.brand_for_attestation=$(PRODUCT_BRAND_FOR_ATTESTATION)" >> $(2);\
- echo "ro.product.name_for_attestation=$(PRODUCT_NAME_FOR_ATTESTATION)" >> $(2);\
+ if [ -n "$(strip $(PRODUCT_MODEL_FOR_ATTESTATION))" ]; then \
+ echo "ro.product.model_for_attestation=$(PRODUCT_MODEL_FOR_ATTESTATION)" >> $(2);\
+ fi; \
+ if [ -n "$(strip $(PRODUCT_BRAND_FOR_ATTESTATION))" ]; then \
+ echo "ro.product.brand_for_attestation=$(PRODUCT_BRAND_FOR_ATTESTATION)" >> $(2);\
+ fi; \
+ if [ -n "$(strip $(PRODUCT_NAME_FOR_ATTESTATION))" ]; then \
+ echo "ro.product.name_for_attestation=$(PRODUCT_NAME_FOR_ATTESTATION)" >> $(2);\
+ fi; \
+ if [ -n "$(strip $(PRODUCT_DEVICE_FOR_ATTESTATION))" ]; then \
+ echo "ro.product.device_for_attestation=$(PRODUCT_DEVICE_FOR_ATTESTATION)" >> $(2);\
+ fi; \
+ if [ -n "$(strip $(PRODUCT_MANUFACTURER_FOR_ATTESTATION))" ]; then \
+ echo "ro.product.manufacturer_for_attestation=$(PRODUCT_MANUFACTURER_FOR_ATTESTATION)" >> $(2);\
+ fi; \
)\
$(if $(filter true,$(ZYGOTE_FORCE_64)),\
$(if $(filter vendor,$(1)),\
diff --git a/target/product/handheld_system.mk b/target/product/handheld_system.mk
index 52f9ee1..7864e7b 100644
--- a/target/product/handheld_system.mk
+++ b/target/product/handheld_system.mk
@@ -43,6 +43,7 @@
CaptivePortalLogin \
CertInstaller \
CredentialManager \
+ DeviceAsWebcam \
DocumentsUI \
DownloadProviderUi \
EasterEgg \
diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py
index abedecf..2c557d1 100644
--- a/tools/releasetools/common.py
+++ b/tools/releasetools/common.py
@@ -462,6 +462,10 @@
return system_prop and system_prop.GetProp("ro.build.version.release") == "11"
@property
+ def vabc_compression_param(self):
+ return self.get("virtual_ab_compression_method", "")
+
+ @property
def vendor_api_level(self):
vendor_prop = self.info_dict.get("vendor.build.prop")
if not vendor_prop:
diff --git a/tools/releasetools/ota_from_target_files.py b/tools/releasetools/ota_from_target_files.py
index e40256c..168c679 100755
--- a/tools/releasetools/ota_from_target_files.py
+++ b/tools/releasetools/ota_from_target_files.py
@@ -270,7 +270,7 @@
import common
import ota_utils
from ota_utils import (UNZIP_PATTERN, FinalizeMetadata, GetPackageMetadata,
- PayloadGenerator, SECURITY_PATCH_LEVEL_PROP_NAME, CopyTargetFilesDir)
+ PayloadGenerator, SECURITY_PATCH_LEVEL_PROP_NAME, CopyTargetFilesDir, VABC_COMPRESSION_PARAM_SUPPORT)
from common import DoesInputFileContain, IsSparseImage
import target_files_diff
from check_target_files_vintf import CheckVintfIfTrebleEnabled
@@ -865,6 +865,10 @@
if not source_info.is_vabc or not target_info.is_vabc:
logger.info("Either source or target does not support VABC, disabling.")
OPTIONS.disable_vabc = True
+ if source_info.vabc_compression_param != target_info.vabc_compression_param:
+ logger.info("Source build and target build use different compression methods {} vs {}, default to source builds parameter {}".format(
+ source_info.vabc_compression_param, target_info.vabc_compression_param, source_info.vabc_compression_param))
+ OPTIONS.vabc_compression_param = source_info.vabc_compression_param
# Virtual AB Compression was introduced in Androd S.
# Later, we backported VABC to Android R. But verity support was not
@@ -879,6 +883,22 @@
"META/ab_partitions.txt is required for ab_update."
target_info = common.BuildInfo(OPTIONS.info_dict, OPTIONS.oem_dicts)
source_info = None
+ if target_info.vabc_compression_param:
+ minimum_api_level_required = VABC_COMPRESSION_PARAM_SUPPORT[
+ target_info.vabc_compression_param]
+ if target_info.vendor_api_level < minimum_api_level_required:
+ logger.warning(
+ "This full OTA is configured to use VABC compression algorithm"
+ " {}, which is supported since"
+ " Android API level {}, but device is "
+ "launched with {} . If this full OTA is"
+ " served to a device running old build, OTA might fail due to "
+ "unsupported compression parameter. For safety, gz is used because "
+ "it's supported since day 1.".format(
+ target_info.vabc_compression_param,
+ minimum_api_level_required,
+ target_info.vendor_api_level))
+ OPTIONS.vabc_compression_param = "gz"
if OPTIONS.partial == []:
logger.info(
diff --git a/tools/releasetools/ota_utils.py b/tools/releasetools/ota_utils.py
index 3291d56..17b800e 100644
--- a/tools/releasetools/ota_utils.py
+++ b/tools/releasetools/ota_utils.py
@@ -50,6 +50,19 @@
SECURITY_PATCH_LEVEL_PROP_NAME = "ro.build.version.security_patch"
+# Key is the compression algorithm, value is minimum API level required to
+# use this compression algorithm for VABC OTA on device.
+VABC_COMPRESSION_PARAM_SUPPORT = {
+ "gz": 31,
+ "brotli": 31,
+ "none": 31,
+ # lz4 support is added in Android U
+ "lz4": 34,
+ # zstd support is added in Android V
+ "zstd": 35,
+}
+
+
def FinalizeMetadata(metadata, input_file, output_file, needed_property_files=None, package_key=None, pw=None):
"""Finalizes the metadata and signs an A/B OTA package.