update_engine: Use clock and fake clock from SystemState
No need to pass clock and fake clock anywhere anymore. This CL makes it
to just use those objects available from SystemState and
FakeSystemState.
BUG=b:171829801
TEST=cros_workon_make --board reef --test update_engine
Change-Id: I9a3cf6dd2057620c11b862d3317b83489c76f3ca
Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/2546625
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/update_manager/default_policy.h b/update_manager/default_policy.h
index 006bcb7..c93bb46 100644
--- a/update_manager/default_policy.h
+++ b/update_manager/default_policy.h
@@ -22,7 +22,6 @@
#include <base/time/time.h>
-#include "update_engine/common/clock_interface.h"
#include "update_engine/update_manager/policy.h"
namespace chromeos_update_manager {
@@ -60,9 +59,8 @@
// actual policy being used by the UpdateManager.
class DefaultPolicy : public Policy {
public:
- explicit DefaultPolicy(chromeos_update_engine::ClockInterface* clock);
- DefaultPolicy() : DefaultPolicy(nullptr) {}
- ~DefaultPolicy() override {}
+ DefaultPolicy() : aux_state_(new DefaultPolicyState()) {}
+ ~DefaultPolicy() override = default;
// Policy overrides.
EvalStatus UpdateCheckAllowed(EvaluationContext* ec,
@@ -99,9 +97,6 @@
std::string PolicyName() const override { return "DefaultPolicy"; }
private:
- // A clock interface.
- chromeos_update_engine::ClockInterface* clock_;
-
// An auxiliary state object.
std::unique_ptr<DefaultPolicyState> aux_state_;