From 61a2f0ea464d1b7f2ad3c0bbc5a59500eb8c0cbb Mon Sep 17 00:00:00 2001 From: linjun9528 Date: Thu, 10 Feb 2022 15:50:38 +0800 Subject: [PATCH] drop VOLUME_ENABLE macro Signed-off-by: linjun9528 --- services/include/storage_manager_inf.h | 3 --- services/src/fileoper/ext_storage/storage_manager_inf.cpp | 2 -- services/src/fileoper/external_storage_utils.cpp | 4 ---- 3 files changed, 9 deletions(-) diff --git a/services/include/storage_manager_inf.h b/services/include/storage_manager_inf.h index aea21f3e..061fa6c6 100644 --- a/services/include/storage_manager_inf.h +++ b/services/include/storage_manager_inf.h @@ -19,19 +19,16 @@ #include "ipc/storage_manager_proxy.h" #include "ipc/storage_manager.h" #include "istorage_manager.h" -#define VOLUME_ENABLE namespace OHOS { namespace FileManagerService { class StorageManagerInf { public: StorageManagerInf() = default; ~StorageManagerInf() = default; -#ifdef VOLUME_ENABLE static int Connect(); static std::vector GetAllVolumes(); static bool GetMountedVolumes(std::vector &vecRootPath); static bool StoragePathValidCheck(const std::string &path); -#endif private: inline static sptr storageManager_; }; diff --git a/services/src/fileoper/ext_storage/storage_manager_inf.cpp b/services/src/fileoper/ext_storage/storage_manager_inf.cpp index 771aff6a..fc14f550 100644 --- a/services/src/fileoper/ext_storage/storage_manager_inf.cpp +++ b/services/src/fileoper/ext_storage/storage_manager_inf.cpp @@ -22,7 +22,6 @@ using namespace std; namespace OHOS { namespace FileManagerService { -#ifdef VOLUME_ENABLE static bool GetMountPointFromPath(const string &path, string &mountPoint) { size_t len = MOUNT_POINT_ROOT.size(); @@ -114,6 +113,5 @@ bool StorageManagerInf::StoragePathValidCheck(const string &path) } return succ; } -#endif } // FileManagerService } // OHOS diff --git a/services/src/fileoper/external_storage_utils.cpp b/services/src/fileoper/external_storage_utils.cpp index 4a91e9c5..27db06ac 100644 --- a/services/src/fileoper/external_storage_utils.cpp +++ b/services/src/fileoper/external_storage_utils.cpp @@ -97,12 +97,10 @@ static bool ConvertUriToAbsolutePath(const std::string &uri, std::string &path) ERR_LOG("get real path fail"); return false; } -#ifdef VOLUME_ENABLE if (!StorageManagerInf::StoragePathValidCheck(path)) { ERR_LOG("external uri path was ejected"); return false; } -#endif return true; } @@ -179,13 +177,11 @@ int ExternalStorageUtils::DoCreateFile(const std::string &uri, const std::string int ExternalStorageUtils::DoGetRoot(const std::string &name, const std::string &path, MessageParcel &reply) { vector vecRootPath; -#ifdef VOLUME_ENABLE if (!StorageManagerInf::GetMountedVolumes(vecRootPath)) { ERR_LOG("there is valid extorage storage"); reply.WriteInt32(0); return FAIL; } -#endif reply.WriteInt32(vecRootPath.size()); for (auto rootPath : vecRootPath) { reply.WriteString(rootPath); -- Gitee