Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 23c2df71 authored by David Anderson's avatar David Anderson Committed by Gerrit Code Review
Browse files

Merge "ota_from_target_files: Disable XOR on <T vendor."

parents 7b640806 1c596178
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -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")
+13 −0
Original line number Diff line number Diff line
@@ -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.