AU: Skip all automatic update checks if OOBE is not complete.

Right before an automatic update check is initiated, check if OOBE is
complete. If it is, go ahead with the check. Otherwise, skip the check
and schedule a new one as if it is the first one.

BUG=5377
TEST=unit tests, gmerged on device and tried with/without .oobe_completed.

Change-Id: I713e156a176b58a4dd04a01bca340b88277b0361

Review URL: http://codereview.chromium.org/3398018
diff --git a/utils.cc b/utils.cc
index 6ebffd0..6006eb8 100644
--- a/utils.cc
+++ b/utils.cc
@@ -37,6 +37,8 @@
 
 namespace utils {
 
+static const char kOOBECompletedMarker[] = "/home/chronos/.oobe_completed";
+
 bool IsOfficialBuild() {
   OmahaRequestDeviceParams params;
   if (!params.Init("", "")) {
@@ -46,6 +48,10 @@
       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,