summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2020-03-10 02:03:49 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2020-03-10 02:03:49 +0000
commit3ae15ac996ae1639fcdd6b3a7226c503721c72e5 (patch)
treece925a3d2db1932aeb34d5ab9c620f798c5ea5c6
parente288743f3b962dcd135c8f477e2b7f211e18d267 (diff)
parentea59f9c057940659973bae6eab9b79b6d038125f (diff)
downloadplatform_system_libhidl-3ae15ac996ae1639fcdd6b3a7226c503721c72e5.tar.gz
platform_system_libhidl-3ae15ac996ae1639fcdd6b3a7226c503721c72e5.tar.bz2
platform_system_libhidl-3ae15ac996ae1639fcdd6b3a7226c503721c72e5.zip
Snap for 6279178 from ea59f9c057940659973bae6eab9b79b6d038125f to rvc-release
Change-Id: I4e4c1d46e8ad5a36f6e4e6f8d75dfcb280e505d6
-rw-r--r--transport/ServiceManagement.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/transport/ServiceManagement.cpp b/transport/ServiceManagement.cpp
index 19d1d52e..36010167 100644
--- a/transport/ServiceManagement.cpp
+++ b/transport/ServiceManagement.cpp
@@ -54,10 +54,6 @@
#include <android/hidl/manager/1.2/BpHwServiceManager.h>
#include <android/hidl/manager/1.2/IServiceManager.h>
-#define RE_COMPONENT "[a-zA-Z_][a-zA-Z_0-9]*"
-#define RE_PATH RE_COMPONENT "(?:[.]" RE_COMPONENT ")*"
-static const std::regex gLibraryFileNamePattern("(" RE_PATH "@[0-9]+[.][0-9]+)-impl(.*?).so");
-
using ::android::hidl::base::V1_0::IBase;
using IServiceManager1_0 = android::hidl::manager::V1_0::IServiceManager;
using IServiceManager1_1 = android::hidl::manager::V1_1::IServiceManager;
@@ -263,7 +259,14 @@ static std::vector<std::string> findFiles(const std::string& path, const std::st
return results;
}
-bool matchPackageName(const std::string& lib, std::string* matchedName, std::string* implName) {
+static bool matchPackageName(const std::string& lib, std::string* matchedName,
+ std::string* implName) {
+#define RE_COMPONENT "[a-zA-Z_][a-zA-Z_0-9]*"
+#define RE_PATH RE_COMPONENT "(?:[.]" RE_COMPONENT ")*"
+ static const std::regex gLibraryFileNamePattern("(" RE_PATH "@[0-9]+[.][0-9]+)-impl(.*?).so");
+#undef RE_PATH
+#undef RE_COMPONENT
+
std::smatch match;
if (std::regex_match(lib, match, gLibraryFileNamePattern)) {
*matchedName = match.str(1) + "::I*";