summaryrefslogtreecommitdiffstats
path: root/applypatch/freecache.cpp
diff options
context:
space:
mode:
authorTianjie Xu <xunchang@google.com>2018-02-17 01:36:42 +0100
committerandroid-build-merger <android-build-merger@google.com>2018-02-17 01:36:42 +0100
commit021d8fe0a343d045f7957ae745ee4661652ac160 (patch)
treebed03afd8e51935b4b911a0dbd7a62ddc374a2f9 /applypatch/freecache.cpp
parentMerge "recovery: Porting screensave mode for new platform." am: 15e376d792 (diff)
parentMerge "Skip the cache size check on host" (diff)
downloadandroid_bootable_recovery-021d8fe0a343d045f7957ae745ee4661652ac160.tar
android_bootable_recovery-021d8fe0a343d045f7957ae745ee4661652ac160.tar.gz
android_bootable_recovery-021d8fe0a343d045f7957ae745ee4661652ac160.tar.bz2
android_bootable_recovery-021d8fe0a343d045f7957ae745ee4661652ac160.tar.lz
android_bootable_recovery-021d8fe0a343d045f7957ae745ee4661652ac160.tar.xz
android_bootable_recovery-021d8fe0a343d045f7957ae745ee4661652ac160.tar.zst
android_bootable_recovery-021d8fe0a343d045f7957ae745ee4661652ac160.zip
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 0a40baa97..ec1d20cec 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);