From e3bc131604f5e1290ca64ae8eef64325d14bee97 Mon Sep 17 00:00:00 2001 From: cuiruibin Date: Fri, 6 Sep 2024 10:04:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=BC=98=E5=8C=96=E4=B8=8D?= =?UTF-8?q?=E5=90=88=E7=90=86=E4=BB=A3=E7=A0=81=E5=9B=9E=E9=80=80=20Signed?= =?UTF-8?q?-off-by:=20cuiruibin=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- interfaces/common/src/common_func.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/interfaces/common/src/common_func.cpp b/interfaces/common/src/common_func.cpp index 8cc7572b0..8cdb66b62 100644 --- a/interfaces/common/src/common_func.cpp +++ b/interfaces/common/src/common_func.cpp @@ -15,7 +15,6 @@ #include "common_func.h" -#include #include #include "bundle_mgr_proxy.h" @@ -36,8 +35,6 @@ namespace { const char BACKFLASH = '/'; const std::string FILE_MANAGER_URI_HEAD = "/storage/"; const std::string FILE_MANAGER_AUTHORITY = "docs"; - std::string g_bundleName = ""; - std::mutex g_globalMutex; } static sptr GetBundleMgrProxy() { @@ -91,13 +88,7 @@ string CommonFunc::GetUriFromPath(const string &path) string realPath = path; NormalizePath(realPath); - { - std::lock_guard lock(g_globalMutex); - if (g_bundleName == "") { - g_bundleName = GetSelfBundleName(); - } - } - string packageName = (path.find(FILE_MANAGER_URI_HEAD) == 0) ? FILE_MANAGER_AUTHORITY : g_bundleName; + string packageName = (path.find(FILE_MANAGER_URI_HEAD) == 0) ? FILE_MANAGER_AUTHORITY : GetSelfBundleName(); realPath = FILE_SCHEME_PREFIX + packageName + SandboxHelper::Encode(realPath); return realPath; } -- Gitee