Merge "ota_from_target_files: Disable XOR on <T vendor." am: 23c2df71bc
Original change: https://android-review.googlesource.com/c/platform/build/+/2535094 Change-Id: I5c67e68393a2b9b7080c27f9299193486d78a3f6 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
70e4fa03b7
2 changed files with 32 additions and 0 deletions
|
@ -460,6 +460,25 @@ class BuildInfo(object):
|
|||
system_prop = self.info_dict.get("system.build.prop")
|
||||
return system_prop and system_prop.GetProp("ro.build.version.release") == "11"
|
||||
|
||||
@property
|
||||
def vendor_api_level(self):
|
||||
vendor_prop = self.info_dict.get("vendor.build.prop")
|
||||
if not vendor_prop:
|
||||
return -1
|
||||
|
||||
props = [
|
||||
"ro.board.api_level",
|
||||
"ro.board.first_api_level",
|
||||
"ro.product.first_api_level",
|
||||
]
|
||||
for prop in props:
|
||||
value = vendor_prop.GetProp(prop)
|
||||
try:
|
||||
return int(value)
|
||||
except:
|
||||
pass
|
||||
return -1
|
||||
|
||||
@property
|
||||
def is_vabc_xor(self):
|
||||
vendor_prop = self.info_dict.get("vendor.build.prop")
|
||||
|
|
|
@ -909,6 +909,19 @@ def GenerateAbOtaPackage(target_file, output_file, source_file=None):
|
|||
logger.info(
|
||||
"VABC Compression algorithm is set to 'none', disabling VABC xor")
|
||||
OPTIONS.enable_vabc_xor = False
|
||||
|
||||
if OPTIONS.enable_vabc_xor:
|
||||
api_level = -1
|
||||
if source_info is not None:
|
||||
api_level = source_info.vendor_api_level
|
||||
if api_level == -1:
|
||||
api_level = target_info.vendor_api_level
|
||||
|
||||
# XOR is only supported on T and higher.
|
||||
if api_level < 33:
|
||||
logger.error("VABC XOR not supported on this vendor, disabling")
|
||||
OPTIONS.enable_vabc_xor = False
|
||||
|
||||
additional_args = []
|
||||
|
||||
# Prepare custom images.
|
||||
|
|
Loading…
Reference in a new issue