Make change and version bump to QQ1A.190919.001

Change-Id: Icdfcc5ce6d317d445ff273b0fc2132710ef7700d
This commit is contained in:
android-build-team Robot 2019-09-19 03:14:02 +00:00
commit e891d9196e
3 changed files with 42 additions and 16 deletions

View File

@ -18,4 +18,4 @@
# (like "CRB01"). It must be a single word, and is
# capitalized by convention.
BUILD_ID=QQ1A.190918.002
BUILD_ID=QQ1A.190919.001

View File

@ -242,7 +242,12 @@ DYNAMIC_PARTITION_INFO = 'META/dynamic_partitions_info.txt'
AB_PARTITIONS = 'META/ab_partitions.txt'
UNZIP_PATTERN = ['IMAGES/*', 'META/*', 'RADIO/*']
RETROFIT_DAP_UNZIP_PATTERN = ['OTA/super_*.img', AB_PARTITIONS]
SECONDARY_IMAGES_SKIP_PARTITIONS = ['odm', 'product', 'system_ext', 'vendor']
# Images to be excluded from secondary payload. We essentially only keep
# 'system_other' and bootloader partitions.
SECONDARY_PAYLOAD_SKIPPED_IMAGES = [
'boot', 'dtbo', 'modem', 'odm', 'product', 'radio', 'recovery',
'system_ext', 'vbmeta', 'vbmeta_system', 'vbmeta_vendor', 'vendor']
class BuildInfo(object):
@ -1891,7 +1896,7 @@ def GetTargetFilesZipForSecondaryImages(input_file, skip_postinstall=False):
if key == 'dynamic_partition_list' or key.endswith(LIST_SUFFIX):
partitions = value.split()
partitions = [partition for partition in partitions if partition
not in SECONDARY_IMAGES_SKIP_PARTITIONS]
not in SECONDARY_PAYLOAD_SKIPPED_IMAGES]
output_list.append('{}={}'.format(key, ' '.join(partitions)))
else:
output_list.append(line)
@ -1914,10 +1919,13 @@ def GetTargetFilesZipForSecondaryImages(input_file, skip_postinstall=False):
elif info.filename in ('IMAGES/system.img',
'IMAGES/system.map'):
pass
# Images like vendor and product are not needed in the secondary payload.
elif info.filename in ['IMAGES/{}.img'.format(partition) for partition in
SECONDARY_IMAGES_SKIP_PARTITIONS]:
pass
# Copy images that are not in SECONDARY_PAYLOAD_SKIPPED_IMAGES.
elif info.filename.startswith(('IMAGES/', 'RADIO/')):
image_name = os.path.basename(info.filename)
if image_name not in ['{}.img'.format(partition) for partition in
SECONDARY_PAYLOAD_SKIPPED_IMAGES]:
common.ZipWrite(target_zip, unzipped_file, arcname=info.filename)
# Skip copying the postinstall config if requested.
elif skip_postinstall and info.filename == POSTINSTALL_CONFIG:
@ -1930,7 +1938,7 @@ def GetTargetFilesZipForSecondaryImages(input_file, skip_postinstall=False):
with open(unzipped_file) as f:
partition_list = f.read().splitlines()
partition_list = [partition for partition in partition_list if partition
and partition not in SECONDARY_IMAGES_SKIP_PARTITIONS]
and partition not in SECONDARY_PAYLOAD_SKIPPED_IMAGES]
common.ZipWriteStr(target_zip, info.filename, '\n'.join(partition_list))
# Remove the unnecessary partitions from the dynamic partitions list.
elif (info.filename == 'META/misc_info.txt' or
@ -1939,8 +1947,6 @@ def GetTargetFilesZipForSecondaryImages(input_file, skip_postinstall=False):
common.ZipWriteStr(target_zip, info.filename, modified_info)
else:
common.ZipWrite(target_zip, unzipped_file, arcname=info.filename)
elif info.filename.startswith(('IMAGES/', 'RADIO/')):
common.ZipWrite(target_zip, unzipped_file, arcname=info.filename)
common.ZipClose(target_zip)

View File

@ -591,16 +591,16 @@ class OtaFromTargetFilesTest(test_utils.ReleaseToolsTestCase):
ab_partitions = verify_zip.read('META/ab_partitions.txt')
self.assertIn('META/ab_partitions.txt', namelist)
self.assertIn('IMAGES/boot.img', namelist)
self.assertIn('IMAGES/system.img', namelist)
self.assertIn('RADIO/bootloader.img', namelist)
self.assertIn('RADIO/modem.img', namelist)
self.assertIn(POSTINSTALL_CONFIG, namelist)
self.assertNotIn('IMAGES/boot.img', namelist)
self.assertNotIn('IMAGES/system_other.img', namelist)
self.assertNotIn('IMAGES/system.map', namelist)
self.assertNotIn('RADIO/modem.img', namelist)
expected_ab_partitions = ['boot', 'system', 'bootloader', 'modem']
expected_ab_partitions = ['system', 'bootloader']
self.assertEqual('\n'.join(expected_ab_partitions), ab_partitions)
@test_utils.SkipIfExternalToolsUnavailable()
@ -613,15 +613,35 @@ class OtaFromTargetFilesTest(test_utils.ReleaseToolsTestCase):
namelist = verify_zip.namelist()
self.assertIn('META/ab_partitions.txt', namelist)
self.assertIn('IMAGES/boot.img', namelist)
self.assertIn('IMAGES/system.img', namelist)
self.assertIn('RADIO/bootloader.img', namelist)
self.assertIn('RADIO/modem.img', namelist)
self.assertNotIn('IMAGES/boot.img', namelist)
self.assertNotIn('IMAGES/system_other.img', namelist)
self.assertNotIn('IMAGES/system.map', namelist)
self.assertNotIn('RADIO/modem.img', namelist)
self.assertNotIn(POSTINSTALL_CONFIG, namelist)
@test_utils.SkipIfExternalToolsUnavailable()
def test_GetTargetFilesZipForSecondaryImages_withoutRadioImages(self):
input_file = construct_target_files(secondary=True)
common.ZipDelete(input_file, 'RADIO/bootloader.img')
common.ZipDelete(input_file, 'RADIO/modem.img')
target_file = GetTargetFilesZipForSecondaryImages(input_file)
with zipfile.ZipFile(target_file) as verify_zip:
namelist = verify_zip.namelist()
self.assertIn('META/ab_partitions.txt', namelist)
self.assertIn('IMAGES/system.img', namelist)
self.assertIn(POSTINSTALL_CONFIG, namelist)
self.assertNotIn('IMAGES/boot.img', namelist)
self.assertNotIn('IMAGES/system_other.img', namelist)
self.assertNotIn('IMAGES/system.map', namelist)
self.assertNotIn('RADIO/bootloader.img', namelist)
self.assertNotIn('RADIO/modem.img', namelist)
@test_utils.SkipIfExternalToolsUnavailable()
def test_GetTargetFilesZipForSecondaryImages_dynamicPartitions(self):
input_file = construct_target_files(secondary=True)
@ -653,12 +673,12 @@ class OtaFromTargetFilesTest(test_utils.ReleaseToolsTestCase):
'META/dynamic_partitions_info.txt')
self.assertIn('META/ab_partitions.txt', namelist)
self.assertIn('IMAGES/boot.img', namelist)
self.assertIn('IMAGES/system.img', namelist)
self.assertIn(POSTINSTALL_CONFIG, namelist)
self.assertIn('META/misc_info.txt', namelist)
self.assertIn('META/dynamic_partitions_info.txt', namelist)
self.assertNotIn('IMAGES/boot.img', namelist)
self.assertNotIn('IMAGES/system_other.img', namelist)
self.assertNotIn('IMAGES/system.map', namelist)