New setting to mark postinstall as optional.
This setting allows to mark a postinstall script as optional. This
allows the postinstall program to fail when it is not strictly required
to run for the update to succeed.
Bug: 27178350
TEST=Added unittest. Sideloaded an update with an optional postinstall.
Change-Id: I41956d3308f3458b6bf94b835c9b5e470c84ca41
diff --git a/payload_consumer/delta_performer.cc b/payload_consumer/delta_performer.cc
index a1cf2ab..507ad8c 100644
--- a/payload_consumer/delta_performer.cc
+++ b/payload_consumer/delta_performer.cc
@@ -841,6 +841,7 @@
(partition.has_postinstall_path() ? partition.postinstall_path()
: kPostinstallDefaultScript);
install_part.filesystem_type = partition.filesystem_type();
+ install_part.postinstall_optional = partition.postinstall_optional();
}
if (partition.has_old_partition_info()) {