p2p: Remove IsP2PAllowedForInteractiveChecks() function and its users
This is no longer needed now that it's possible to just pass
-interactive=false to the update_engine_client program.
BUG=chromium:273251
TEST=Manually tested + unit tests pass.
Change-Id: If8b1d600125d7a3108a81471dbcd2f9ca00a6988
Reviewed-on: https://chromium-review.googlesource.com/168446
Reviewed-by: David Zeuthen <zeuthen@chromium.org>
Tested-by: David Zeuthen <zeuthen@chromium.org>
Commit-Queue: David Zeuthen <zeuthen@chromium.org>
diff --git a/constants.cc b/constants.cc
index ffcd112..11d5901 100644
--- a/constants.cc
+++ b/constants.cc
@@ -20,9 +20,6 @@
const char kSystemRebootedMarkerFile[] = "/tmp/update_engine_update_recorded";
-const char kP2PAllowInteractiveMarkerFile[] =
- "/mnt/stateful_partition/p2p-allow-interactive";
-
// Constants defining keys for the persisted state of update engine.
const char kPrefsBackoffExpiryTime[] = "backoff-expiry-time";
const char kPrefsCertificateReportToSendDownload[] =
diff --git a/constants.h b/constants.h
index b221331..3079108 100644
--- a/constants.h
+++ b/constants.h
@@ -26,10 +26,6 @@
// Path to the stateful partition on the root filesystem.
extern const char kStatefulPartition[];
-// Path to the marker file to allow p2p on interactive update attempts.
-// See utils::IsP2PAllowedForInteractiveChecks().
-extern const char kP2PAllowInteractiveMarkerFile[];
-
// Constants related to preferences.
extern const char kPrefsBackoffExpiryTime[];
extern const char kPrefsCertificateReportToSendDownload[];
diff --git a/update_attempter.cc b/update_attempter.cc
index 72d77c9..ea1c619 100644
--- a/update_attempter.cc
+++ b/update_attempter.cc
@@ -241,18 +241,8 @@
LOG(INFO) << "Non-interactive check - allowing p2p for downloading";
use_p2p_for_downloading = true;
} else {
- // TODO(zeuthen,chromium:273251): Remove this marker once we
- // can easily trigger non-interactive checks.
- if (utils::IsP2PAllowedForInteractiveChecks()) {
- LOG(INFO) << "Found marker file at "
- << kP2PAllowInteractiveMarkerFile
- << " - allowing p2p for downloading despite the fact"
- << " the attempt is interactive.";
- use_p2p_for_downloading = true;
- } else {
- LOG(INFO) << "Forcibly disabling use of p2p for downloading "
- << "since this update attempt is interactive.";
- }
+ LOG(INFO) << "Forcibly disabling use of p2p for downloading "
+ << "since this update attempt is interactive.";
}
}
}
diff --git a/utils.cc b/utils.cc
index 007d154..cd7f384 100644
--- a/utils.cc
+++ b/utils.cc
@@ -1027,11 +1027,6 @@
return true;
}
-bool IsP2PAllowedForInteractiveChecks() {
- struct stat statbuf;
- return stat(kP2PAllowInteractiveMarkerFile, &statbuf) == 0;
-}
-
Time TimeFromStructTimespec(struct timespec *ts) {
int64 us = static_cast<int64>(ts->tv_sec) * Time::kMicrosecondsPerSecond +
static_cast<int64>(ts->tv_nsec) / Time::kNanosecondsPerMicrosecond;
diff --git a/utils.h b/utils.h
index 5518da6..2dd8095 100644
--- a/utils.h
+++ b/utils.h
@@ -35,16 +35,6 @@
// boot mode. Returns false if the boot mode is developer.
bool IsNormalBootMode();
-// Returns true if and only if P2P is allowed for interactive update
-// checks. This is implemented by checking the existence of a marker
-// file that can be created by the following command
-//
-// # touch /mnt/stateful_partition/p2p-allow-interactive
-//
-// This function returns false if the required marker file does not
-// exist or if an error occurred.
-bool IsP2PAllowedForInteractiveChecks();
-
// Converts a struct timespec representing a number of seconds since
// the Unix epoch to a base::Time. Sub-microsecond time is rounded
// down.