Rename postinstall_mount_device to readonly_target_path am: a9b5d8c8ee am: 6180c7600f

Original change: https://android-review.googlesource.com/c/platform/system/update_engine/+/1696827

Change-Id: I9ceacfa5bea6c6d2f3d11798b2621ce6ea3853e3
diff --git a/aosp/dynamic_partition_control_android.cc b/aosp/dynamic_partition_control_android.cc
index 93a10bb..538b57c 100644
--- a/aosp/dynamic_partition_control_android.cc
+++ b/aosp/dynamic_partition_control_android.cc
@@ -1116,9 +1116,9 @@
   if (UpdateUsesSnapshotCompression() && slot != current_slot &&
       IsDynamicPartition(partition_name, slot)) {
     return {
-        {.mountable_device_path = base::FilePath{std::string{VABC_DEVICE_DIR}}
-                                      .Append(partition_name_suffix)
-                                      .value(),
+        {.readonly_device_path = base::FilePath{std::string{VABC_DEVICE_DIR}}
+                                     .Append(partition_name_suffix)
+                                     .value(),
          .is_dynamic = true}};
   }
 
@@ -1137,7 +1137,7 @@
                                       &device)) {
       case DynamicPartitionDeviceStatus::SUCCESS:
         return {{.rw_device_path = device,
-                 .mountable_device_path = device,
+                 .readonly_device_path = device,
                  .is_dynamic = true}};
 
       case DynamicPartitionDeviceStatus::TRY_STATIC:
@@ -1155,7 +1155,7 @@
   }
 
   return {{.rw_device_path = static_path,
-           .mountable_device_path = static_path,
+           .readonly_device_path = static_path,
            .is_dynamic = false}};
 }
 
diff --git a/aosp/dynamic_partition_control_android_unittest.cc b/aosp/dynamic_partition_control_android_unittest.cc
index 0bb8df7..6f1d4ef 100644
--- a/aosp/dynamic_partition_control_android_unittest.cc
+++ b/aosp/dynamic_partition_control_android_unittest.cc
@@ -431,7 +431,7 @@
   auto device_info =
       dynamicControl().GetPartitionDevice("system", target(), source(), false);
   ASSERT_TRUE(device_info.has_value());
-  ASSERT_EQ(device_info->mountable_device_path, device);
+  ASSERT_EQ(device_info->readonly_device_path, device);
 }
 
 TEST_P(DynamicPartitionControlAndroidTestP, GetMountableDevicePathVABC) {
@@ -475,7 +475,7 @@
   ASSERT_TRUE(device_info.has_value());
   base::FilePath vabc_device_dir{
       std::string{DynamicPartitionControlAndroid::VABC_DEVICE_DIR}};
-  ASSERT_EQ(device_info->mountable_device_path,
+  ASSERT_EQ(device_info->readonly_device_path,
             vabc_device_dir.Append(T("system")).value());
 }
 
diff --git a/common/dynamic_partition_control_interface.h b/common/dynamic_partition_control_interface.h
index d5e1d8d..a5be6e1 100644
--- a/common/dynamic_partition_control_interface.h
+++ b/common/dynamic_partition_control_interface.h
@@ -39,7 +39,7 @@
 
 struct PartitionDevice {
   std::string rw_device_path;
-  std::string mountable_device_path;
+  std::string readonly_device_path;
   bool is_dynamic;
 };
 
diff --git a/common/fake_boot_control.h b/common/fake_boot_control.h
index fc7839d..79e2139 100644
--- a/common/fake_boot_control.h
+++ b/common/fake_boot_control.h
@@ -137,7 +137,7 @@
     PartitionDevice device;
     device.is_dynamic = false;
     device.rw_device_path = device_path->second;
-    device.mountable_device_path = device.rw_device_path;
+    device.readonly_device_path = device.rw_device_path;
     return device;
   }
 
