diff options
author | 2023-09-06 18:52:41 +0000 | |
---|---|---|
committer | 2023-09-06 18:52:41 +0000 | |
commit | 4fb86ec92a08a65e2ab52f8e361edb15b380cfc4 (patch) | |
tree | a5bbde4223f39d17c527fbd38c100d539cf86339 /tools/aapt/Images.cpp | |
parent | 65a02ad0798646eb68c06c2166a2e306fb1b6d1c (diff) | |
parent | 13ab173d417f9b64161b0101d15b63fddf9fc0ee (diff) |
Merge "Move String8 path functions to androidfw and aapt" into main am: 713e3930c4 am: 0cfc1c6ddd am: 9a80e1b70c am: 13ab173d41
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2723454
Change-Id: Id68d9725e711288d95290e07d3f656ed848fb69c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'tools/aapt/Images.cpp')
-rw-r--r-- | tools/aapt/Images.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/aapt/Images.cpp b/tools/aapt/Images.cpp index c6c7e960ba2a..cd4de90f12f6 100644 --- a/tools/aapt/Images.cpp +++ b/tools/aapt/Images.cpp @@ -8,6 +8,7 @@ #include "Images.h" +#include <androidfw/PathUtils.h> #include <androidfw/ResourceTypes.h> #include <utils/ByteOrder.h> @@ -1357,7 +1358,7 @@ static bool write_png_protected(png_structp write_ptr, String8& printableName, p status_t preProcessImage(const Bundle* bundle, const sp<AaptAssets>& /* assets */, const sp<AaptFile>& file, String8* /* outNewLeafName */) { - String8 ext(file->getPath().getPathExtension()); + String8 ext(getPathExtension(file->getPath())); // We currently only process PNG images. if (strcmp(ext.c_str(), ".png") != 0) { @@ -1518,7 +1519,7 @@ status_t preProcessImageToCache(const Bundle* bundle, const String8& source, con // Check to see if we're dealing with a 9-patch // If we are, process appropriately - if (source.getBasePath().getPathExtension() == ".9") { + if (getPathExtension(getBasePath(source)) == ".9") { if (do_9patch(source.c_str(), &imageInfo) != NO_ERROR) { return error; } @@ -1584,12 +1585,12 @@ status_t preProcessImageToCache(const Bundle* bundle, const String8& source, con status_t postProcessImage(const Bundle* bundle, const sp<AaptAssets>& assets, ResourceTable* table, const sp<AaptFile>& file) { - String8 ext(file->getPath().getPathExtension()); + String8 ext(getPathExtension(file->getPath())); // At this point, now that we have all the resource data, all we need to // do is compile XML files. if (strcmp(ext.c_str(), ".xml") == 0) { - String16 resourceName(parseResourceName(file->getSourceFile().getPathLeaf())); + String16 resourceName(parseResourceName(getPathLeaf(file->getSourceFile()))); return compileXmlFile(bundle, assets, resourceName, file, table); } |