From f2d75a230a30bcef9bb7cb89f999eb76d21d52fa Mon Sep 17 00:00:00 2001 From: li-tiangang4 Date: Mon, 14 Mar 2022 17:40:43 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=86=85=E6=BA=90=E6=A3=80=E8=A7=86?= =?UTF-8?q?=E6=84=8F=E8=A7=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-tiangang4 --- common/log/include/distributed_hardware_log.h | 2 +- common/utils/include/constants.h | 2 +- common/utils/include/single_instance.h | 2 +- sa_profile/4801.xml | 4 ++-- .../src/accessmanager/access_manager.cpp | 4 +++- .../src/distributed_hardware_service.cpp | 1 + .../src/componentloader/component_loader.cpp | 2 +- 7 files changed, 10 insertions(+), 7 deletions(-) diff --git a/common/log/include/distributed_hardware_log.h b/common/log/include/distributed_hardware_log.h index 9b02114c..00eff7bc 100644 --- a/common/log/include/distributed_hardware_log.h +++ b/common/log/include/distributed_hardware_log.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 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 diff --git a/common/utils/include/constants.h b/common/utils/include/constants.h index 3aa1d18e..a32644e6 100644 --- a/common/utils/include/constants.h +++ b/common/utils/include/constants.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 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 diff --git a/common/utils/include/single_instance.h b/common/utils/include/single_instance.h index 11a86f69..8c9fd428 100644 --- a/common/utils/include/single_instance.h +++ b/common/utils/include/single_instance.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 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 diff --git a/sa_profile/4801.xml b/sa_profile/4801.xml index 87bbf234..1c5961fa 100644 --- a/sa_profile/4801.xml +++ b/sa_profile/4801.xml @@ -15,11 +15,11 @@ --> dhardware - + 4801 libdistributedhardwarefwksvr.z.so 4802 - 60000 + 60000 true true 1 diff --git a/services/distributedhardwarefwkservice/src/accessmanager/access_manager.cpp b/services/distributedhardwarefwkservice/src/accessmanager/access_manager.cpp index 190ea5b1..02d3aa7e 100644 --- a/services/distributedhardwarefwkservice/src/accessmanager/access_manager.cpp +++ b/services/distributedhardwarefwkservice/src/accessmanager/access_manager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 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 @@ -140,11 +140,13 @@ void AccessManager::OnDeviceOffline(const DmDeviceInfo &deviceInfo) void AccessManager::OnDeviceReady(const DmDeviceInfo &deviceInfo) { + (void)deviceInfo; return; } void AccessManager::OnDeviceChanged(const DmDeviceInfo &deviceInfo) { + (void)deviceInfo; return; } diff --git a/services/distributedhardwarefwkservice/src/distributed_hardware_service.cpp b/services/distributedhardwarefwkservice/src/distributed_hardware_service.cpp index 3c2351f7..cc28e1f8 100644 --- a/services/distributedhardwarefwkservice/src/distributed_hardware_service.cpp +++ b/services/distributedhardwarefwkservice/src/distributed_hardware_service.cpp @@ -79,6 +79,7 @@ void DistributedHardwareService::OnStop() int32_t DistributedHardwareService::QuerySinkVersion(std::unordered_map &versionMap) { + (void)versionMap; return 0; } } diff --git a/services/distributedhardwarefwkserviceimpl/src/componentloader/component_loader.cpp b/services/distributedhardwarefwkserviceimpl/src/componentloader/component_loader.cpp index 17881f2f..9d262bbb 100644 --- a/services/distributedhardwarefwkserviceimpl/src/componentloader/component_loader.cpp +++ b/services/distributedhardwarefwkserviceimpl/src/componentloader/component_loader.cpp @@ -127,7 +127,7 @@ int32_t ComponentLoader::GetLocalDHVersion(DHVersion &dhVersion) void *ComponentLoader::GetHandler(const std::string &soName) { if (soName.length() <= 0) { - DHLOGE("%s soName length is 0"); + DHLOGE("%s soName length is 0", soName.c_str()); return nullptr; } char path[PATH_MAX + 1] = {0x00}; -- Gitee From 25c0ad6924de327fdfa0d440e0984555df3f9007 Mon Sep 17 00:00:00 2001 From: li-tiangang4 Date: Tue, 15 Mar 2022 09:18:15 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=B9=B4=E4=BB=BD=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-tiangang4 --- common/log/include/distributed_hardware_log.h | 2 +- common/utils/include/constants.h | 2 +- common/utils/include/single_instance.h | 2 +- .../src/accessmanager/access_manager.cpp | 2 +- utils/BUILD.gn | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/common/log/include/distributed_hardware_log.h b/common/log/include/distributed_hardware_log.h index 00eff7bc..0a2bdfda 100644 --- a/common/log/include/distributed_hardware_log.h +++ b/common/log/include/distributed_hardware_log.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 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 diff --git a/common/utils/include/constants.h b/common/utils/include/constants.h index a32644e6..8488ee88 100644 --- a/common/utils/include/constants.h +++ b/common/utils/include/constants.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 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 diff --git a/common/utils/include/single_instance.h b/common/utils/include/single_instance.h index 8c9fd428..5cf87255 100644 --- a/common/utils/include/single_instance.h +++ b/common/utils/include/single_instance.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 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 diff --git a/services/distributedhardwarefwkservice/src/accessmanager/access_manager.cpp b/services/distributedhardwarefwkservice/src/accessmanager/access_manager.cpp index 02d3aa7e..26a2e012 100644 --- a/services/distributedhardwarefwkservice/src/accessmanager/access_manager.cpp +++ b/services/distributedhardwarefwkservice/src/accessmanager/access_manager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 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 diff --git a/utils/BUILD.gn b/utils/BUILD.gn index 4e68020d..66f1d25b 100644 --- a/utils/BUILD.gn +++ b/utils/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. +# Copyright (c) 2020-2021 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 -- Gitee From d6d2f3a53949562a17953c7a92b52de50777d554 Mon Sep 17 00:00:00 2001 From: li-tiangang4 Date: Tue, 15 Mar 2022 09:59:03 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=A3=80=E8=A7=86=E6=84=8F=E8=A7=81?= =?UTF-8?q?=EF=BC=9A=E5=B9=B4=E4=BB=BD=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-tiangang4 --- utils/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/BUILD.gn b/utils/BUILD.gn index 66f1d25b..27018ede 100644 --- a/utils/BUILD.gn +++ b/utils/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2020-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 -- Gitee From d445a3ad11da9ea4e87aa5c5ff03a095876ad830 Mon Sep 17 00:00:00 2001 From: tangfan <1824525929@qq.com> Date: Tue, 15 Mar 2022 11:36:50 +0800 Subject: [PATCH 4/5] fix AccessManager init UT Signed-off-by: tangfan <1824525929@qq.com> --- .../accessmanager/access_manager_test.cpp | 38 ------------------- 1 file changed, 38 deletions(-) diff --git a/services/distributedhardwarefwkservice/test/unittest/common/accessmanager/access_manager_test.cpp b/services/distributedhardwarefwkservice/test/unittest/common/accessmanager/access_manager_test.cpp index d8a15e4e..c84f0a71 100644 --- a/services/distributedhardwarefwkservice/test/unittest/common/accessmanager/access_manager_test.cpp +++ b/services/distributedhardwarefwkservice/test/unittest/common/accessmanager/access_manager_test.cpp @@ -71,44 +71,6 @@ void AccessManagerTest::SetUpTestCase() {} void AccessManagerTest::TearDownTestCase() {} -/** - * @tc.name: Init_001 - * @tc.desc: Verify the sub function. - * @tc.type: FUNC - * @tc.require: AR000GHSJK - */ -HWTEST_F(AccessManagerTest, Init_001, TestSize.Level1) -{ - auto ret = AccessManager::GetInstance()->Init(); - EXPECT_EQ(DH_FWK_SUCCESS, ret); -} - -/** - * @tc.name: Uninit_001 - * @tc.desc: Verify the sub function. - * @tc.type: FUNC - * @tc.require: AR000GHSJK - */ -HWTEST_F(AccessManagerTest, UnInit_001, TestSize.Level1) -{ - auto ret = AccessManager::GetInstance()->UnInit(); - EXPECT_EQ(ERR_DH_FWK_ACCESS_UNINIT_DM_FAILED, ret); -} - -/** - * @tc.name: Uninit_001 - * @tc.desc: Verify the sub function. - * @tc.type: FUNC - * @tc.require: AR000GHSJK - */ -HWTEST_F(AccessManagerTest, UnInit_002, TestSize.Level1) -{ - auto ret = AccessManager::GetInstance()->Init(); - EXPECT_EQ(DH_FWK_SUCCESS, ret); - ret = AccessManager::GetInstance()->UnInit(); - EXPECT_EQ(DH_FWK_SUCCESS, ret); -} - /** * @tc.name: SendOnLineEvent_001 * @tc.desc: Verify the online success -- Gitee From be55e3b655fe747abaaeea960a5d02afdcc9cf27 Mon Sep 17 00:00:00 2001 From: tangfan <1824525929@qq.com> Date: Wed, 16 Mar 2022 10:49:07 +0800 Subject: [PATCH 5/5] fix DH_FWK_PACKAGE_NAME Signed-off-by: tangfan <1824525929@qq.com> --- common/utils/include/constants.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/utils/include/constants.h b/common/utils/include/constants.h index 8488ee88..a6aefea5 100644 --- a/common/utils/include/constants.h +++ b/common/utils/include/constants.h @@ -37,7 +37,7 @@ namespace DistributedHardware { const std::string DH_ATTRS = "dh_attrs"; const std::string DH_LOG_TITLE_TAG = "DHFWK"; const std::string DH_TASK_NAME_PREFIX = "Task_"; - const std::string DH_FWK_PKG_NAME = "DBinderBus_" + std::to_string(getpid()); + const std::string DH_FWK_PKG_NAME = "ohos.dhardware"; const std::string DH_COMPONENT_VERSIONS = "componentVersions"; const std::string DH_COMPONENT_TYPE = "dhType"; const std::string DH_COMPONENT_SINK_VER = "version"; -- Gitee