Fsync data after writing prefs

update_engine is relying on prefs stored on filesystem to resume OTA
progress. Partners report loss of update progress after forced reboot.
This might be I/O cache issue.

Test: th
Bug: 259174530
Change-Id: I7b4b8281cfe2cc45c51e4d6d60e09edb12f3ed86
diff --git a/aosp/cleanup_previous_update_action.cc b/aosp/cleanup_previous_update_action.cc
index fb7bac1..7b0c9bb 100644
--- a/aosp/cleanup_previous_update_action.cc
+++ b/aosp/cleanup_previous_update_action.cc
@@ -379,10 +379,7 @@
 }
 
 bool CleanupPreviousUpdateAction::BeforeCancel() {
-  if (DeltaPerformer::ResetUpdateProgress(
-          prefs_,
-          false /* quick */,
-          false /* skip dynamic partitions metadata*/)) {
+  if (DeltaPerformer::ResetUpdateProgress(prefs_, false /* quick */)) {
     return true;
   }
 
diff --git a/aosp/dynamic_partition_control_android.cc b/aosp/dynamic_partition_control_android.cc
index cb38506..7818086 100644
--- a/aosp/dynamic_partition_control_android.cc
+++ b/aosp/dynamic_partition_control_android.cc
@@ -1314,8 +1314,8 @@
   // ResetUpdateProgress may pass but CancelUpdate fails.
   // This is expected. A scheduled CleanupPreviousUpdateAction should free
   // space when it is done.
-  TEST_AND_RETURN_FALSE(DeltaPerformer::ResetUpdateProgress(
-      prefs, false /* quick */, false /* skip dynamic partitions metadata */));
+  TEST_AND_RETURN_FALSE(
+      DeltaPerformer::ResetUpdateProgress(prefs, false /* quick */));
 
   if (ExpectMetadataMounted()) {
     TEST_AND_RETURN_FALSE(snapshot_->CancelUpdate());