diff --git a/p2p_manager.cc b/p2p_manager.cc
index 8c48601..2ec827a 100644
--- a/p2p_manager.cc
+++ b/p2p_manager.cc
@@ -190,19 +190,14 @@
   // either the crosh flag OR by Enterprise Policy, e.g. the following
   // truth table:
   //
+  //  crosh_flag == FALSE  &&  enterprise_policy == unset  -> use_p2p == *
+  //  crosh_flag == TRUE   &&  enterprise_policy == unset  -> use_p2p == TRUE
   //  crosh_flag == FALSE  &&  enterprise_policy == FALSE  -> use_p2p == FALSE
   //  crosh_flag == FALSE  &&  enterprise_policy == TRUE   -> use_p2p == TRUE
   //  crosh_flag == TRUE   &&  enterprise_policy == FALSE  -> use_p2p == TRUE
   //  crosh_flag == TRUE   &&  enterprise_policy == TRUE   -> use_p2p == TRUE
-
-  if (device_policy_ != nullptr) {
-    if (device_policy_->GetAuP2PEnabled(&p2p_enabled)) {
-      if (p2p_enabled) {
-        LOG(INFO) << "Enterprise Policy indicates that p2p is enabled.";
-        return true;
-      }
-    }
-  }
+  //
+  // *: TRUE if Enterprise Enrolled, FALSE otherwise.
 
   if (prefs_ != nullptr &&
       prefs_->Exists(kPrefsP2PEnabled) &&
@@ -212,6 +207,23 @@
     return true;
   }
 
+  if (device_policy_ != nullptr) {
+    if (device_policy_->GetAuP2PEnabled(&p2p_enabled)) {
+      if (p2p_enabled) {
+        LOG(INFO) << "Enterprise Policy indicates that p2p is enabled.";
+        return true;
+      }
+    } else {
+      // Enterprise-enrolled devices have an empty owner in their device policy.
+      string owner;
+      if (!device_policy_->GetOwner(&owner) || owner.empty()) {
+        LOG(INFO) << "No p2p_enabled setting in Enterprise Policy but device "
+                  << "is Enterprise Enrolled so allowing p2p.";
+        return true;
+      }
+    }
+  }
+
   LOG(INFO) << "Neither Enterprise Policy nor crosh flag indicates that p2p "
             << "is enabled.";
   return false;
diff --git a/p2p_manager_unittest.cc b/p2p_manager_unittest.cc
index 456c8ad..59ab152 100644
--- a/p2p_manager_unittest.cc
+++ b/p2p_manager_unittest.cc
@@ -139,6 +139,60 @@
   EXPECT_TRUE(utils::RecursiveUnlinkDir(temp_dir));
 }
 
+// Check that IsP2PEnabled() returns TRUE if
+// - The crosh flag is not set.
+// - Enterprise Policy is not set.
+// - Device is Enterprise Enrolled.
+TEST_F(P2PManagerTest, P2PEnabledEnterpriseEnrolledDevicesDefaultToEnabled) {
+  string temp_dir;
+  Prefs prefs;
+  EXPECT_TRUE(utils::MakeTempDirectory("PayloadStateP2PTests.XXXXXX",
+                                       &temp_dir));
+  prefs.Init(base::FilePath(temp_dir));
+
+  scoped_ptr<P2PManager> manager(P2PManager::Construct(test_conf_,
+                                                       &prefs, "cros_au", 3));
+  scoped_ptr<policy::MockDevicePolicy> device_policy(
+      new policy::MockDevicePolicy());
+  // We return an empty owner as this is an enterprise.
+  EXPECT_CALL(*device_policy, GetOwner(testing::_)).WillRepeatedly(
+      DoAll(testing::SetArgumentPointee<0>(std::string("")),
+            testing::Return(true)));
+  manager->SetDevicePolicy(device_policy.get());
+  EXPECT_TRUE(manager->IsP2PEnabled());
+
+  EXPECT_TRUE(utils::RecursiveUnlinkDir(temp_dir));
+}
+
+// Check that IsP2PEnabled() returns FALSE if
+// - The crosh flag is not set.
+// - Enterprise Policy is set to FALSE.
+// - Device is Enterprise Enrolled.
+TEST_F(P2PManagerTest, P2PEnabledEnterpriseEnrolledDevicesOverrideDefault) {
+  string temp_dir;
+  Prefs prefs;
+  EXPECT_TRUE(utils::MakeTempDirectory("PayloadStateP2PTests.XXXXXX",
+                                       &temp_dir));
+  prefs.Init(base::FilePath(temp_dir));
+
+  scoped_ptr<P2PManager> manager(P2PManager::Construct(test_conf_,
+                                                       &prefs, "cros_au", 3));
+  scoped_ptr<policy::MockDevicePolicy> device_policy(
+      new policy::MockDevicePolicy());
+  // We return an empty owner as this is an enterprise.
+  EXPECT_CALL(*device_policy, GetOwner(testing::_)).WillRepeatedly(
+      DoAll(testing::SetArgumentPointee<0>(std::string("")),
+            testing::Return(true)));
+  // Make Enterprise Policy indicate p2p is not enabled.
+  EXPECT_CALL(*device_policy, GetAuP2PEnabled(testing::_)).WillRepeatedly(
+      DoAll(testing::SetArgumentPointee<0>(false),
+            testing::Return(true)));
+  manager->SetDevicePolicy(device_policy.get());
+  EXPECT_FALSE(manager->IsP2PEnabled());
+
+  EXPECT_TRUE(utils::RecursiveUnlinkDir(temp_dir));
+}
+
 // Check that we keep the $N newest files with the .$EXT.p2p extension.
 TEST_F(P2PManagerTest, Housekeeping) {
   scoped_ptr<P2PManager> manager(P2PManager::Construct(test_conf_,
