update_engine: Make SystemState accessible from everywhere
SystemState is supposed to be a global context and is used lamost
everywhere. So instead of passing it to functions and keeping multiple
pointers to it, its better to do what we did in dlcservice and make it a
singleton class with a getter that can be get from everywhere.
BUG=b:171829801
TEST=unittests
Change-Id: I3b2de9394b7769b3911195ca52d61dbe49afd4dd
Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/2521792
Commit-Queue: Amin Hassani <ahassani@chromium.org>
Tested-by: Amin Hassani <ahassani@chromium.org>
Reviewed-by: Jae Hoon Kim <kimjae@chromium.org>
diff --git a/cros/omaha_response_handler_action.h b/cros/omaha_response_handler_action.h
index f3b821e..9842c94 100644
--- a/cros/omaha_response_handler_action.h
+++ b/cros/omaha_response_handler_action.h
@@ -22,7 +22,6 @@
#include <gtest/gtest_prod.h> // for FRIEND_TEST
#include "update_engine/common/action.h"
-#include "update_engine/common/system_state.h"
#include "update_engine/cros/omaha_request_action.h"
#include "update_engine/payload_consumer/install_plan.h"
@@ -42,7 +41,7 @@
class OmahaResponseHandlerAction : public Action<OmahaResponseHandlerAction> {
public:
- explicit OmahaResponseHandlerAction(SystemState* system_state);
+ OmahaResponseHandlerAction();
typedef ActionTraits<OmahaResponseHandlerAction>::InputObjectType
InputObjectType;
@@ -65,9 +64,6 @@
// of the system and the contents of the Omaha response. False otherwise.
bool AreHashChecksMandatory(const OmahaResponse& response);
- // Global system context.
- SystemState* system_state_;
-
// The install plan, if we have an update.
InstallPlan install_plan_;