Add PowerManagerInterface.
Hide all dbus stuff under the new interface, so that we can implement
a real power_manager for android in the future if needed.
Test: mma
Bug: 28800946
Change-Id: I26c883f4d0bc71f0410dfe4422b22bdd9df70575
diff --git a/real_system_state.h b/real_system_state.h
index 758c995..8e7acef 100644
--- a/real_system_state.h
+++ b/real_system_state.h
@@ -24,7 +24,6 @@
#include <debugd/dbus-proxies.h>
#include <metrics/metrics_library.h>
#include <policy/device_policy.h>
-#include <power_manager/dbus-proxies.h>
#include <session_manager/dbus-proxies.h>
#include "update_engine/common/boot_control_interface.h"
@@ -37,6 +36,7 @@
#include "update_engine/dbus_connection.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"
#include "update_engine/weave_service_interface.h"
@@ -120,9 +120,8 @@
return update_manager_.get();
}
- inline org::chromium::PowerManagerProxyInterface* power_manager_proxy()
- override {
- return &power_manager_proxy_;
+ inline PowerManagerInterface* power_manager() override {
+ return power_manager_.get();
}
inline bool system_rebooted() override { return system_rebooted_; }
@@ -130,10 +129,12 @@
private:
// Real DBus proxies using the DBus connection.
org::chromium::debugdProxy debugd_proxy_;
- org::chromium::PowerManagerProxy power_manager_proxy_;
org::chromium::SessionManagerInterfaceProxy session_manager_proxy_;
LibCrosProxy libcros_proxy_;
+ // Interface for the power manager.
+ std::unique_ptr<PowerManagerInterface> power_manager_;
+
// Interface for the clock.
std::unique_ptr<BootControlInterface> boot_control_;