[art] Remove boot complete marker

ART doesn't load the boot image from /data anymore and the marker is
useless.

Test: device boots
Bug: 143899228

(cherry picked from commit e6f21c4597de7c4060ef5ad30d07ce9ef16d01ad)

Merged-In: I3b60d24c87a8f88cf8fc4a032ebfbf55db74a944
Change-Id: I999ef31b2edf6d9e4e7a03662ed7431e778c19b0
diff --git a/runtime/gc/space/image_space.cc b/runtime/gc/space/image_space.cc
index 3e3d199..4a4fac5 100644
--- a/runtime/gc/space/image_space.cc
+++ b/runtime/gc/space/image_space.cc
@@ -1996,14 +1996,9 @@
 
   // Step 0: Extra zygote work.
 
-  // Step 0.a: If we're the zygote, mark boot.
-  if (loader.IsZygote() && CanWriteToDalvikCache(image_isa)) {
-    MarkZygoteStart(image_isa, Runtime::Current()->GetZygoteMaxFailedBoots());
-  }
-
   loader.FindImageFiles();
 
-  // Step 0.b: If we're the zygote, check for free space, and prune the cache preemptively,
+  // Step 0.a: If we're the zygote, check for free space, and prune the cache preemptively,
   //           if necessary. While the runtime may be fine (it is pretty tolerant to
   //           out-of-disk-space situations), other parts of the platform are not.
   //
diff --git a/runtime/gc/space/image_space_fs.h b/runtime/gc/space/image_space_fs.h
index 0eab35f..c491893 100644
--- a/runtime/gc/space/image_space_fs.h
+++ b/runtime/gc/space/image_space_fs.h
@@ -104,71 +104,6 @@
   }
 }
 
-// We write out an empty file to the zygote's ISA specific cache dir at the start of
-// every zygote boot and delete it when the boot completes. If we find a file already
-// present, it usually means the boot didn't complete. We wipe the entire dalvik
-// cache if that's the case.
-static void MarkZygoteStart(const InstructionSet isa, const uint32_t max_failed_boots) {
-  const std::string isa_subdir = GetDalvikCache(GetInstructionSetString(isa));
-  CHECK(!isa_subdir.empty()) << "Dalvik cache not found";
-  const std::string boot_marker = isa_subdir + "/.booting";
-  const char* file_name = boot_marker.c_str();
-
-  uint32_t num_failed_boots = 0;
-  std::unique_ptr<File> file(OS::OpenFileReadWrite(file_name));
-  if (file.get() == nullptr) {
-    file.reset(OS::CreateEmptyFile(file_name));
-
-    if (file.get() == nullptr) {
-      int saved_errno = errno;
-      PLOG(WARNING) << "Failed to create boot marker.";
-      if (saved_errno != ENOSPC) {
-        return;
-      }
-
-      LOG(WARNING) << "Pruning dalvik cache because of low-memory situation.";
-      impl::DeleteDirectoryContents(isa_subdir, false);
-
-      // Try once more.
-      file.reset(OS::OpenFileReadWrite(file_name));
-      if (file == nullptr) {
-        PLOG(WARNING) << "Failed to create boot marker.";
-        return;
-      }
-    }
-  } else {
-    if (!file->ReadFully(&num_failed_boots, sizeof(num_failed_boots))) {
-      PLOG(WARNING) << "Failed to read boot marker.";
-      file->Erase();
-      return;
-    }
-  }
-
-  if (max_failed_boots != 0 && num_failed_boots > max_failed_boots) {
-    LOG(WARNING) << "Incomplete boot detected. Pruning dalvik cache";
-    impl::DeleteDirectoryContents(isa_subdir, false);
-  }
-
-  ++num_failed_boots;
-  VLOG(startup) << "Number of failed boots on : " << boot_marker << " = " << num_failed_boots;
-
-  if (lseek(file->Fd(), 0, SEEK_SET) == -1) {
-    PLOG(WARNING) << "Failed to write boot marker.";
-    file->Erase();
-    return;
-  }
-
-  if (!file->WriteFully(&num_failed_boots, sizeof(num_failed_boots))) {
-    PLOG(WARNING) << "Failed to write boot marker.";
-    file->Erase();
-    return;
-  }
-
-  if (file->FlushCloseOrErase() != 0) {
-    PLOG(WARNING) << "Failed to flush boot marker.";
-  }
-}
-
 }  // namespace space
 }  // namespace gc
 }  // namespace art