aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKelvin Zhang <zhangkelvin@google.com>2021-06-10 14:32:19 -0400
committerKelvin Zhang <zhangkelvin@google.com>2021-06-14 10:23:14 -0400
commit10eac08fe1b6c70bf284cb78c013b1d566a40ac1 (patch)
tree09d9a86cc6ca5fc266a69d5abde46d35245caeb9
parent9c17b26ee75a2fc43f0988e70aa44c63fcba594a (diff)
downloadbuild-10eac08fe1b6c70bf284cb78c013b1d566a40ac1.tar.gz
Add ro.vendor.build.dont_use_vabc to disable VABC OTA
This prop is owned by OEM, OEM can set this if they want to disable VABC. Test: m dist, make sure generated OTA has VABC disabled Bug: 185400304 Change-Id: Iceb2fb1f399d38a51722352a86ddf68af05fa24e
-rw-r--r--core/main.mk7
-rw-r--r--tools/releasetools/common.py7
-rwxr-xr-xtools/releasetools/ota_from_target_files.py4
3 files changed, 18 insertions, 0 deletions
diff --git a/core/main.mk b/core/main.mk
index e8c1ef9556..401fb04c72 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -311,6 +311,13 @@ ADDITIONAL_VENDOR_PROPERTIES += \
endif
endif
+# Set build prop. This prop is read by ota_from_target_files when generating OTA,
+# to decide if VABC should be disabled.
+ifeq ($(BOARD_DONT_USE_VABC_OTA),true)
+ADDITIONAL_VENDOR_PROPERTIES += \
+ ro.vendor.build.dont_use_vabc=true
+endif
+
# Set the flag in vendor. So VTS would know if the new fingerprint format is in use when
# the system images are replaced by GSI.
ifeq ($(BOARD_USE_VBMETA_DIGTEST_IN_FINGERPRINT),true)
diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py
index d4da8b22cb..498e48728b 100644
--- a/tools/releasetools/common.py
+++ b/tools/releasetools/common.py
@@ -454,6 +454,13 @@ class BuildInfo(object):
return vabc_enabled
@property
+ def vendor_suppressed_vabc(self):
+ vendor_prop = self.info_dict.get("vendor.build.prop")
+ vabc_suppressed = vendor_prop and \
+ vendor_prop.GetProp("ro.vendor.build.dont_use_vabc")
+ return vabc_suppressed and vabc_suppressed.lower() == "true"
+
+ @property
def oem_props(self):
return self._oem_props
diff --git a/tools/releasetools/ota_from_target_files.py b/tools/releasetools/ota_from_target_files.py
index 0b8965c273..bf0b8f123e 100755
--- a/tools/releasetools/ota_from_target_files.py
+++ b/tools/releasetools/ota_from_target_files.py
@@ -1076,6 +1076,7 @@ def GenerateAbOtaPackage(target_file, output_file, source_file=None):
# serve I/O request when device boots. Therefore, disable VABC if source
# build doesn't supports it.
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
else:
@@ -1084,6 +1085,9 @@ def GenerateAbOtaPackage(target_file, output_file, source_file=None):
target_info = common.BuildInfo(OPTIONS.info_dict, OPTIONS.oem_dicts)
source_info = None
+ if target_info.vendor_suppressed_vabc:
+ logger.info("Vendor suppressed VABC. Disabling")
+ OPTIONS.disable_vabc = True
additional_args = []
# Prepare custom images.