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/update_attempter.h b/update_attempter.h
index 1bf552b..dd958f5 100644
--- a/update_attempter.h
+++ b/update_attempter.h
@@ -37,6 +37,7 @@
 #include "update_engine/client_library/include/update_engine/update_status.h"
 #include "update_engine/common/action_processor.h"
 #include "update_engine/common/cpu_limiter.h"
+#include "update_engine/common/excluder_interface.h"
 #include "update_engine/common/proxy_resolver.h"
 #include "update_engine/omaha_request_builder_xml.h"
 #include "update_engine/omaha_request_params.h"
@@ -184,6 +185,9 @@
   // Called at update_engine startup to do various house-keeping.
   void UpdateEngineStarted();
 
+  // Returns the |Excluder| that is currently held onto.
+  virtual ExcluderInterface* GetExcluder() const { return excluder_.get(); }
+
   // Reloads the device policy from libbrillo. Note: This method doesn't
   // cause a real-time policy fetch from the policy server. It just reloads the
   // latest value that libbrillo has cached. libbrillo fetches the policies
@@ -571,6 +575,9 @@
   // This is the session ID used to track update flow to Omaha.
   std::string session_id_;
 
+  // Interface for excluder.
+  std::unique_ptr<ExcluderInterface> excluder_;
+
   DISALLOW_COPY_AND_ASSIGN(UpdateAttempter);
 };