Fix a failure in signing test

Pixel moved away from sparse images, so validate_target_files is failing
because it expects sparse images.

Test: th
Change-Id: I322ff10c2afbacfb4d78991be60c11aac92a6d4c
This commit is contained in:
Kelvin Zhang
2021-11-02 14:31:10 -07:00
parent 1e392720c2
commit 2639048c21
3 changed files with 20 additions and 11 deletions

View File

@@ -3953,3 +3953,10 @@ def AddCareMapForAbOta(output_file, ab_partitions, image_paths):
OPTIONS.replace_updated_files_list.append(care_map_path)
else:
ZipWrite(output_file, temp_care_map, arcname=care_map_path)
def IsSparseImage(filepath):
with open(filepath, 'rb') as fp:
# Magic for android sparse image format
# https://source.android.com/devices/bootloader/images
return fp.read(4) == b'\x3A\xFF\x26\xED'