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/image_properties.h b/cros/image_properties.h
index 4957d12..1297547 100644
--- a/cros/image_properties.h
+++ b/cros/image_properties.h
@@ -25,8 +25,6 @@
 
 namespace chromeos_update_engine {
 
-class SystemState;
-
 // The read-only system properties of the running image.
 struct ImageProperties {
   // The product id of the image used for all channels, except canary.
@@ -77,16 +75,15 @@
 // Loads all the image properties from the running system. In case of error
 // loading any of these properties from the read-only system image a default
 // value may be returned instead.
-ImageProperties LoadImageProperties(SystemState* system_state);
+ImageProperties LoadImageProperties();
 
 // Loads the mutable image properties from the stateful partition if found or
 // the system image otherwise.
-MutableImageProperties LoadMutableImageProperties(SystemState* system_state);
+MutableImageProperties LoadMutableImageProperties();
 
 // Stores the mutable image properties in the stateful partition. Returns
 // whether the operation succeeded.
-bool StoreMutableImageProperties(SystemState* system_state,
-                                 const MutableImageProperties& properties);
+bool StoreMutableImageProperties(const MutableImageProperties& properties);
 
 // Logs the image properties.
 void LogImageProperties();