Merge "Add apex_info.pb to generated OTA"

This commit is contained in:
Kelvin Zhang 2021-01-27 14:58:30 +00:00 committed by Gerrit Code Review
commit a7f2857f8b
1 changed files with 9 additions and 0 deletions

View File

@ -1142,6 +1142,15 @@ def GenerateAbOtaPackage(target_file, output_file, source_file=None):
else:
logger.warning("Cannot find care map file in target_file package")
# Copy apex_info.pb over to generated OTA package.
try:
apex_info_entry = target_zip.getinfo("META/apex_info.pb")
with target_zip.open(apex_info_entry, "r") as zfp:
common.ZipWriteStr(output_zip, "apex_info.pb", zfp.read(),
compress_type=zipfile.ZIP_STORED)
except KeyError:
logger.warning("target_file doesn't contain apex_info.pb %s", target_file)
common.ZipClose(target_zip)
CheckVintfIfTrebleEnabled(target_file, target_info)