Also clear required_size if successful
On a VAB device, when sideloading a full package, if the device
ended up using the semi-flashing path (i.e. source partitions
are overwritten), clear required_size in the successful case as well.
Test: update_engine_unittests
Bug: 153555889
Change-Id: I881f578806b4bd5486f9d0d3b3cd631b7a752cc9
diff --git a/dynamic_partition_control_android.cc b/dynamic_partition_control_android.cc
index bf31244..20e02ac 100644
--- a/dynamic_partition_control_android.cc
+++ b/dynamic_partition_control_android.cc
@@ -493,8 +493,13 @@
}
}
- return PrepareDynamicPartitionsForUpdate(
- source_slot, target_slot, manifest, delete_source);
+ TEST_AND_RETURN_FALSE(PrepareDynamicPartitionsForUpdate(
+ source_slot, target_slot, manifest, delete_source));
+
+ if (required_size != nullptr) {
+ *required_size = 0;
+ }
+ return true;
}
namespace {