diff --git a/common/download_action.h b/common/download_action.h
index 18e5853..e154856 100644
--- a/common/download_action.h
+++ b/common/download_action.h
@@ -106,29 +106,7 @@
 
   HttpFetcher* http_fetcher() { return http_fetcher_.get(); }
 
-  // Returns the p2p file id for the file being written or the empty
-  // string if we're not writing to a p2p file.
-  std::string p2p_file_id() { return p2p_file_id_; }
-
  private:
-  // Closes the file descriptor for the p2p file being written and
-  // clears |p2p_file_id_| to indicate that we're no longer sharing
-  // the file. If |delete_p2p_file| is True, also deletes the file.
-  // If there is no p2p file descriptor, this method does nothing.
-  void CloseP2PSharingFd(bool delete_p2p_file);
-
-  // Starts sharing the p2p file. Must be called before
-  // WriteToP2PFile(). Returns True if this worked.
-  bool SetupP2PSharingFd();
-
-  // Writes |length| bytes of payload from |data| into |file_offset|
-  // of the p2p file. Also does validation checks; for example ensures we
-  // don't end up with a file with holes in it.
-  //
-  // This method does nothing if SetupP2PSharingFd() hasn't been
-  // called or if CloseP2PSharingFd() has been called.
-  void WriteToP2PFile(const void* data, size_t length, off_t file_offset);
-
   // Attempt to load cached manifest data from prefs
   // return true on success, false otherwise.
   bool LoadCachedManifest(int64_t manifest_size);
@@ -169,17 +147,6 @@
   uint64_t bytes_total_{0};
   bool download_active_{false};
 
-  // The file-id for the file we're sharing or the empty string
-  // if we're not using p2p to share.
-  std::string p2p_file_id_;
-
-  // The file descriptor for the p2p file used for caching the payload or -1
-  // if we're not using p2p to share.
-  int p2p_sharing_fd_;
-
-  // Set to |false| if p2p file is not visible.
-  bool p2p_visible_;
-
   // Loaded from prefs before downloading any payload.
   size_t resume_payload_index_{0};
 
diff --git a/download_action.cc b/download_action.cc
index fa29139..076ee2c 100644
--- a/download_action.cc
+++ b/download_action.cc
@@ -29,11 +29,8 @@
 #include "update_engine/common/boot_control_interface.h"
 #include "update_engine/common/error_code_utils.h"
 #include "update_engine/common/multi_range_http_fetcher.h"
-#include "update_engine/common/system_state.h"
+#include "update_engine/common/prefs_interface.h"
 #include "update_engine/common/utils.h"
-#include "update_engine/cros/omaha_request_params.h"
-#include "update_engine/cros/p2p_manager.h"
-#include "update_engine/cros/payload_state_interface.h"
 
 using base::FilePath;
 using std::string;
@@ -52,117 +49,10 @@
       interactive_(interactive),
       writer_(nullptr),
       code_(ErrorCode::kSuccess),
-      delegate_(nullptr),
-      p2p_sharing_fd_(-1),
-      p2p_visible_(true) {}
+      delegate_(nullptr) {}
 
 DownloadAction::~DownloadAction() {}
 
