Add force_writable to MapPartitionOnDeviceMapper
In sideloading we will map source partitions with
force_writable = false.
Test: manual sideloading
Bug: 117101719
Change-Id: I7629b8ecce07a9bd2c9e24ac6b64617386067ca5
diff --git a/dynamic_partition_control_android.cc b/dynamic_partition_control_android.cc
index 5e2c2a4..38c6759 100644
--- a/dynamic_partition_control_android.cc
+++ b/dynamic_partition_control_android.cc
@@ -55,11 +55,12 @@
const std::string& super_device,
const std::string& target_partition_name,
uint32_t slot,
+ bool force_writable,
std::string* path) {
if (!CreateLogicalPartition(super_device.c_str(),
slot,
target_partition_name,
- true /* force_writable */,
+ force_writable,
std::chrono::milliseconds(kMapTimeoutMillis),
path)) {
LOG(ERROR) << "Cannot map " << target_partition_name << " in "
@@ -67,7 +68,8 @@
return false;
}
LOG(INFO) << "Succesfully mapped " << target_partition_name
- << " to device mapper; device path at " << *path;
+ << " to device mapper (force_writable = " << force_writable
+ << "); device path at " << *path;
mapped_devices_.insert(target_partition_name);
return true;
}