Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(577)

Unified Diff: utils.cc

Issue 3041044: Don't schedule periodic update checks for non-official builds. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git
Patch Set: Fix persistent storage on stack bug. Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « utils.h ('k') | utils_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils.cc
diff --git a/utils.cc b/utils.cc
index 4c5a195cf4982246ce06d1c68f1ced5a12856b5a..d691739bb3100d77cb4da3ad6fe4a78327569f70 100644
--- a/utils.cc
+++ b/utils.cc
@@ -16,6 +16,7 @@
#include <algorithm>
#include "chromeos/obsolete_logging.h"
#include "update_engine/file_writer.h"
+#include "update_engine/omaha_request_params.h"
#include "update_engine/subprocess.h"
using std::min;
@@ -26,6 +27,15 @@ namespace chromeos_update_engine {
namespace utils {
+bool IsOfficialBuild() {
+ OmahaRequestDeviceParams params;
+ if (!params.Init("", "")) {
+ return true;
+ }
+ return params.app_track != "buildbot-build" &&
+ params.app_track != "developer-build";
+}
+
bool WriteFile(const char* path, const char* data, int data_len) {
DirectFileWriter writer;
TEST_AND_RETURN_FALSE_ERRNO(0 == writer.Open(path,
« no previous file with comments | « utils.h ('k') | utils_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698