[cobalt][LocalAggregation] Redeclare GenerateObservationsNoWorker in
EventAggregatorManager.
- needed for the Cobalt testapp in the Fuchsia repo
Bug: 40853
Change-Id: Ifad8ea252cc79a614cf2cee39c12c44c3c7654e1
diff --git a/src/local_aggregation/event_aggregator_mgr.cc b/src/local_aggregation/event_aggregator_mgr.cc
index dda9219..b9f05e5 100644
--- a/src/local_aggregation/event_aggregator_mgr.cc
+++ b/src/local_aggregation/event_aggregator_mgr.cc
@@ -25,4 +25,9 @@
event_aggregator_->Start(std::move(clock));
}
+logger::Status EventAggregatorManager::GenerateObservationsNoWorker(
+ uint32_t final_day_index_utc, uint32_t final_day_index_local) {
+ return event_aggregator_->GenerateObservationsNoWorker(final_day_index_utc,
+ final_day_index_local);
+}
} // namespace cobalt::local_aggregation
diff --git a/src/local_aggregation/event_aggregator_mgr.h b/src/local_aggregation/event_aggregator_mgr.h
index 12ea6d1..660bf37 100644
--- a/src/local_aggregation/event_aggregator_mgr.h
+++ b/src/local_aggregation/event_aggregator_mgr.h
@@ -79,9 +79,20 @@
// Returns a pointer to an EventAggregator to be used for logging.
EventAggregator* GetEventAggregator() { return event_aggregator_.get(); }
+ // Checks that the worker thread is shut down, and if so, triggers an out of schedule
+ // AggregateStore::GenerateObservations() and returns its result. Returns kOther if the
+ // worker thread is joinable. See the documentation on AggregateStore::GenerateObservations()
+ // for a description of the parameters.
+ //
+ // This method is intended for use in the Cobalt testapps which require a single thread to
+ // both log events to and generate Observations from an EventAggregator.
+ logger::Status GenerateObservationsNoWorker(uint32_t final_day_index_utc,
+ uint32_t final_day_index_local = 0u);
+
private:
friend class TestEventAggregatorManager;
friend class EventAggregatorManagerTest;
+ friend class CobaltControllerImpl;
// Sets the EventAggregator's SteadyClockInterface. Only for use in tests.
void SetSteadyClock(util::SteadyClockInterface* clock) {