[REFACTOR] Pass DeltaArchiveManifest to DynamicPartitionControl
DynamicPartitionControl need the list of operations to calculate
COW sizes.
- Remove BootControlInterface::PartitionMetadata. Replace all references
with DeltaArchiveManifest. DeltaArchiveManifest has all information
that PartitionMetadata has.
- Rename all InitPartitionMetadata to PreparePartitionsForUpdate
- Change all PreparePartitionsForUpdate to use new signature
Bug: 138816109
Test: update_enigne_unittests --gtest_filter=*BootControl*:*Dynamic*
Change-Id: I4389ba2b1801addf8c3bc8395e2ea6a9a3ed27a0
diff --git a/dynamic_partition_control_android.h b/dynamic_partition_control_android.h
index d743e6e..0907236 100644
--- a/dynamic_partition_control_android.h
+++ b/dynamic_partition_control_android.h
@@ -44,10 +44,10 @@
std::unique_ptr<android::fs_mgr::MetadataBuilder> LoadMetadataBuilder(
const std::string& super_device, uint32_t source_slot) override;
- bool PreparePartitionsForUpdate(uint32_t source_slot,
- uint32_t target_slot,
- const BootControlInterface::PartitionMetadata&
- partition_metadata) override;
+ bool PreparePartitionsForUpdate(
+ uint32_t source_slot,
+ uint32_t target_slot,
+ const DeltaArchiveManifest& manifest) override;
bool GetDeviceDir(std::string* path) override;
std::string GetSuperPartitionName(uint32_t slot) override;
@@ -94,10 +94,9 @@
// Update |builder| according to |partition_metadata|, assuming the device
// does not have Virtual A/B.
- bool UpdatePartitionMetadata(
- android::fs_mgr::MetadataBuilder* builder,
- uint32_t target_slot,
- const BootControlInterface::PartitionMetadata& partition_metadata);
+ bool UpdatePartitionMetadata(android::fs_mgr::MetadataBuilder* builder,
+ uint32_t target_slot,
+ const DeltaArchiveManifest& manifest);
DISALLOW_COPY_AND_ASSIGN(DynamicPartitionControlAndroid);
};