From 804e819c1bf64d4df483107e02e896b29e58b3f1 Mon Sep 17 00:00:00 2001 From: Tomasz Wasilczyk Date: Wed, 23 Aug 2023 02:22:53 +0000 Subject: Move String8 path functions to androidfw and aapt Test: m checkbuild Bug: 295394788 Change-Id: I9488bc5632cbd47c83f6b5f2df4c87eb324a1e8e --- tools/aapt/CrunchCache.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'tools/aapt/CrunchCache.cpp') diff --git a/tools/aapt/CrunchCache.cpp b/tools/aapt/CrunchCache.cpp index 1f2febec2230..e731ce0d5ccf 100644 --- a/tools/aapt/CrunchCache.cpp +++ b/tools/aapt/CrunchCache.cpp @@ -5,6 +5,7 @@ // This file defines functions laid out and documented in // CrunchCache.h +#include #include #include #include @@ -52,15 +53,15 @@ size_t CrunchCache::crunch(CacheUpdater* cu, bool forceOverwrite) relativePath = String8(rPathPtr + offset); if (forceOverwrite || needsUpdating(relativePath)) { - cu->processImage(mSourcePath.appendPathCopy(relativePath), - mDestPath.appendPathCopy(relativePath)); + cu->processImage(appendPathCopy(mSourcePath, relativePath), + appendPathCopy(mDestPath, relativePath)); numFilesUpdated++; // crunchFile(relativePath); } // Delete this file from the source files and (if it exists) from the // dest files. mSourceFiles.removeItemsAt(0); - mDestFiles.removeItem(mDestPath.appendPathCopy(relativePath)); + mDestFiles.removeItem(appendPathCopy(mDestPath, relativePath)); } // Iterate through what's left of destFiles and delete leftovers @@ -99,7 +100,7 @@ bool CrunchCache::needsUpdating(const String8& relativePath) const // Retrieve modification dates for this file entry under the source and // cache directory trees. The vectors will return a modification date of 0 // if the file doesn't exist. - time_t sourceDate = mSourceFiles.valueFor(mSourcePath.appendPathCopy(relativePath)); - time_t destDate = mDestFiles.valueFor(mDestPath.appendPathCopy(relativePath)); + time_t sourceDate = mSourceFiles.valueFor(appendPathCopy(mSourcePath, relativePath)); + time_t destDate = mDestFiles.valueFor(appendPathCopy(mDestPath, relativePath)); return sourceDate > destDate; } -- cgit v1.2.3-59-g8ed1b