Fix false negative NeedResize
BootControlAndroid did not call ResizePartitions when the
sizes were all correct to avoid storing metadata more than
once (after resuming from an update), and potentially writing
to incorrect extents. But, when the update starts, the target
metadata slot may contain metadata that happen to exactly
matches the size requirements, but have extents that maps to
currently running devices.
To do this correctly, DeltaPerformer uses PrefsInterface to
avoid calling into InitPartitionMetadata again when it is
initialized.
Hence, BootControlAndroid::InitPartitionMetadata ALWAYS write
metadata to the target slot. Also removed tests to reflect this.
Test: manual OTA
Test: update_engine_unittests
Bug: 117182932
Change-Id: I488ab369e42d582c94974791fdb988d12e695bc2
diff --git a/common/constants.cc b/common/constants.cc
index 4bca105..3ae7a60 100644
--- a/common/constants.cc
+++ b/common/constants.cc
@@ -37,6 +37,8 @@
const char kPrefsDailyMetricsLastReportedAt[] =
"daily-metrics-last-reported-at";
const char kPrefsDeltaUpdateFailures[] = "delta-update-failures";
+const char kPrefsDynamicPartitionMetadataInitialized[] =
+ "dynamic-partition-metadata-initialized";
const char kPrefsFullPayloadAttemptNumber[] = "full-payload-attempt-number";
const char kPrefsInstallDateDays[] = "install-date-days";
const char kPrefsLastActivePingDay[] = "last-active-ping-day";