From 8a8e2db3743364660ac69b53028dc2680c5066ba Mon Sep 17 00:00:00 2001 From: wanderer-dl122 Date: Tue, 26 Jul 2022 17:37:46 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=80=82=E9=85=8D=E5=88=86=E5=B8=83?= =?UTF-8?q?=E5=BC=8F=E6=95=B0=E6=8D=AE=E6=8E=A5=E5=8F=A3=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wanderer-dl122 --- sa_profile/dhardware.cfg | 13 ++++++++++++- .../src/resourcemanager/db_adapter.cpp | 10 ++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/sa_profile/dhardware.cfg b/sa_profile/dhardware.cfg index e6e1c49c..e546b39e 100644 --- a/sa_profile/dhardware.cfg +++ b/sa_profile/dhardware.cfg @@ -1,12 +1,23 @@ { + "jobs" : [{ + "name" : "services:dhardware", + "cmds" : [ + "mkdir /data/service/el1/public/database 0711 ddms ddms", + "mkdir /data/service/el1/public/database/dtbhardware_manager_service 02770 dhardware ddms" + ] + } + ], "services" : [{ "name" : "dhardware", "path" : ["/system/bin/sa_main", "/system/profile/dhardware.xml"], "uid" : "dhardware", "gid" : ["dhardware", "root", "input"], "ondemand" : true, - "apl" : "system_basic", + "apl" : "system_core", "permission" : ["ohos.permission.DISTRIBUTED_DATASYNC"], + "jobs" : { + "on-start" : "services:dhardware" + }, "secon" : "u:r:dhardware:s0" }] } \ No newline at end of file diff --git a/services/distributedhardwarefwkservice/src/resourcemanager/db_adapter.cpp b/services/distributedhardwarefwkservice/src/resourcemanager/db_adapter.cpp index db668f7e..534c2fe0 100644 --- a/services/distributedhardwarefwkservice/src/resourcemanager/db_adapter.cpp +++ b/services/distributedhardwarefwkservice/src/resourcemanager/db_adapter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -31,6 +31,10 @@ namespace DistributedHardware { #undef DH_LOG_TAG #define DH_LOG_TAG "DBAdapter" +namespace { +const std::string DATABASE_DIR = "/data/service/el1/public/database/"; +} + DBAdapter::DBAdapter(const std::string &appId, const std::string &storeId, const std::shared_ptr &changeListener) { @@ -52,7 +56,9 @@ DistributedKv::Status DBAdapter::GetKvStorePtr() .encrypt = false, .autoSync = true, .securityLevel = DistributedKv::SecurityLevel::S1, - .kvStoreType = DistributedKv::KvStoreType::SINGLE_VERSION + .kvStoreType = DistributedKv::KvStoreType::SINGLE_VERSION, + .area = DistributedKv::EL1, + .baseDir = DATABASE_DIR + appId_.appId }; return kvDataMgr_.GetSingleKvStore(options, appId_, storeId_, kvStoragePtr_); } -- Gitee From 505d2f195b52c40832f4335d3595b42028514f98 Mon Sep 17 00:00:00 2001 From: wanderer-dl122 Date: Tue, 26 Jul 2022 17:39:31 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E9=80=82=E9=85=8D=E5=88=86=E5=B8=83?= =?UTF-8?q?=E5=BC=8F=E6=95=B0=E6=8D=AE=E6=8E=A5=E5=8F=A3=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wanderer-dl122 --- sa_profile/dhardware.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sa_profile/dhardware.cfg b/sa_profile/dhardware.cfg index e546b39e..24d5f27c 100644 --- a/sa_profile/dhardware.cfg +++ b/sa_profile/dhardware.cfg @@ -13,7 +13,7 @@ "uid" : "dhardware", "gid" : ["dhardware", "root", "input"], "ondemand" : true, - "apl" : "system_core", + "apl" : "system_basic", "permission" : ["ohos.permission.DISTRIBUTED_DATASYNC"], "jobs" : { "on-start" : "services:dhardware" -- Gitee