update_engine: UpdateAttempter manages lifetime of Excluder
Prior to adding the exclusion logic within various |Action|s, the
|UpdateAttempter| provides a way to access the |Excluder| encapsulated
within the |UpdateAttempter| singleton.
|PayloadState| uses |Excluder| from |UpdateAttempter| as a member.
BUG=chromium:928805
TEST=FEATURES=test emerge-$B update_engine
TEST=USE="${USE} -dlc" FEATURES=test emerge-$B update_engine
Change-Id: I63ace436e8aacd349e13004fe1e2f4dd37479978
Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/2190236
Tested-by: Jae Hoon Kim <kimjae@chromium.org>
Reviewed-by: Amin Hassani <ahassani@chromium.org>
Commit-Queue: Jae Hoon Kim <kimjae@chromium.org>
Auto-Submit: Jae Hoon Kim <kimjae@chromium.org>
diff --git a/payload_state.cc b/payload_state.cc
index 5facdff..2e07ad9 100644
--- a/payload_state.cc
+++ b/payload_state.cc
@@ -37,6 +37,7 @@
#include "update_engine/omaha_request_params.h"
#include "update_engine/payload_consumer/install_plan.h"
#include "update_engine/system_state.h"
+#include "update_engine/update_attempter.h"
using base::Time;
using base::TimeDelta;
@@ -60,6 +61,8 @@
PayloadState::PayloadState()
: prefs_(nullptr),
+ powerwash_safe_prefs_(nullptr),
+ excluder_(nullptr),
using_p2p_for_downloading_(false),
p2p_num_attempts_(0),
payload_attempt_number_(0),
@@ -79,6 +82,7 @@
system_state_ = system_state;
prefs_ = system_state_->prefs();
powerwash_safe_prefs_ = system_state_->powerwash_safe_prefs();
+ excluder_ = system_state_->update_attempter()->GetExcluder();
LoadResponseSignature();
LoadPayloadAttemptNumber();
LoadFullPayloadAttemptNumber();