-void DownloadAction::CloseP2PSharingFd(bool delete_p2p_file) {
-  if (p2p_sharing_fd_ != -1) {
-    if (close(p2p_sharing_fd_) != 0) {
-      PLOG(ERROR) << "Error closing p2p sharing fd";
-    }
-    p2p_sharing_fd_ = -1;
-  }
-
-  if (delete_p2p_file) {
-    FilePath path =
-        SystemState::Get()->p2p_manager()->FileGetPath(p2p_file_id_);
-    if (unlink(path.value().c_str()) != 0) {
-      PLOG(ERROR) << "Error deleting p2p file " << path.value();
-    } else {
-      LOG(INFO) << "Deleted p2p file " << path.value();
-    }
-  }
-
-  // Don't use p2p from this point onwards.
-  p2p_file_id_.clear();
-}
-
-bool DownloadAction::SetupP2PSharingFd() {
-  P2PManager* p2p_manager = SystemState::Get()->p2p_manager();
-
-  if (!p2p_manager->FileShare(p2p_file_id_, payload_->size)) {
-    LOG(ERROR) << "Unable to share file via p2p";
-    CloseP2PSharingFd(true);  // delete p2p file
-    return false;
-  }
-
-  // File has already been created (and allocated, xattrs been
-  // populated etc.) by FileShare() so just open it for writing.
-  FilePath path = p2p_manager->FileGetPath(p2p_file_id_);
-  p2p_sharing_fd_ = open(path.value().c_str(), O_WRONLY);
-  if (p2p_sharing_fd_ == -1) {
-    PLOG(ERROR) << "Error opening file " << path.value();
-    CloseP2PSharingFd(true);  // Delete p2p file.
-    return false;
-  }
-
-  // Ensure file to share is world-readable, otherwise
-  // p2p-server and p2p-http-server can't access it.
-  //
-  // (Q: Why doesn't the file have mode 0644 already? A: Because
-  // the process-wide umask is set to 0700 in main.cc.)
-  if (fchmod(p2p_sharing_fd_, 0644) != 0) {
-    PLOG(ERROR) << "Error setting mode 0644 on " << path.value();
-    CloseP2PSharingFd(true);  // Delete p2p file.
-    return false;
-  }
-
-  // All good.
-  LOG(INFO) << "Writing payload contents to " << path.value();
-  p2p_manager->FileGetVisible(p2p_file_id_, &p2p_visible_);
-  return true;
-}
-
-void DownloadAction::WriteToP2PFile(const void* data,
-                                    size_t length,
-                                    off_t file_offset) {
-  if (p2p_sharing_fd_ == -1) {
-    if (!SetupP2PSharingFd())
-      return;
-  }
-
-  // Check that the file is at least |file_offset| bytes long - if
-  // it's not something is wrong and we must immediately delete the
-  // file to avoid propagating this problem to other peers.
-  //
-  // How can this happen? It could be that we're resuming an update
-  // after a system crash... in this case, it could be that
-  //
-  //  1. the p2p file didn't get properly synced to stable storage; or
-  //  2. the file was deleted at bootup (it's in /var/cache after all); or
-  //  3. other reasons
-  off_t p2p_size = utils::FileSize(p2p_sharing_fd_);
-  if (p2p_size < 0) {
-    PLOG(ERROR) << "Error getting file status for p2p file";
-    CloseP2PSharingFd(true);  // Delete p2p file.
-    return;
-  }
-  if (p2p_size < file_offset) {
-    LOG(ERROR) << "Wanting to write to file offset " << file_offset
-               << " but existing p2p file is only " << p2p_size << " bytes.";
-    CloseP2PSharingFd(true);  // Delete p2p file.
-    return;
-  }
-
-  off_t cur_file_offset = lseek(p2p_sharing_fd_, file_offset, SEEK_SET);
-  if (cur_file_offset != static_cast<off_t>(file_offset)) {
-    PLOG(ERROR) << "Error seeking to position " << file_offset
-                << " in p2p file";
-    CloseP2PSharingFd(true);  // Delete p2p file.
-  } else {
-    // OK, seeking worked, now write the data
-    ssize_t bytes_written = write(p2p_sharing_fd_, data, length);
-    if (bytes_written != static_cast<ssize_t>(length)) {
-      PLOG(ERROR) << "Error writing " << length << " bytes at file offset "
-                  << file_offset << " in p2p file";
-      CloseP2PSharingFd(true);  // Delete p2p file.
-    }
-  }
-}
-
 void DownloadAction::PerformAction() {
   http_fetcher_->set_delegate(this);
 
@@ -188,7 +78,7 @@
         install_plan_.payloads[i].already_applied = true;
     }
   }
-  // TODO(senj): check that install plan has at least one payload.
+  CHECK_GE(install_plan_.payloads.size(), 1UL);
   if (!payload_)
     payload_ = &install_plan_.payloads[0];
 
@@ -295,46 +185,6 @@
     }
   }
 
