do not map partitions on A/B devices
For pure AB devices(no VAB), MapAllPartitions() should not be called
Test: th
Bug: 393082101
Change-Id: I3ad44acb83d34d457a05ac8a165604afc19c150f
diff --git a/payload_consumer/postinstall_runner_action.cc b/payload_consumer/postinstall_runner_action.cc
index 1717dd7..84237b1 100644
--- a/payload_consumer/postinstall_runner_action.cc
+++ b/payload_consumer/postinstall_runner_action.cc
@@ -111,12 +111,17 @@
// If we are switching slots, then we are required to MapAllPartitions,
// as FinishUpdate() requires all partitions to be mapped.
// And switching slots requires FinishUpdate() to be called first
- if (!install_plan_.partitions.empty() ||
- install_plan_.switch_slot_on_reboot) {
- if (!dynamic_control->MapAllPartitions()) {
- LOG(ERROR) << "Failed to map all partitions, this would cause "
- "FinishUpdate to fail. Abort early.";
- return CompletePostinstall(ErrorCode::kPostInstallMountError);
+ if (dynamic_control->GetVirtualAbFeatureFlag().IsEnabled()) {
+ // If we are switching slots, then we are required to MapAllPartitions,
+ // as FinishUpdate() requires all partitions to be mapped.
+ // And switching slots requires FinishUpdate() to be called first
+ if (!install_plan_.partitions.empty() ||
+ install_plan_.switch_slot_on_reboot) {
+ if (!dynamic_control->MapAllPartitions()) {
+ LOG(ERROR) << "Failed to map all partitions, this would cause "
+ "FinishUpdate to fail. Abort early.";
+ return CompletePostinstall(ErrorCode::kPostInstallMountError);
+ }
}
}