aboutsummaryrefslogtreecommitdiffstats
path: root/applypatch/freecache.cpp
diff options
context:
space:
mode:
authorTianjie Xu <xunchang@google.com>2018-02-03 17:20:56 -0800
committerTianjie Xu <xunchang@google.com>2018-02-12 15:19:37 -0800
commite40c80d021d667c1400b7a5d1f6d623b8450a47c (patch)
treea8f3e862ef385c608ee36bf1db2f5aa2dc13465f /applypatch/freecache.cpp
parent5419ad31e7dafae35ab1ac9f56e234fff0c2de50 (diff)
downloadandroid_bootable_recovery-e40c80d021d667c1400b7a5d1f6d623b8450a47c.tar.gz
android_bootable_recovery-e40c80d021d667c1400b7a5d1f6d623b8450a47c.tar.bz2
android_bootable_recovery-e40c80d021d667c1400b7a5d1f6d623b8450a47c.zip
Skip the cache size check on host
When running the update simulation, we choose to skip the cache size check for now due to the lack of "/cache" on host. And in later cls we can implement a cache size estimator to make the check more constrained. Also build the host version of support libraries. Test: unit test pass Change-Id: I3ed93c857fd02f7b62f5baba9130f75c3236e717
Diffstat (limited to 'applypatch/freecache.cpp')
-rw-r--r--applypatch/freecache.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/applypatch/freecache.cpp b/applypatch/freecache.cpp
index 0a40baa9..ec1d20ce 100644
--- a/applypatch/freecache.cpp
+++ b/applypatch/freecache.cpp
@@ -111,6 +111,12 @@ static std::set<std::string> FindExpendableFiles() {
}
int MakeFreeSpaceOnCache(size_t bytes_needed) {
+#ifndef __ANDROID__
+ // TODO (xunchang) implement a heuristic cache size check during host simulation.
+ printf("Skip making (%zu) bytes free space on cache; program is running on host\n", bytes_needed);
+ return 0;
+#endif
+
size_t free_now = FreeSpaceForFile("/cache");
printf("%zu bytes free on /cache (%zu needed)\n", free_now, bytes_needed);