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

Unified Diff: utils.cc

Issue 3398018: AU: Skip all automatic update checks if OOBE is not complete. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git
Patch Set: fix comment Created 10 years, 3 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') | no next file » | 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 1d1cb7d51a5a63cf32bd1b1e4db2b02fa83c7bfe..e0f20cf0064fe386956a449dd2060e3d0709e73d 100644
--- a/utils.cc
+++ b/utils.cc
@@ -37,6 +37,8 @@ namespace chromeos_update_engine {
namespace utils {
+static const char kOOBECompletedMarker[] = "/home/chronos/.oobe_completed";
+
bool IsOfficialBuild() {
OmahaRequestDeviceParams params;
if (!params.Init("", "")) {
@@ -46,6 +48,10 @@ bool IsOfficialBuild() {
params.app_track != "developer-build";
}
+bool IsOOBEComplete() {
+ return file_util::PathExists(FilePath(kOOBECompletedMarker));
+}
+
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') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698