base: Add TemporaryFile::DoNotRemove().

Bug: http://b/73127105
Test: none.
Change-Id: I563c12bfb629ddd630568dda4817fb10cc9940a8
diff --git a/include/android-base/test_utils.h b/include/android-base/test_utils.h
index 2edafe3..b95fa07 100644
--- a/include/android-base/test_utils.h
+++ b/include/android-base/test_utils.h
@@ -31,6 +31,8 @@
   // Release the ownership of fd, caller is reponsible for closing the
   // fd or stream properly.
   int release();
+  // Don't remove the temporary file in the destructor.
+  void DoNotRemove() { remove_file_ = false; }
 
   int fd;
   char path[1024];
@@ -38,6 +40,8 @@
  private:
   void init(const std::string& tmp_dir);
 
+  bool remove_file_ = true;
+
   DISALLOW_COPY_AND_ASSIGN(TemporaryFile);
 };