From 67bcf9b0440faef8899f48a3eecffa72ffe7af4c Mon Sep 17 00:00:00 2001 From: fangyun Date: Wed, 27 Jul 2022 16:32:07 +0800 Subject: [PATCH] modify the data directory created by edm Signed-off-by: fangyun --- etc/init/edm.cfg | 6 +++--- services/edm/include/policy_manager.h | 2 +- services/edm/src/admin_manager.cpp | 2 +- services/edm/src/policy_manager.cpp | 4 ++-- test/unittest/src/admin_manager_test.cpp | 2 +- test/unittest/src/policy_manager_test.cpp | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/etc/init/edm.cfg b/etc/init/edm.cfg index 539285ae1..bdd59ed6a 100644 --- a/etc/init/edm.cfg +++ b/etc/init/edm.cfg @@ -3,9 +3,9 @@ "name" : "boot", "cmds" : [ "start edm_sa", - "mkdir /data/edm 0770 edm edm", - "chown edm edm /data/edm", - "chmod 0770 /data/edm" + "mkdir /data/service/el1/public/edm 0770 edm edm", + "chown edm edm /data/service/el1/public/edm", + "chmod 0770 /data/service/el1/public/edm" ] } ], diff --git a/services/edm/include/policy_manager.h b/services/edm/include/policy_manager.h index dcd092bb9..c44f5275e 100644 --- a/services/edm/include/policy_manager.h +++ b/services/edm/include/policy_manager.h @@ -29,7 +29,7 @@ using PolicyItemsMap = std::unordered_map; /* Poli using AdminValueItemsMap = std::unordered_map; /* AdminName and PolicyValue pair */ /* - * This class is used to load and store /data/edm/device_policies.json file. + * This class is used to load and store /data/service/el1/public/edm/device_policies.json file. * provide the Get and Set api to operate on json file, the read and write json * file depend on jsoncpp library */ diff --git a/services/edm/src/admin_manager.cpp b/services/edm/src/admin_manager.cpp index 8eaa552ef..e062bf0bc 100644 --- a/services/edm/src/admin_manager.cpp +++ b/services/edm/src/admin_manager.cpp @@ -26,7 +26,7 @@ namespace OHOS { namespace EDM { const std::string EDM_ADMIN_DOT = "."; -const std::string EDM_ADMIN_BASE = "/data/edm/"; +const std::string EDM_ADMIN_BASE = "/data/service/el1/public/edm/"; const std::string EDM_ADMIN_JSON_FILE = "admin_policies_"; const std::string EDM_ADMIN_JSON_EXT = ".json"; constexpr int32_t DEFAULT_USER_ID = 100; diff --git a/services/edm/src/policy_manager.cpp b/services/edm/src/policy_manager.cpp index 196c7eb6a..fe0b65453 100644 --- a/services/edm/src/policy_manager.cpp +++ b/services/edm/src/policy_manager.cpp @@ -22,8 +22,8 @@ namespace OHOS { namespace EDM { -const std::string EDM_POLICY_JSON_FILE = "/data/edm/device_policies.json"; -const std::string EDM_POLICY_JSON_FILE_BAK = "/data/edm/device_policies.json.bak"; +const std::string EDM_POLICY_JSON_FILE = "/data/service/el1/public/edm/device_policies.json"; +const std::string EDM_POLICY_JSON_FILE_BAK = "/data/service/el1/public/edm/device_policies.json.bak"; constexpr unsigned int INVALID_INDEX = -1; std::shared_ptr PolicyManager::instance_; diff --git a/test/unittest/src/admin_manager_test.cpp b/test/unittest/src/admin_manager_test.cpp index d03c82f53..e5861a919 100644 --- a/test/unittest/src/admin_manager_test.cpp +++ b/test/unittest/src/admin_manager_test.cpp @@ -25,7 +25,7 @@ namespace EDM { namespace TEST { constexpr int32_t DEFAULT_USER_ID = 100; constexpr int HUGE_ADMIN_SIZE = 100; -const std::string TEAR_DOWN_CMD = "rm /data/edm/admin_policies.json"; +const std::string TEAR_DOWN_CMD = "rm /data/service/el1/public/edm/admin_policies.json"; void AdminManagerTest::SetUp() { diff --git a/test/unittest/src/policy_manager_test.cpp b/test/unittest/src/policy_manager_test.cpp index 15c8dbea8..b6d214a00 100644 --- a/test/unittest/src/policy_manager_test.cpp +++ b/test/unittest/src/policy_manager_test.cpp @@ -30,7 +30,7 @@ const std::string TEST_ADMIN_NAME1 = "com.edm.test.demo1"; const std::string TEST_BOOL_POLICY_NAME = "testBoolPolicy"; const std::string TEST_STRING_POLICY_NAME = "testStringPolicy"; constexpr int HUGE_POLICY_SIZE = 65537; -const std::string TEAR_DOWN_CMD = "rm /data/edm/device_policies.json"; +const std::string TEAR_DOWN_CMD = "rm /data/service/el1/public/edm/device_policies.json"; class PolicyManagerTest : public testing::Test { public: -- Gitee