Add vabc flag to UpdateAttemptReported / SnapshotMergeReported.

Test: statsd_testdrive
Bug: 178732971

Change-Id: I1a3614244ec0cded17ba2423122e0505f079ef25
diff --git a/aosp/cleanup_previous_update_action.cc b/aosp/cleanup_previous_update_action.cc
index 6155be4..55c5a73 100644
--- a/aosp/cleanup_previous_update_action.cc
+++ b/aosp/cleanup_previous_update_action.cc
@@ -457,6 +457,13 @@
   bool vab_retrofit = boot_control_->GetDynamicPartitionControl()
                           ->GetVirtualAbFeatureFlag()
                           .IsRetrofit();
+  bool vab_compression_enabled = boot_control_->GetDynamicPartitionControl()
+                                     ->GetVirtualAbCompressionFeatureFlag()
+                                     .IsEnabled();
+  // The snapshot has been merged, so we can no longer call
+  // DynamicPartitionControlInterface::UpdateUsesSnapshotCompression.
+  // However, we have saved the flag in the snapshot report.
+  bool vab_compression_used = report.compression_enabled();
 
   LOG(INFO) << "Reporting merge stats: "
             << android::snapshot::UpdateState_Name(report.state()) << " in "
@@ -468,7 +475,9 @@
                              static_cast<int64_t>(passed_ms.count()),
                              static_cast<int32_t>(report.resume_count()),
                              vab_retrofit,
-                             static_cast<int64_t>(report.cow_file_size()));
+                             static_cast<int64_t>(report.cow_file_size()),
+                             vab_compression_enabled,
+                             vab_compression_used);
 #endif
 }
 
diff --git a/aosp/metrics_reporter_android.cc b/aosp/metrics_reporter_android.cc
index 18424d5..1f8f45a 100644
--- a/aosp/metrics_reporter_android.cc
+++ b/aosp/metrics_reporter_android.cc
@@ -106,6 +106,11 @@
     }
   }
 
+  bool vab_compression_enabled = android::base::GetBoolProperty(
+      "ro.virtual_ab.compression.enabled", false);
+  bool vab_compression_used =
+      dynamic_partition_control_->UpdateUsesSnapshotCompression();
+
   android::util::stats_write(
       android::util::UPDATE_ENGINE_UPDATE_ATTEMPT_REPORTED,
       attempt_number,
@@ -118,7 +123,9 @@
       android::base::GetProperty("ro.build.fingerprint", "").c_str(),
       super_partition_size_bytes,
       slot_size_bytes,
-      super_free_space);
+      super_free_space,
+      vab_compression_enabled,
+      vab_compression_used);
 }
 
 void MetricsReporterAndroid::ReportUpdateAttemptDownloadMetrics(