Do not erase system_other if zero length. am: 64331b37cb
Change-Id: I24aef00f8f3ae9c3d0cc6fa43d420d22982bdfdc
diff --git a/dynamic_partition_control_android.cc b/dynamic_partition_control_android.cc
index 7486d09..a9c2bb3 100644
--- a/dynamic_partition_control_android.cc
+++ b/dynamic_partition_control_android.cc
@@ -656,6 +656,13 @@
return true;
}
+ if (p->size() < AVB_FOOTER_SIZE) {
+ LOG(INFO) << partition_name_suffix << " has length " << p->size()
+ << "( < AVB_FOOTER_SIZE " << AVB_FOOTER_SIZE
+ << "), skip erasing.";
+ return true;
+ }
+
// Delete any pre-existing device with name |partition_name_suffix| and
// also remove it from |mapped_devices_|.
// In recovery, metadata might not be mounted, and