summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Songchun Fan <schfan@google.com> 2020-03-18 14:12:20 -0700
committer Songchun Fan <schfan@google.com> 2020-03-18 14:17:04 -0700
commitafaf6e9ee73b340c4fb2e98ea73b6c8c349a3e9d (patch)
treec360fe67e46eee474fbd6114c450fb3fe0727f41
parent7695663db7424a834e49906e4167fe4198c3c781 (diff)
[incremental native lib] skip writing to zero byte files
Test: adb install --incremental /google/data/rw/teams/tradefed/testdata/thirdparty_apps_stable/MX_Player_1.9.17.apk BUG: 150795871 Change-Id: Idca09929f41424edb527b9b89dea1974c1f8ea46
-rw-r--r--services/incremental/IncrementalService.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/services/incremental/IncrementalService.cpp b/services/incremental/IncrementalService.cpp
index 2eadece36b3c..76eb3571b907 100644
--- a/services/incremental/IncrementalService.cpp
+++ b/services/incremental/IncrementalService.cpp
@@ -1170,6 +1170,10 @@ bool IncrementalService::configureNativeBinaries(StorageId storage, std::string_
// If one lib file fails to be created, abort others as well
break;
}
+ // If it is a zero-byte file, skip data writing
+ if (uncompressedLen == 0) {
+ continue;
+ }
// Write extracted data to new file
std::vector<uint8_t> libData(uncompressedLen);