123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202 |
- #ifndef UPDATE_ENGINE_REAL_SYSTEM_STATE_H_
- #define UPDATE_ENGINE_REAL_SYSTEM_STATE_H_
- #include "update_engine/system_state.h"
- #include <memory>
- #include <set>
- #include <policy/device_policy.h>
- #if USE_CHROME_KIOSK_APP
- #include <kiosk-app/dbus-proxies.h>
- #endif
- #include "update_engine/certificate_checker.h"
- #include "update_engine/common/boot_control_interface.h"
- #include "update_engine/common/clock.h"
- #include "update_engine/common/dlcservice_interface.h"
- #include "update_engine/common/hardware_interface.h"
- #include "update_engine/common/prefs.h"
- #include "update_engine/connection_manager_interface.h"
- #include "update_engine/daemon_state_interface.h"
- #include "update_engine/metrics_reporter_interface.h"
- #include "update_engine/metrics_reporter_omaha.h"
- #include "update_engine/p2p_manager.h"
- #include "update_engine/payload_state.h"
- #include "update_engine/power_manager_interface.h"
- #include "update_engine/update_attempter.h"
- #include "update_engine/update_manager/update_manager.h"
- namespace chromeos_update_engine {
- class RealSystemState : public SystemState, public DaemonStateInterface {
- public:
-
-
- RealSystemState() = default;
- ~RealSystemState() override;
-
-
- bool Initialize();
-
-
-
- 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();
- }
-
- inline void set_device_policy(
- const policy::DevicePolicy* device_policy) override {
- device_policy_ = device_policy;
- }
- inline const policy::DevicePolicy* device_policy() override {
- return device_policy_;
- }
- inline BootControlInterface* boot_control() override {
- return boot_control_.get();
- }
- inline ClockInterface* clock() override { return &clock_; }
- inline ConnectionManagerInterface* connection_manager() override {
- return connection_manager_.get();
- }
- inline HardwareInterface* hardware() override { return hardware_.get(); }
- inline MetricsReporterInterface* metrics_reporter() override {
- return &metrics_reporter_;
- }
- inline PrefsInterface* prefs() override { return prefs_.get(); }
- inline PrefsInterface* powerwash_safe_prefs() override {
- return powerwash_safe_prefs_.get();
- }
- inline PayloadStateInterface* payload_state() override {
- return &payload_state_;
- }
- inline UpdateAttempter* update_attempter() override {
- return update_attempter_.get();
- }
- inline OmahaRequestParams* request_params() override {
- return &request_params_;
- }
- inline P2PManager* p2p_manager() override { return p2p_manager_.get(); }
- inline chromeos_update_manager::UpdateManager* update_manager() override {
- return update_manager_.get();
- }
- inline PowerManagerInterface* power_manager() override {
- return power_manager_.get();
- }
- inline bool system_rebooted() override { return system_rebooted_; }
- inline DlcServiceInterface* dlcservice() override {
- return dlcservice_.get();
- }
- private:
-
- #if USE_CHROME_KIOSK_APP
- std::unique_ptr<org::chromium::KioskAppServiceInterfaceProxy>
- kiosk_app_proxy_;
- #endif
-
- std::unique_ptr<PowerManagerInterface> power_manager_;
-
- std::unique_ptr<DlcServiceInterface> dlcservice_;
-
- std::unique_ptr<BootControlInterface> boot_control_;
-
- Clock clock_;
-
- const policy::DevicePolicy* device_policy_{nullptr};
-
-
- std::unique_ptr<ConnectionManagerInterface> connection_manager_;
-
- std::unique_ptr<HardwareInterface> hardware_;
-
- MetricsReporterOmaha metrics_reporter_;
-
- std::unique_ptr<PrefsInterface> prefs_;
-
- std::unique_ptr<PrefsInterface> powerwash_safe_prefs_;
-
-
- PayloadState payload_state_;
-
- OpenSSLWrapper openssl_wrapper_;
- std::unique_ptr<CertificateChecker> certificate_checker_;
-
- std::unique_ptr<UpdateAttempter> update_attempter_;
-
- OmahaRequestParams request_params_{this};
- std::unique_ptr<P2PManager> p2p_manager_;
- std::unique_ptr<chromeos_update_manager::UpdateManager> update_manager_;
- policy::PolicyProvider policy_provider_;
-
-
-
- bool system_rebooted_{false};
- ActionProcessor processor_;
- };
- }
- #endif
|