MetricsReporter gets DynamicPartitionControl.
Test: TH
Bug: 178732971
Change-Id: If434927b7abdecb8093db1462dae196cd744331a
diff --git a/aosp/metrics_reporter_android.cc b/aosp/metrics_reporter_android.cc
index 22ebf0d..18424d5 100644
--- a/aosp/metrics_reporter_android.cc
+++ b/aosp/metrics_reporter_android.cc
@@ -54,8 +54,9 @@
namespace metrics {
-std::unique_ptr<MetricsReporterInterface> CreateMetricsReporter() {
- return std::make_unique<MetricsReporterAndroid>();
+std::unique_ptr<MetricsReporterInterface> CreateMetricsReporter(
+ DynamicPartitionControlInterface* dynamic_partition_control) {
+ return std::make_unique<MetricsReporterAndroid>(dynamic_partition_control);
}
} // namespace metrics
diff --git a/aosp/metrics_reporter_android.h b/aosp/metrics_reporter_android.h
index 729542e..abe7c27 100644
--- a/aosp/metrics_reporter_android.h
+++ b/aosp/metrics_reporter_android.h
@@ -27,7 +27,9 @@
class MetricsReporterAndroid : public MetricsReporterInterface {
public:
- MetricsReporterAndroid() = default;
+ explicit MetricsReporterAndroid(
+ DynamicPartitionControlInterface* dynamic_partition_control)
+ : dynamic_partition_control_(dynamic_partition_control) {}
~MetricsReporterAndroid() override = default;
@@ -91,6 +93,8 @@
bool has_time_restriction_policy, int time_to_update_days) override {}
private:
+ DynamicPartitionControlInterface* dynamic_partition_control_;
+
DISALLOW_COPY_AND_ASSIGN(MetricsReporterAndroid);
};
diff --git a/aosp/update_attempter_android.cc b/aosp/update_attempter_android.cc
index 96bb67c..5c66141 100644
--- a/aosp/update_attempter_android.cc
+++ b/aosp/update_attempter_android.cc
@@ -140,7 +140,8 @@
hardware_(hardware),
processor_(new ActionProcessor()),
clock_(new Clock()) {
- metrics_reporter_ = metrics::CreateMetricsReporter();
+ metrics_reporter_ = metrics::CreateMetricsReporter(
+ boot_control_->GetDynamicPartitionControl());
network_selector_ = network::CreateNetworkSelector();
}