Make update_engine use /data/misc/update_engine/cache as tmpdir
update_engine doesn't have access to android's default tmpdir,
/data/local/tmp . So use /data/misc/update_engine/cache/
Test: th
Bug: 320443894
Change-Id: Ibbbe8019c276fe0fa3f9ea197815ed6daac912fc
diff --git a/common/utils.cc b/common/utils.cc
index f0c045f..1fa2d41 100644
--- a/common/utils.cc
+++ b/common/utils.cc
@@ -86,6 +86,7 @@
// The path to the kernel's boot_id.
const char kBootIdPath[] = "/proc/sys/kernel/random/boot_id";
+} // namespace
// If |path| is absolute, or explicit relative to the current working directory,
// leaves it as is. Otherwise, uses the system's temp directory, as defined by
// base::GetTempDir() and prepends it to |path|. On success stores the full
@@ -110,8 +111,6 @@
return true;
}
-} // namespace
-
namespace utils {
bool WriteFile(const char* path, const void* data, size_t data_len) {
diff --git a/common/utils.h b/common/utils.h
index 6bb89f1..ae07b07 100644
--- a/common/utils.h
+++ b/common/utils.h
@@ -559,6 +559,8 @@
[[nodiscard]] std::string_view ToStringView(const void* data,
size_t size) noexcept;
+bool GetTempName(const std::string& path, base::FilePath* template_path);
+
} // namespace chromeos_update_engine
#define TEST_AND_RETURN_FALSE_ERRNO(_x) \