Add [un]mapPartitions APIs to dynamic partition control
During postinstall stage, update_engine needs all target
partitions(system_b, vendor_b) to be mounted. We add 2 APIs to dynamic
partition control, 1 for mounting all partitions, and UnmapAllPartitions for unmap all partitions.
Test: Treehugger
Bug: 168554689
Change-Id: I1047851f6cdae7f39f50bd1d50e6d3bfc0d9a7f5
diff --git a/dynamic_partition_control_android.h b/dynamic_partition_control_android.h
index 9bffb59..4f3964b 100644
--- a/dynamic_partition_control_android.h
+++ b/dynamic_partition_control_android.h
@@ -90,6 +90,8 @@
const std::optional<std::string>& source_path,
bool is_append) override;
+ bool UnmapAllPartitions() override;
+
protected:
// These functions are exposed for testing.
@@ -201,11 +203,14 @@
const DeltaArchiveManifest& manifest,
bool delete_source);
+ bool MapAllPartitions() override;
+
private:
friend class DynamicPartitionControlAndroidTest;
friend class SnapshotPartitionTestP;
- void UnmapAllPartitions();
+ std::optional<base::FilePath> GetSuperDevice();
+
bool MapPartitionInternal(const std::string& super_device,
const std::string& target_partition_name,
uint32_t slot,