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.h b/common/constants.h
index 1057a65..61e5ddd 100644
--- a/common/constants.h
+++ b/common/constants.h
@@ -41,6 +41,7 @@
extern const char kPrefsCurrentUrlIndex[];
extern const char kPrefsDailyMetricsLastReportedAt[];
extern const char kPrefsDeltaUpdateFailures[];
+extern const char kPrefsDynamicPartitionMetadataInitialized[];
extern const char kPrefsFullPayloadAttemptNumber[];
extern const char kPrefsInstallDateDays[];
extern const char kPrefsLastActivePingDay[];