From afaf6e9ee73b340c4fb2e98ea73b6c8c349a3e9d Mon Sep 17 00:00:00 2001 From: Songchun Fan Date: Wed, 18 Mar 2020 14:12:20 -0700 Subject: [PATCH] [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 --- services/incremental/IncrementalService.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/incremental/IncrementalService.cpp b/services/incremental/IncrementalService.cpp index 2eadece36b3cd..76eb3571b907a 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 libData(uncompressedLen);