Lines Matching refs:metadata_proto
136 def WriteMetadata(metadata_proto, output): argument
146 metadata_dict = BuildLegacyOtaMetadata(metadata_proto)
150 ZipWriteStr(output, METADATA_PROTO_NAME, metadata_proto.SerializeToString(),
157 f.write(metadata_proto.SerializeToString())
249 metadata_proto = ota_metadata_pb2.OtaMetadata()
252 UpdateDeviceState(metadata_proto.postcondition, target_info,
256 metadata_proto.type = ota_metadata_pb2.OtaMetadata.AB
257 metadata_proto.required_cache = 0
259 metadata_proto.type = ota_metadata_pb2.OtaMetadata.BLOCK
263 metadata_proto.wipe = True
266 metadata_proto.retrofit_dynamic_partitions = True
270 UpdateDeviceState(metadata_proto.precondition, source_info,
273 metadata_proto.precondition.device.extend(
274 metadata_proto.postcondition.device)
278 HandleDowngradeMetadata(metadata_proto, target_info, source_info)
280 return metadata_proto
283 def BuildLegacyOtaMetadata(metadata_proto): argument
295 if metadata_proto.type == ota_metadata_pb2.OtaMetadata.AB:
297 elif metadata_proto.type == ota_metadata_pb2.OtaMetadata.BLOCK:
299 if metadata_proto.wipe:
301 if metadata_proto.retrofit_dynamic_partitions:
303 if metadata_proto.downgrade:
306 metadata_dict['ota-required-cache'] = str(metadata_proto.required_cache)
308 post_build = metadata_proto.postcondition
315 pre_build = metadata_proto.precondition
322 if metadata_proto.spl_downgrade:
324 metadata_dict.update(metadata_proto.property_files)
329 def HandleDowngradeMetadata(metadata_proto, target_info, source_info): argument
338 metadata_proto.spl_downgrade = True
345 metadata_proto.downgrade = True