update_engine: UM: Policy to distinguish between P2P downloading and sharing.

Previously, the UpdateCanStart policy returned a single Boolean,
indicating whether "P2P is allowed". However, the policy has been
incorrectly reproducing decisions made by current code, whereas P2P
sharing is always allowed (if P2P is enabled) but P2P downloading has
additional limitations. This CL introduces distinct flags for both
downloading and sharing, and reasons about them specifically.

This also adds a constraints whereas P2P downloading is allowed for
non-interactive updates only.

BUG=chromium:420732
TEST=Unit tests.

Change-Id: Ife4b6b2830c999745a0d4239089034c863de6388
Reviewed-on: https://chromium-review.googlesource.com/222262
Tested-by: Gilad Arnold <garnold@chromium.org>
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Gilad Arnold <garnold@chromium.org>
diff --git a/update_manager/chromeos_policy.h b/update_manager/chromeos_policy.h
index e3e9c5f..5108bc2 100644
--- a/update_manager/chromeos_policy.h
+++ b/update_manager/chromeos_policy.h
@@ -86,9 +86,9 @@
   FRIEND_TEST(UmChromeOSPolicyTest,
               UpdateCanStartAllowedInteractivePreventsScattering);
   FRIEND_TEST(UmChromeOSPolicyTest,
-              UpdateCanStartAllowedP2PBlockedDueToNumAttempts);
+              UpdateCanStartAllowedP2PDownloadBlockedDueToNumAttempts);
   FRIEND_TEST(UmChromeOSPolicyTest,
-              UpdateCanStartAllowedP2PBlockedDueToAttemptsPeriod);
+              UpdateCanStartAllowedP2PDownloadBlockedDueToAttemptsPeriod);
 
   // Auxiliary constant (zero by default).
   const base::TimeDelta kZeroInterval;