diff --git a/services/include/storage_manager_inf.h b/services/include/storage_manager_inf.h index aea21f3ef7fecacd1b565167c5955a30d508e51b..061fa6c67e987b21c11dc4a755456ed475e6c278 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 771aff6a5fc7b6a30c8886c346aaef8c7362fd66..fc14f55032f4d634b89bf405ffcd60d53b863fda 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 4a91e9c58d9d0f9a39de7a1f6d38e42518420572..27db06ace8acbf3fdc609d3975c26b76da5f2f2e 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);