update_engine: Policy determines P2P enabled status.

This switches the P2P Manager to use the newly introduced Update Manger
policy requests in determining whether P2P is enabled on the system.
There is a policy request for the initial state (P2PEnabled, sync)  and
for tracking changes (P2PEnabledChanged, async), with the latest known
value being cached by the P2P Manager.

This also reverses a recent change that moved P2P prefs setting into the
P2PManager. In the absence of any additional logic (now cleared) there
was no point in having a dedicated method just for that, and so
dbus_service writes the prefs value directly. This affords us removing
the prefs argument when initializing the P2PManager.

BUG=chromium:425233
TEST=Unit tests.

Change-Id: I53280f05da8fe532b6502c175a8cc9ddc1e15a87
Reviewed-on: https://chromium-review.googlesource.com/226937
Tested-by: Gilad Arnold <garnold@chromium.org>
Reviewed-by: David Zeuthen <zeuthen@chromium.org>
Commit-Queue: Gilad Arnold <garnold@chromium.org>
diff --git a/fake_p2p_manager.h b/fake_p2p_manager.h
index 9ec0812..a00b91f 100644
--- a/fake_p2p_manager.h
+++ b/fake_p2p_manager.h
@@ -19,8 +19,7 @@
     ensure_p2p_running_result_(false),
     ensure_p2p_not_running_result_(false),
     perform_housekeeping_result_(false),
-    count_shared_files_result_(0),
-    set_p2p_enabled_pref_result_(true) {}
+    count_shared_files_result_(0) {}
 
   virtual ~FakeP2PManager() {}
 
@@ -80,10 +79,6 @@
     return count_shared_files_result_;
   }
 
-  bool SetP2PEnabledPref(bool /* enabled */) override {
-    return set_p2p_enabled_pref_result_;
-  }
-
   // Methods for controlling what the fake returns and how it acts.
   void SetP2PEnabled(bool is_p2p_enabled) {
     is_p2p_enabled_ = is_p2p_enabled;
@@ -105,10 +100,6 @@
     count_shared_files_result_ = count_shared_files_result;
   }
 
-  void SetSetP2PEnabledPrefResult(bool set_p2p_enabled_pref_result) {
-    set_p2p_enabled_pref_result_ = set_p2p_enabled_pref_result;
-  }
-
   void SetLookupUrlForFileResult(const std::string& url) {
     lookup_url_for_file_result_ = url;
   }
@@ -119,7 +110,6 @@
   bool ensure_p2p_not_running_result_;
   bool perform_housekeeping_result_;
   int count_shared_files_result_;
-  bool set_p2p_enabled_pref_result_;
   std::string lookup_url_for_file_result_;
 
   DISALLOW_COPY_AND_ASSIGN(FakeP2PManager);