diff options
author | Songchun Fan <schfan@google.com> | 2020-05-28 00:59:35 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-05-28 00:59:35 +0000 |
commit | b8e087607b210f9cc87a806ca3586c07b141868b (patch) | |
tree | 66d033eaf988df34ded8196a2b0c6a01c8466040 /services/incremental/IncrementalService.cpp | |
parent | a4f1e5b9c1277b2af6a2ea6d3bddd2c20573e048 (diff) | |
parent | f2a6af4b8a4ea7d889b83b7e54135fca6dcfcb40 (diff) |
Merge "[incremental] respect extractNativeLibs in native lib config" into rvc-dev am: f2a6af4b8a
Change-Id: Ibc96844cf6737663c48c9133b49bc9c972ed632f
Diffstat (limited to 'services/incremental/IncrementalService.cpp')
-rw-r--r-- | services/incremental/IncrementalService.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/services/incremental/IncrementalService.cpp b/services/incremental/IncrementalService.cpp index b03d1eae8ca0..66c7717d7987 100644 --- a/services/incremental/IncrementalService.cpp +++ b/services/incremental/IncrementalService.cpp @@ -1379,7 +1379,7 @@ static long elapsedMcs(Duration start, Duration end) { // Extract lib files from zip, create new files in incfs and write data to them bool IncrementalService::configureNativeBinaries(StorageId storage, std::string_view apkFullPath, std::string_view libDirRelativePath, - std::string_view abi) { + std::string_view abi, bool extractNativeLibs) { auto start = Clock::now(); const auto ifs = getIfs(storage); @@ -1423,6 +1423,21 @@ bool IncrementalService::configureNativeBinaries(StorageId storage, std::string_ continue; } + if (!extractNativeLibs) { + // ensure the file is properly aligned and unpacked + if (entry.method != kCompressStored) { + LOG(WARNING) << "Library " << fileName << " must be uncompressed to mmap it"; + return false; + } + if ((entry.offset & (constants().blockSize - 1)) != 0) { + LOG(WARNING) << "Library " << fileName + << " must be page-aligned to mmap it, offset = 0x" << std::hex + << entry.offset; + return false; + } + continue; + } + auto startFileTs = Clock::now(); const auto libName = path::basename(fileName); |