From 1d98fe0d393f05283f3a10a896f1054ecd3043cd Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 13 Jul 2021 17:14:20 -0700 Subject: [PATCH] Lose convertToResPath to aapt. aapt (not aapt2) is the only user. Test: treehugger Change-Id: Ie69f84f4f805c69f838e345b44755a316b9f9b06 --- libutils/String8.cpp | 20 ------------------- libutils/String8_fuzz.cpp | 3 --- .../arm64/source-based/libutils.so.lsdump | 16 --------------- .../arm_arm64/source-based/libutils.so.lsdump | 16 --------------- libutils/include/utils/String8.h | 9 --------- 5 files changed, 64 deletions(-) diff --git a/libutils/String8.cpp b/libutils/String8.cpp index 79b7edfe9..2b72847e5 100644 --- a/libutils/String8.cpp +++ b/libutils/String8.cpp @@ -39,10 +39,6 @@ namespace android { -// Separator used by resource paths. This is not platform dependent contrary -// to OS_PATH_SEPARATOR. -#define RES_PATH_SEPARATOR '/' - static inline char* getEmptyString() { static SharedBuffer* gEmptyStringBuf = [] { SharedBuffer* buf = SharedBuffer::alloc(1); @@ -582,20 +578,4 @@ String8& String8::appendPath(const char* name) } } -String8& String8::convertToResPath() -{ -#if OS_PATH_SEPARATOR != RES_PATH_SEPARATOR - size_t len = length(); - if (len > 0) { - char * buf = lockBuffer(len); - for (char * end = buf + len; buf < end; ++buf) { - if (*buf == OS_PATH_SEPARATOR) - *buf = RES_PATH_SEPARATOR; - } - unlockBuffer(len); - } -#endif - return *this; -} - }; // namespace android diff --git a/libutils/String8_fuzz.cpp b/libutils/String8_fuzz.cpp index e5dcd316e..a1cb3354a 100644 --- a/libutils/String8_fuzz.cpp +++ b/libutils/String8_fuzz.cpp @@ -82,9 +82,6 @@ std::vector void { str1->getPathDir(); }, - [](FuzzedDataProvider*, android::String8* str1, android::String8*) -> void { - str1->convertToResPath(); - }, [](FuzzedDataProvider*, android::String8* str1, android::String8*) -> void { std::shared_ptr path_out_str = std::make_shared(); diff --git a/libutils/abi-dumps/arm64/source-based/libutils.so.lsdump b/libutils/abi-dumps/arm64/source-based/libutils.so.lsdump index c89af9e8b..46baddecd 100644 --- a/libutils/abi-dumps/arm64/source-based/libutils.so.lsdump +++ b/libutils/abi-dumps/arm64/source-based/libutils.so.lsdump @@ -724,9 +724,6 @@ { "name" : "_ZN7android7String813appendFormatVEPKcSt9__va_list" }, - { - "name" : "_ZN7android7String816convertToResPathEv" - }, { "name" : "_ZN7android7String85clearEv" }, @@ -6927,19 +6924,6 @@ "return_type" : "_ZTIi", "source_file" : "system/core/libutils/include/utils/String8.h" }, - { - "function_name" : "android::String8::convertToResPath", - "linker_set_key" : "_ZN7android7String816convertToResPathEv", - "parameters" : - [ - { - "is_this_ptr" : true, - "referenced_type" : "_ZTIPN7android7String8E" - } - ], - "return_type" : "_ZTIRN7android7String8E", - "source_file" : "system/core/libutils/include/utils/String8.h" - }, { "function_name" : "android::String8::clear", "linker_set_key" : "_ZN7android7String85clearEv", diff --git a/libutils/abi-dumps/arm_arm64/source-based/libutils.so.lsdump b/libutils/abi-dumps/arm_arm64/source-based/libutils.so.lsdump index f88da15e0..219c76665 100644 --- a/libutils/abi-dumps/arm_arm64/source-based/libutils.so.lsdump +++ b/libutils/abi-dumps/arm_arm64/source-based/libutils.so.lsdump @@ -724,9 +724,6 @@ { "name" : "_ZN7android7String813appendFormatVEPKcSt9__va_list" }, - { - "name" : "_ZN7android7String816convertToResPathEv" - }, { "name" : "_ZN7android7String85clearEv" }, @@ -6923,19 +6920,6 @@ "return_type" : "_ZTIi", "source_file" : "system/core/libutils/include/utils/String8.h" }, - { - "function_name" : "android::String8::convertToResPath", - "linker_set_key" : "_ZN7android7String816convertToResPathEv", - "parameters" : - [ - { - "is_this_ptr" : true, - "referenced_type" : "_ZTIPN7android7String8E" - } - ], - "return_type" : "_ZTIRN7android7String8E", - "source_file" : "system/core/libutils/include/utils/String8.h" - }, { "function_name" : "android::String8::clear", "linker_set_key" : "_ZN7android7String85clearEv", diff --git a/libutils/include/utils/String8.h b/libutils/include/utils/String8.h index e58f1a5d1..43909f7f7 100644 --- a/libutils/include/utils/String8.h +++ b/libutils/include/utils/String8.h @@ -202,15 +202,6 @@ public: { String8 p(*this); p.appendPath(leaf); return p; } String8 appendPathCopy(const String8& leaf) const { return appendPathCopy(leaf.c_str()); } - /* - * Converts all separators in this string to /, the default path separator. - * - * If the default OS separator is backslash, this converts all - * backslashes to slashes, in-place. Otherwise it does nothing. - * Returns self. - */ - String8& convertToResPath(); - private: status_t real_append(const char* other, size_t numChars); char* find_extension(void) const;