diff --git a/payload_consumer/install_plan.cc b/payload_consumer/install_plan.cc
index 39827a4..06b7dd8 100644
--- a/payload_consumer/install_plan.cc
+++ b/payload_consumer/install_plan.cc
@@ -122,6 +122,7 @@
                              partition.target_hash.size())},
             {"run_postinstall", utils::ToString(partition.run_postinstall)},
             {"postinstall_path", partition.postinstall_path},
+            {"readonly_target_path", partition.readonly_target_path},
             {"filesystem_type", partition.filesystem_type},
         },
         "\n  "));
@@ -165,7 +166,7 @@
           partition.name, target_slot, source_slot);
       TEST_AND_RETURN_FALSE(device.has_value());
       partition.target_path = device->rw_device_path;
-      partition.postinstall_mount_device = device->mountable_device_path;
+      partition.readonly_target_path = device->readonly_device_path;
     } else {
       partition.target_path.clear();
     }
diff --git a/payload_consumer/install_plan.h b/payload_consumer/install_plan.h
index 43b94fc..7c77789 100644
--- a/payload_consumer/install_plan.h
+++ b/payload_consumer/install_plan.h
@@ -109,7 +109,7 @@
     std::string target_path;
     // |mountable_target_device| is intended to be a path to block device which
     // can be used for mounting this block device's underlying filesystem.
-    std::string postinstall_mount_device;
+    std::string readonly_target_path;
     uint64_t target_size{0};
     brillo::Blob target_hash;
 
diff --git a/payload_consumer/install_plan_unittest.cc b/payload_consumer/install_plan_unittest.cc
index 2ca8d81..7779494 100644
--- a/payload_consumer/install_plan_unittest.cc
+++ b/payload_consumer/install_plan_unittest.cc
@@ -38,6 +38,7 @@
           .source_path = "foo-source-path",
           .source_hash = {0xb1, 0xb2},
           .target_path = "foo-target-path",
+          .readonly_target_path = "mountable-device",
           .target_hash = {0xb3, 0xb4},
           .postinstall_path = "foo-path",
           .filesystem_type = "foo-type",
@@ -66,6 +67,7 @@
   target_hash: B3B4
   run_postinstall: false
   postinstall_path: foo-path
+  readonly_target_path: mountable-device
   filesystem_type: foo-type
 Payload: 0
   urls: (url1,url2)
diff --git a/payload_consumer/postinstall_runner_action.cc b/payload_consumer/postinstall_runner_action.cc
index de7848b..051ccbf 100644
--- a/payload_consumer/postinstall_runner_action.cc
+++ b/payload_consumer/postinstall_runner_action.cc
@@ -140,7 +140,7 @@
   const InstallPlan::Partition& partition =
       install_plan_.partitions[current_partition_];
 
-  const string mountable_device = partition.postinstall_mount_device;
+  const string mountable_device = partition.readonly_target_path;
   if (mountable_device.empty()) {
     LOG(ERROR) << "Cannot make mountable device from " << partition.target_path;
     return CompletePostinstall(ErrorCode::kPostinstallRunnerError);
diff --git a/payload_consumer/postinstall_runner_action_unittest.cc b/payload_consumer/postinstall_runner_action_unittest.cc
index 5ee2989..792ee28 100644
--- a/payload_consumer/postinstall_runner_action_unittest.cc
+++ b/payload_consumer/postinstall_runner_action_unittest.cc
@@ -195,7 +195,7 @@
   InstallPlan::Partition part;
   part.name = "part";
   part.target_path = device_path;
-  part.postinstall_mount_device = device_path;
+  part.readonly_target_path = device_path;
   part.run_postinstall = true;
   part.postinstall_path = postinstall_program;
   InstallPlan install_plan;
@@ -360,7 +360,7 @@
   InstallPlan::Partition part;
   part.name = "part";
   part.target_path = "/dev/null";
-  part.postinstall_mount_device = "/dev/null";
+  part.readonly_target_path = "/dev/null";
   part.run_postinstall = true;
   part.postinstall_path = kPostinstallDefaultScript;
   part.postinstall_optional = true;