update_engine: Move DaemonStateInterface implementation to UpdateAttempter
It seems like UpdateAttempter is the best option for implementation of
DaemonStateInterface. SystemState should only be doing state keeping not
doing these startup logics.
BUG=b:171829801
TEST=unittests
TEST=CQ passes
Change-Id: I47ec50107ffbeb544e061f39c900a1559f2cdcab
Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/2519843
Tested-by: Amin Hassani <ahassani@chromium.org>
Reviewed-by: Jae Hoon Kim <kimjae@chromium.org>
Commit-Queue: Jae Hoon Kim <kimjae@chromium.org>
diff --git a/cros/real_system_state.h b/cros/real_system_state.h
index 798fca0..a93a9b7 100644
--- a/cros/real_system_state.h
+++ b/cros/real_system_state.h
@@ -48,29 +48,17 @@
// A real implementation of the SystemStateInterface which is
// used by the actual product code.
-class RealSystemState : public SystemState, public DaemonStateInterface {
+class RealSystemState : public SystemState {
public:
// Constructs all system objects that do not require separate initialization;
// see Initialize() below for the remaining ones.
RealSystemState() = default;
- ~RealSystemState() override;
+ ~RealSystemState() = default;
// Initializes and sets systems objects that require an initialization
// separately from construction. Returns |true| on success.
bool Initialize();
- // DaemonStateInterface overrides.
- // Start the periodic update attempts. Must be called at the beginning of the
- // program to start the periodic update check process.
- bool StartUpdater() override;
-
- void AddObserver(ServiceObserverInterface* observer) override;
- void RemoveObserver(ServiceObserverInterface* observer) override;
- const std::set<ServiceObserverInterface*>& service_observers() override {
- CHECK(update_attempter_.get());
- return update_attempter_->service_observers();
- }
-
// SystemState overrides.
inline void set_device_policy(
const policy::DevicePolicy* device_policy) override {
@@ -193,8 +181,6 @@
// rebooted. Important for tracking whether you are running instance of the
// update engine on first boot or due to a crash/restart.
bool system_rebooted_{false};
-
- ActionProcessor processor_;
};
} // namespace chromeos_update_engine