From f175801f62f0033e1736d3a686197ed20834824a Mon Sep 17 00:00:00 2001 From: Kelvin Zhang Date: Wed, 26 Jan 2022 10:18:18 -0800 Subject: [PATCH] Fix bug where VABC xor is used on unsupported builds Test: th Bug: 216426344 Change-Id: I352136eb5f261ee1ca1567530109e7623c5f978b --- tools/releasetools/ota_from_target_files.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/releasetools/ota_from_target_files.py b/tools/releasetools/ota_from_target_files.py index 9b9422cc83..00d6e3ceaf 100755 --- a/tools/releasetools/ota_from_target_files.py +++ b/tools/releasetools/ota_from_target_files.py @@ -1105,7 +1105,12 @@ def GenerateAbOtaPackage(target_file, output_file, source_file=None): if target_info.vendor_suppressed_vabc: logger.info("Vendor suppressed VABC. Disabling") OPTIONS.disable_vabc = True - if not target_info.is_vabc_xor or OPTIONS.disable_vabc: + + # Both source and target build need to support VABC XOR for us to use it. + # Source build's update_engine must be able to write XOR ops, and target + # build's snapuserd must be able to interpret XOR ops. + if not target_info.is_vabc_xor or OPTIONS.disable_vabc or \ + (source_info is not None and not source_info.is_vabc_xor): logger.info("VABC XOR Not supported, disabling") OPTIONS.enable_vabc_xor = False additional_args = []