-#ifndef __ANDROID__
-  if (SystemState::Get() != nullptr) {
-    const PayloadStateInterface* payload_state =
-        SystemState::Get()->payload_state();
-    string file_id = utils::CalculateP2PFileId(payload_->hash, payload_->size);
-    if (payload_state->GetUsingP2PForSharing()) {
-      // If we're sharing the update, store the file_id to convey
-      // that we should write to the file.
-      p2p_file_id_ = file_id;
-      LOG(INFO) << "p2p file id: " << p2p_file_id_;
-    } else {
-      // Even if we're not sharing the update, it could be that
-      // there's a partial file from a previous attempt with the same
-      // hash. If this is the case, we NEED to clean it up otherwise
-      // we're essentially timing out other peers downloading from us
-      // (since we're never going to complete the file).
-      FilePath path = SystemState::Get()->p2p_manager()->FileGetPath(file_id);
-      if (!path.empty()) {
-        if (unlink(path.value().c_str()) != 0) {
-          PLOG(ERROR) << "Error deleting p2p file " << path.value();
-        } else {
-          LOG(INFO) << "Deleting partial p2p file " << path.value()
-                    << " since we're not using p2p to share.";
-        }
-      }
-    }
-
-    // Tweak timeouts on the HTTP fetcher if we're downloading from a
-    // local peer.
-    if (payload_state->GetUsingP2PForDownloading() &&
-        payload_state->GetP2PUrl() == install_plan_.download_url) {
-      LOG(INFO) << "Tweaking HTTP fetcher since we're downloading via p2p";
-      http_fetcher_->set_low_speed_limit(kDownloadP2PLowSpeedLimitBps,
-                                         kDownloadP2PLowSpeedTimeSeconds);
-      http_fetcher_->set_max_retry_count(kDownloadP2PMaxRetryCount);
-      http_fetcher_->set_connect_timeout(kDownloadP2PConnectTimeoutSeconds);
-    }
-  }
-#endif
-
   http_fetcher_->BeginTransfer(install_plan_.download_url);
 }
 
@@ -352,7 +202,6 @@
     writer_ = nullptr;
   }
   download_active_ = false;
-  CloseP2PSharingFd(false);  // Keep p2p file.
   // Terminates the transfer. The action is terminated, if necessary, when the
   // TransferTerminated callback is received.
   http_fetcher_->TerminateTransfer();
@@ -365,11 +214,6 @@
 bool DownloadAction::ReceivedBytes(HttpFetcher* fetcher,
                                    const void* bytes,
                                    size_t length) {
-  // Note that bytes_received_ is the current offset.
-  if (!p2p_file_id_.empty()) {
-    WriteToP2PFile(bytes, length, bytes_received_);
-  }
-
   bytes_received_ += length;
   uint64_t bytes_downloaded_total =
       bytes_received_previous_payloads_ + bytes_received_;
@@ -382,9 +226,6 @@
                  << ") in DeltaPerformer's Write method when "
                  << "processing the received payload -- Terminating processing";
     }
-    // Delete p2p file, if applicable.
-    if (!p2p_file_id_.empty())
-      CloseP2PSharingFd(true);
     // Don't tell the action processor that the action is complete until we get
     // the TransferTerminated callback. Otherwise, this and the HTTP fetcher
     // objects may get destroyed before all callbacks are complete.
@@ -392,14 +233,6 @@
     return false;
   }
 
-  // Call p2p_manager_->FileMakeVisible() when we've successfully
-  // verified the manifest!
-  if (!p2p_visible_ && SystemState::Get() && delta_performer_.get() &&
-      delta_performer_->IsManifestValid()) {
-    LOG(INFO) << "Manifest has been validated. Making p2p file visible.";
-    SystemState::Get()->p2p_manager()->FileMakeVisible(p2p_file_id_);
-    p2p_visible_ = true;
-  }
   return true;
 }
 
@@ -418,21 +251,7 @@
     if (delta_performer_ && !payload_->already_applied)
       code = delta_performer_->VerifyPayload(payload_->hash, payload_->size);
     if (code == ErrorCode::kSuccess) {
-      if (payload_ < &install_plan_.payloads.back() &&
-          SystemState::Get()->payload_state()->NextPayload()) {
-        LOG(INFO) << "Incrementing to next payload";
-        // No need to reset if this payload was already applied.
-        if (delta_performer_ && !payload_->already_applied)
-          DeltaPerformer::ResetUpdateProgress(prefs_, false);
-        // Start downloading next payload.
-        bytes_received_previous_payloads_ += payload_->size;
-        payload_++;
-        install_plan_.download_url =
-            SystemState::Get()->payload_state()->GetCurrentUrl();
-        StartDownloading();
-        return;
-      }
-
+      CHECK_EQ(install_plan_.payloads.size(), 1UL);
       // All payloads have been applied and verified.
       if (delegate_)
         delegate_->DownloadComplete();
@@ -446,9 +265,6 @@
     } else {
       LOG(ERROR) << "Download of " << install_plan_.download_url
                  << " failed due to payload verification error.";
-      // Delete p2p file, if applicable.
-      if (!p2p_file_id_.empty())
-        CloseP2PSharingFd(true);
     }
   }
 
