summaryrefslogtreecommitdiff
path: root/tools/aapt/FileFinder.cpp
diff options
context:
space:
mode:
author Tomasz Wasilczyk <twasilczyk@google.com> 2023-09-06 19:46:54 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2023-09-06 19:46:54 +0000
commitaa95ff271a31f903727c5ebc2e4990846c2073d2 (patch)
tree247609dc143ce6d8fc0c588fb8b8ef15bbd1d172 /tools/aapt/FileFinder.cpp
parentb61b138892b337b9abf7082dde5c7c17eb82ab49 (diff)
parent4fb86ec92a08a65e2ab52f8e361edb15b380cfc4 (diff)
Merge "Move String8 path functions to androidfw and aapt" into main am: 713e3930c4 am: 0cfc1c6ddd am: 9a80e1b70c am: 13ab173d41 am: 4fb86ec92a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2723454 Change-Id: I91016723c47501051b8768c0ee29f8821cab0331 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'tools/aapt/FileFinder.cpp')
-rw-r--r--tools/aapt/FileFinder.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/aapt/FileFinder.cpp b/tools/aapt/FileFinder.cpp
index a5c19806c804..69a8fa9fc6f2 100644
--- a/tools/aapt/FileFinder.cpp
+++ b/tools/aapt/FileFinder.cpp
@@ -5,6 +5,7 @@
// File Finder implementation.
// Implementation for the functions declared and documented in FileFinder.h
+#include <androidfw/PathUtils.h>
#include <utils/Vector.h>
#include <utils/String8.h>
#include <utils/KeyedVector.h>
@@ -57,7 +58,7 @@ bool SystemFileFinder::findFiles(String8 basePath, Vector<String8>& extensions,
if (entry->d_name[0] == '.') // Skip hidden files and directories
continue;
- String8 fullPath = basePath.appendPathCopy(entryName);
+ String8 fullPath = appendPathCopy(basePath, entryName);
// If this entry is a directory we'll recurse into it
if (isDirectory(fullPath.c_str()) ) {
DirectoryWalker* copy = dw->clone();
@@ -83,10 +84,10 @@ void SystemFileFinder::checkAndAddFile(const String8& path, const struct stat* s
{
// Loop over the extensions, checking for a match
bool done = false;
- String8 ext(path.getPathExtension());
+ String8 ext(getPathExtension(path));
ext.toLower();
for (size_t i = 0; i < extensions.size() && !done; ++i) {
- String8 ext2 = extensions[i].getPathExtension();
+ String8 ext2 = getPathExtension(extensions[i]);
ext2.toLower();
// Compare the extensions. If a match is found, add to storage.
if (ext == ext2) {