Merge "Do not erase system_other if zero length." into rvc-dev am: 46aa61ec59 am: 887305edfb
Change-Id: Ia5817b3a2aedb949e61da715671c4d20c7a6e700
diff --git a/dynamic_partition_control_android.cc b/dynamic_partition_control_android.cc
index 48ad5f0..5ed604a 100644
--- a/dynamic_partition_control_android.cc
+++ b/dynamic_partition_control_android.cc
@@ -647,6 +647,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