Loading tools/releasetools/ota_from_target_files.py +3 −0 Original line number Diff line number Diff line Loading @@ -1061,6 +1061,9 @@ def GetPackageMetadata(target_info, source_info=None): if OPTIONS.wipe_user_data: metadata['ota-wipe'] = 'yes' if OPTIONS.retrofit_dynamic_partitions: metadata['ota-retrofit-dynamic-partitions'] = 'yes' is_incremental = source_info is not None if is_incremental: metadata['pre-build'] = source_info.fingerprint Loading tools/releasetools/test_ota_from_target_files.py +18 −0 Original line number Diff line number Diff line Loading @@ -415,6 +415,7 @@ class OtaFromTargetFilesTest(test_utils.ReleaseToolsTestCase): # Reset the global options as in ota_from_target_files.py. common.OPTIONS.incremental_source = None common.OPTIONS.downgrade = False common.OPTIONS.retrofit_dynamic_partitions = False common.OPTIONS.timestamp = False common.OPTIONS.wipe_user_data = False common.OPTIONS.no_signing = False Loading Loading @@ -517,6 +518,23 @@ class OtaFromTargetFilesTest(test_utils.ReleaseToolsTestCase): }, metadata) def test_GetPackageMetadata_retrofitDynamicPartitions(self): target_info = BuildInfo(self.TEST_TARGET_INFO_DICT, None) common.OPTIONS.retrofit_dynamic_partitions = True metadata = GetPackageMetadata(target_info) self.assertDictEqual( { 'ota-retrofit-dynamic-partitions' : 'yes', 'ota-type' : 'BLOCK', 'post-build' : 'build-fingerprint-target', 'post-build-incremental' : 'build-version-incremental-target', 'post-sdk-level' : '27', 'post-security-patch-level' : '2017-12-01', 'post-timestamp' : '1500000000', 'pre-device' : 'product-device', }, metadata) @staticmethod def _test_GetPackageMetadata_swapBuildTimestamps(target_info, source_info): (target_info['build.prop']['ro.build.date.utc'], Loading Loading
tools/releasetools/ota_from_target_files.py +3 −0 Original line number Diff line number Diff line Loading @@ -1061,6 +1061,9 @@ def GetPackageMetadata(target_info, source_info=None): if OPTIONS.wipe_user_data: metadata['ota-wipe'] = 'yes' if OPTIONS.retrofit_dynamic_partitions: metadata['ota-retrofit-dynamic-partitions'] = 'yes' is_incremental = source_info is not None if is_incremental: metadata['pre-build'] = source_info.fingerprint Loading
tools/releasetools/test_ota_from_target_files.py +18 −0 Original line number Diff line number Diff line Loading @@ -415,6 +415,7 @@ class OtaFromTargetFilesTest(test_utils.ReleaseToolsTestCase): # Reset the global options as in ota_from_target_files.py. common.OPTIONS.incremental_source = None common.OPTIONS.downgrade = False common.OPTIONS.retrofit_dynamic_partitions = False common.OPTIONS.timestamp = False common.OPTIONS.wipe_user_data = False common.OPTIONS.no_signing = False Loading Loading @@ -517,6 +518,23 @@ class OtaFromTargetFilesTest(test_utils.ReleaseToolsTestCase): }, metadata) def test_GetPackageMetadata_retrofitDynamicPartitions(self): target_info = BuildInfo(self.TEST_TARGET_INFO_DICT, None) common.OPTIONS.retrofit_dynamic_partitions = True metadata = GetPackageMetadata(target_info) self.assertDictEqual( { 'ota-retrofit-dynamic-partitions' : 'yes', 'ota-type' : 'BLOCK', 'post-build' : 'build-fingerprint-target', 'post-build-incremental' : 'build-version-incremental-target', 'post-sdk-level' : '27', 'post-security-patch-level' : '2017-12-01', 'post-timestamp' : '1500000000', 'pre-device' : 'product-device', }, metadata) @staticmethod def _test_GetPackageMetadata_swapBuildTimestamps(target_info, source_info): (target_info['build.prop']['ro.build.date.utc'], Loading