summaryrefslogtreecommitdiffstats
path: root/applypatch/include
diff options
context:
space:
mode:
authorTianjie Xu <xunchang@google.com>2018-04-13 22:37:23 +0200
committerandroid-build-merger <android-build-merger@google.com>2018-04-13 22:37:23 +0200
commita1d89277dd9dfa1d7e0a3b73cec5393a187dc54d (patch)
tree582f579d7e183534dc04f1c074d87e244d2102a9 /applypatch/include
parentMerge "recovery: enable fsverity feature bit" into pi-dev (diff)
parentMerge "Remove the old log files if cache space is insufficient for OTA" (diff)
downloadandroid_bootable_recovery-a1d89277dd9dfa1d7e0a3b73cec5393a187dc54d.tar
android_bootable_recovery-a1d89277dd9dfa1d7e0a3b73cec5393a187dc54d.tar.gz
android_bootable_recovery-a1d89277dd9dfa1d7e0a3b73cec5393a187dc54d.tar.bz2
android_bootable_recovery-a1d89277dd9dfa1d7e0a3b73cec5393a187dc54d.tar.lz
android_bootable_recovery-a1d89277dd9dfa1d7e0a3b73cec5393a187dc54d.tar.xz
android_bootable_recovery-a1d89277dd9dfa1d7e0a3b73cec5393a187dc54d.tar.zst
android_bootable_recovery-a1d89277dd9dfa1d7e0a3b73cec5393a187dc54d.zip
Diffstat (limited to 'applypatch/include')
-rw-r--r--applypatch/include/applypatch/applypatch.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/applypatch/include/applypatch/applypatch.h b/applypatch/include/applypatch/applypatch.h
index 912ead1fa..021a28d05 100644
--- a/applypatch/include/applypatch/applypatch.h
+++ b/applypatch/include/applypatch/applypatch.h
@@ -39,7 +39,7 @@ using SinkFn = std::function<size_t(const unsigned char*, size_t)>;
// applypatch.cpp
int ShowLicenses();
-size_t FreeSpaceForFile(const char* filename);
+size_t FreeSpaceForFile(const std::string& filename);
int CacheSizeCheck(size_t bytes);
int ParseSha1(const char* str, uint8_t* digest);
@@ -79,5 +79,9 @@ int ApplyImagePatch(const unsigned char* old_data, size_t old_size, const Value&
// freecache.cpp
int MakeFreeSpaceOnCache(size_t bytes_needed);
+// Removes the files in |dirname| until we have at least |bytes_needed| bytes of free space on
+// the partition. The size of the free space is returned by calling |space_checker|.
+bool RemoveFilesInDirectory(size_t bytes_needed, const std::string& dirname,
+ const std::function<size_t(const std::string&)>& space_checker);
#endif