summaryrefslogtreecommitdiffstats
path: root/otautil
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2018-04-14 11:37:48 +0200
committerandroid-build-team Robot <android-build-team-robot@google.com>2018-04-14 11:37:48 +0200
commit6204045212cc0c92a896fc90c887a4427648b9b4 (patch)
tree582f579d7e183534dc04f1c074d87e244d2102a9 /otautil
parentSnap for 4719555 from 432e844d2b561fd1408b3be40472b4c1cff42077 to qt-release (diff)
parentMerge "Remove the old log files if cache space is insufficient for OTA" am: 0b3e25719d am: 8982db6ae1 (diff)
downloadandroid_bootable_recovery-6204045212cc0c92a896fc90c887a4427648b9b4.tar
android_bootable_recovery-6204045212cc0c92a896fc90c887a4427648b9b4.tar.gz
android_bootable_recovery-6204045212cc0c92a896fc90c887a4427648b9b4.tar.bz2
android_bootable_recovery-6204045212cc0c92a896fc90c887a4427648b9b4.tar.lz
android_bootable_recovery-6204045212cc0c92a896fc90c887a4427648b9b4.tar.xz
android_bootable_recovery-6204045212cc0c92a896fc90c887a4427648b9b4.tar.zst
android_bootable_recovery-6204045212cc0c92a896fc90c887a4427648b9b4.zip
Diffstat (limited to 'otautil')
-rw-r--r--otautil/cache_location.cpp4
-rw-r--r--otautil/include/otautil/cache_location.h10
2 files changed, 13 insertions, 1 deletions
diff --git a/otautil/cache_location.cpp b/otautil/cache_location.cpp
index 8ddefec5e..6139bf17b 100644
--- a/otautil/cache_location.cpp
+++ b/otautil/cache_location.cpp
@@ -19,6 +19,7 @@
constexpr const char kDefaultCacheTempSource[] = "/cache/saved.file";
constexpr const char kDefaultLastCommandFile[] = "/cache/recovery/last_command";
constexpr const char kDefaultStashDirectoryBase[] = "/cache/recovery";
+constexpr const char kDefaultCacheLogDirectory[] = "/cache/recovery";
CacheLocation& CacheLocation::location() {
static CacheLocation cache_location;
@@ -28,4 +29,5 @@ CacheLocation& CacheLocation::location() {
CacheLocation::CacheLocation()
: cache_temp_source_(kDefaultCacheTempSource),
last_command_file_(kDefaultLastCommandFile),
- stash_directory_base_(kDefaultStashDirectoryBase) {}
+ stash_directory_base_(kDefaultStashDirectoryBase),
+ cache_log_directory_(kDefaultCacheLogDirectory) {}
diff --git a/otautil/include/otautil/cache_location.h b/otautil/include/otautil/cache_location.h
index f2f663816..005395e5f 100644
--- a/otautil/include/otautil/cache_location.h
+++ b/otautil/include/otautil/cache_location.h
@@ -49,6 +49,13 @@ class CacheLocation {
stash_directory_base_ = base;
}
+ std::string cache_log_directory() const {
+ return cache_log_directory_;
+ }
+ void set_cache_log_directory(const std::string& log_dir) {
+ cache_log_directory_ = log_dir;
+ }
+
private:
CacheLocation();
DISALLOW_COPY_AND_ASSIGN(CacheLocation);
@@ -64,6 +71,9 @@ class CacheLocation {
// The base directory to write stashes during update.
std::string stash_directory_base_;
+
+ // The location of last_log & last_kmsg.
+ std::string cache_log_directory_;
};
#endif // _OTAUTIL_OTAUTIL_CACHE_LOCATION_H_