Set the update locations to default in CacheLocation's constructor am: 01daebbe68
am: aaff1bf1b2
Change-Id: I867b72b395f42b643e84455c1c9a6bc286a3a536
diff --git a/otautil/cache_location.cpp b/otautil/cache_location.cpp
index 8f28948..8ddefec 100644
--- a/otautil/cache_location.cpp
+++ b/otautil/cache_location.cpp
@@ -25,8 +25,7 @@
return cache_location;
}
-void CacheLocation::ResetLocations() {
- cache_temp_source_ = kDefaultCacheTempSource;
- last_command_file_ = kDefaultLastCommandFile;
- stash_directory_base_ = kDefaultStashDirectoryBase;
-}
+CacheLocation::CacheLocation()
+ : cache_temp_source_(kDefaultCacheTempSource),
+ last_command_file_(kDefaultLastCommandFile),
+ stash_directory_base_(kDefaultStashDirectoryBase) {}
diff --git a/otautil/include/otautil/cache_location.h b/otautil/include/otautil/cache_location.h
index 85e0d48..f2f6638 100644
--- a/otautil/include/otautil/cache_location.h
+++ b/otautil/include/otautil/cache_location.h
@@ -27,9 +27,6 @@
public:
static CacheLocation& location();
- // Reset the locations to their default values.
- void ResetLocations();
-
// getter and setter functions.
std::string cache_temp_source() const {
return cache_temp_source_;
@@ -53,7 +50,7 @@
}
private:
- CacheLocation() {}
+ CacheLocation();
DISALLOW_COPY_AND_ASSIGN(CacheLocation);
// When there isn't enough room on the target filesystem to hold the patched version of the file,
diff --git a/updater/updater.cpp b/updater/updater.cpp
index f063e5f..1d6b172 100644
--- a/updater/updater.cpp
+++ b/updater/updater.cpp
@@ -169,10 +169,6 @@
}
ota_io_init(za, state.is_retry);
- // Initialize the cache_temp_source, last_command_file and stash_directory_base to their default
- // locations.
- CacheLocation::location().ResetLocations();
-
std::string result;
bool status = Evaluate(&state, root, &result);