diff --git a/interfaces/common/src/common_func.cpp b/interfaces/common/src/common_func.cpp index 8cc7572b09084ea78df95321207b8a3a1eb9f26d..8cdb66b62e73a593a77a435b680edac172cbd0ae 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; }