From 539ddd3ddb99d6c87443bbcf54a4a46122098c63 Mon Sep 17 00:00:00 2001 From: wangchaole Date: Tue, 19 Jul 2022 10:28:52 +0800 Subject: [PATCH] fix: modify log function Signed-off-by: wangchaole --- common/BUILD.gn | 16 +-- common/include/utils/anonymous_string.h | 28 +++++ common/include/utils/dh_log.h | 46 ++++++++ .../include/utils/distributed_hardware_log.h | 38 +++++++ common/src/utils/anonymous_string.cpp | 102 ++++++++++++++++++ common/src/utils/dh_log.cpp | 87 +++++++++++++++ distributedcamera.gni | 2 - .../native_cpp/camera_sink/BUILD.gn | 12 +-- .../native_cpp/camera_source/BUILD.gn | 12 +-- .../src/dcamera_source_handler.cpp | 1 - .../onsinklocaldmsdied_fuzzer/BUILD.gn | 4 +- .../onsourcelocaldmsdied_fuzzer/BUILD.gn | 13 +-- .../BUILD.gn | 9 +- .../BUILD.gn | 1 - .../BUILD.gn | 4 - .../sourcehandlerinitsource_fuzzer/BUILD.gn | 4 - .../BUILD.gn | 4 +- .../BUILD.gn | 4 +- .../BUILD.gn | 1 - .../BUILD.gn | 1 - .../test/include/mock_component_disable.h | 48 +++++++++ .../test/include/mock_component_enable.h | 48 +++++++++ .../cameraoperator/client/BUILD.gn | 5 - .../unittest/common/cameraoperator/BUILD.gn | 7 +- .../cameraoperator/handler/BUILD.gn | 3 - .../unittest/common/dcamerahandler/BUILD.gn | 3 - services/cameraservice/sinkservice/BUILD.gn | 4 - .../common/distributedcamera/BUILD.gn | 5 - .../common/distributedcameramgr/BUILD.gn | 6 -- services/cameraservice/sourceservice/BUILD.gn | 4 - .../common/distributedcameramgr/BUILD.gn | 5 +- services/channel/BUILD.gn | 5 - services/data_process/BUILD.gn | 4 - 33 files changed, 422 insertions(+), 114 deletions(-) create mode 100644 common/include/utils/anonymous_string.h create mode 100644 common/include/utils/dh_log.h create mode 100644 common/include/utils/distributed_hardware_log.h create mode 100644 common/src/utils/anonymous_string.cpp create mode 100644 common/src/utils/dh_log.cpp create mode 100644 interfaces/inner_kits/native_cpp/test/include/mock_component_disable.h create mode 100644 interfaces/inner_kits/native_cpp/test/include/mock_component_enable.h diff --git a/common/BUILD.gn b/common/BUILD.gn index 7d320a2e..4384003c 100644 --- a/common/BUILD.gn +++ b/common/BUILD.gn @@ -17,12 +17,8 @@ import( ohos_shared_library("distributed_camera_utils") { include_dirs = [ - "//utils/native/base/include", + "//commonlibrary/c_utils/base/include", "//utils/system/safwk/native/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include/", - "${fwk_utils_path}/include", - "${fwk_utils_path}/include/log", ] include_dirs += [ @@ -35,22 +31,19 @@ ohos_shared_library("distributed_camera_utils") { "-Wall", ] - if ("${product_name}" == "m40") { + if (!distributed_camera_common) { cflags += [ "-DPRODUCT_M40" ] } sources = [ + "src/utils/anonymous_string.cpp", "src/utils/data_buffer.cpp", "src/utils/dcamera_buffer_handle.cpp", "src/utils/dcamera_hisysevent_adapter.cpp", "src/utils/dcamera_hitrace_adapter.cpp", "src/utils/dcamera_sa_process_state.cpp", "src/utils/dcamera_utils_tools.cpp", - ] - - deps = [ - "${fwk_utils_path}:distributedhardwareutils", - "//utils/native/base:utils", + "src/utils/dh_log.cpp", ] defines = [ @@ -60,6 +53,7 @@ ohos_shared_library("distributed_camera_utils") { ] external_deps = [ + "c_utils:utils", "dsoftbus:softbus_client", "graphic_chipsetsdk:buffer_handle", "hisysevent_native:libhisysevent", diff --git a/common/include/utils/anonymous_string.h b/common/include/utils/anonymous_string.h new file mode 100644 index 00000000..db4441ac --- /dev/null +++ b/common/include/utils/anonymous_string.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OHOS_DCAMERA_ANONYMOUS_STRING_H +#define OHOS_DCAMERA_ANONYMOUS_STRING_H + +#include + +namespace OHOS { +namespace DistributedHardware { +std::string GetRandomID(); +std::string GetAnonyString(const std::string &value); +std::string GetAnonyInt32(const int32_t value); +} // namespace DistributedHardware +} // namespace OHOS +#endif // OHOS_DCAMERA_ANONYMOUS_STRING_H diff --git a/common/include/utils/dh_log.h b/common/include/utils/dh_log.h new file mode 100644 index 00000000..ef907c19 --- /dev/null +++ b/common/include/utils/dh_log.h @@ -0,0 +1,46 @@ +/* + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OHOS_DCAMERA_LOG_H +#define OHOS_DCAMERA_LOG_H + +namespace OHOS { +namespace DistributedHardware { +typedef enum { + DH_LOG_DEBUG, + DH_LOG_INFO, + DH_LOG_WARN, + DH_LOG_ERROR, +} DHLogLevel; + +const std::string DC_LOG_TITLE_TAG = "DCAMERA"; +constexpr int32_t LOG_MAX_LEN = 4096; + +void DHLog(DHLogLevel logLevel, const char *fmt, ...); + +#define ULOGD(fmt, ...) DHLog(DH_LOG_DEBUG, \ + (std::string("[") + DH_LOG_TAG + "][" + __FUNCTION__ + "]:" + fmt).c_str(), ##__VA_ARGS__) + +#define ULOGI(fmt, ...) DHLog(DH_LOG_INFO, \ + (std::string("[") + DH_LOG_TAG + "][" + __FUNCTION__ + "]:" + fmt).c_str(), ##__VA_ARGS__) + +#define ULOGW(fmt, ...) DHLog(DH_LOG_WARN, \ + (std::string("[") + DH_LOG_TAG + "][" + __FUNCTION__ + "]:" + fmt).c_str(), ##__VA_ARGS__) + +#define ULOGE(fmt, ...) DHLog(DH_LOG_ERROR, \ + (std::string("[") + DH_LOG_TAG + "][" + __FUNCTION__ + "]:" + fmt).c_str(), ##__VA_ARGS__) +} // namespace DistributedHardware +} // namespace OHOS +#endif // OHOS_DCAMERA_LOG_H diff --git a/common/include/utils/distributed_hardware_log.h b/common/include/utils/distributed_hardware_log.h new file mode 100644 index 00000000..318f33c2 --- /dev/null +++ b/common/include/utils/distributed_hardware_log.h @@ -0,0 +1,38 @@ +/* + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OHOS_DCAMERA_LOG_H +#define OHOS_DCAMERA_LOG_H + +#include + +#include "dh_log.h" + +namespace OHOS { +namespace DistributedHardware { +#define DHLOGD(fmt, ...) DHLog(DH_LOG_DEBUG, \ + (std::string("[") + DH_LOG_TAG + "][" + __FUNCTION__ + "]:" + fmt).c_str(), ##__VA_ARGS__) + +#define DHLOGI(fmt, ...) DHLog(DH_LOG_INFO, \ + (std::string("[") + DH_LOG_TAG + "][" + __FUNCTION__ + "]:" + fmt).c_str(), ##__VA_ARGS__) + +#define DHLOGW(fmt, ...) DHLog(DH_LOG_WARN, \ + (std::string("[") + DH_LOG_TAG + "][" + __FUNCTION__ + "]:" + fmt).c_str(), ##__VA_ARGS__) + +#define DHLOGE(fmt, ...) DHLog(DH_LOG_ERROR, \ + (std::string("[") + DH_LOG_TAG + "][" + __FUNCTION__ + "]:" + fmt).c_str(), ##__VA_ARGS__) +} // namespace DistributedHardware +} // namespace OHOS +#endif // OHOS_DCAMERA_LOG_H diff --git a/common/src/utils/anonymous_string.cpp b/common/src/utils/anonymous_string.cpp new file mode 100644 index 00000000..c435970a --- /dev/null +++ b/common/src/utils/anonymous_string.cpp @@ -0,0 +1,102 @@ +/* + * Copyright (c) 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "anonymous_string.h" + +#include +#include +#include +#include +#include + +#include "securec.h" + +namespace OHOS { +namespace DistributedHardware { +constexpr int32_t WORD_WIDTH_8 = 8; +constexpr int32_t WORD_WIDTH_4 = 4; + +std::string GetRandomID() +{ + static std::random_device rd; + static std::uniform_int_distribution dist(0ULL, 0xFFFFFFFFFFFFFFFFULL); + uint64_t ab = dist(rd); + uint64_t cd = dist(rd); + uint32_t a, b, c, d; + std::stringstream ss; + ab = (ab & 0xFFFFFFFFFFFF0FFFULL) | 0x0000000000004000ULL; + cd = (cd & 0x3FFFFFFFFFFFFFFFULL) | 0x8000000000000000ULL; + a = (ab >> 32U); + b = (ab & 0xFFFFFFFFU); + c = (cd >> 32U); + d = (cd & 0xFFFFFFFFU); + ss << std::hex << std::nouppercase << std::setfill('0'); + ss << std::setw(WORD_WIDTH_8) << (a); + ss << std::setw(WORD_WIDTH_4) << (b >> 16U); + ss << std::setw(WORD_WIDTH_4) << (b & 0xFFFFU); + ss << std::setw(WORD_WIDTH_4) << (c >> 16U); + ss << std::setw(WORD_WIDTH_4) << (c & 0xFFFFU); + ss << std::setw(WORD_WIDTH_8) << d; + + return ss.str(); +} + +std::string GetAnonyString(const std::string &value) +{ + constexpr size_t INT32_SHORT_ID_LENGTH = 20; + constexpr size_t INT32_PLAINTEXT_LENGTH = 4; + constexpr size_t INT32_MIN_ID_LENGTH = 3; + std::string res; + std::string tmpStr("******"); + size_t strLen = value.length(); + if (strLen < INT32_MIN_ID_LENGTH) { + return tmpStr; + } + + if (strLen <= INT32_SHORT_ID_LENGTH) { + res += value[0]; + res += tmpStr; + res += value[strLen - 1]; + } else { + res.append(value, 0, INT32_PLAINTEXT_LENGTH); + res += tmpStr; + res.append(value, strLen - INT32_PLAINTEXT_LENGTH, INT32_PLAINTEXT_LENGTH); + } + + return res; +} + +std::string GetAnonyInt32(const int32_t value) +{ + constexpr int32_t INT32_STRING_LENGTH = 40; + char tempBuffer[INT32_STRING_LENGTH] = ""; + int32_t secRet = sprintf_s(tempBuffer, INT32_STRING_LENGTH, "%d", value); + if (secRet <= 0) { + std::string nullString(""); + return nullString; + } + size_t length = strlen(tempBuffer); + for (size_t i = 1; i <= length - 1; i++) { + tempBuffer[i] = '*'; + } + if (length == 0x01) { + tempBuffer[0] = '*'; + } + + std::string tempString(tempBuffer); + return tempString; +} +} // namespace DistributedHardware +} // namespace OHOS diff --git a/common/src/utils/dh_log.cpp b/common/src/utils/dh_log.cpp new file mode 100644 index 00000000..5750e528 --- /dev/null +++ b/common/src/utils/dh_log.cpp @@ -0,0 +1,87 @@ +/* + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "dh_log.h" + +#include "securec.h" + +#include "distributed_camera_constants.h" + +#ifdef HI_LOG_ENABLE +#include "hilog/log.h" +#else +#include +#endif + +namespace OHOS { +namespace DistributedHardware { +static void DHLogOut(DHLogLevel logLevel, const char *logBuf) +{ +#ifdef HI_LOG_ENABLE + LogLevel hiLogLevel = LOG_INFO; + switch (logLevel) { + case DH_LOG_DEBUG: + hiLogLevel = LOG_DEBUG; + break; + case DH_LOG_INFO: + hiLogLevel = LOG_INFO; + break; + case DH_LOG_WARN: + hiLogLevel = LOG_WARN; + break; + case DH_LOG_ERROR: + hiLogLevel = LOG_ERROR; + break; + default: + break; + } + (void)HiLogPrint(LOG_CORE, hiLogLevel, LOG_DOMAIN, DC_LOG_TITLE_TAG.c_str(), "%{public}s", logBuf); +#else + switch (logLevel) { + case DH_LOG_DEBUG: + printf("[D]%s\n", logBuf); + break; + case DH_LOG_INFO: + printf("[I]%s\n", logBuf); + break; + case DH_LOG_WARN: + printf("[W]%s\n", logBuf); + break; + case DH_LOG_ERROR: + printf("[E]%s\n", logBuf); + break; + default: + break; + } +#endif +} + +void DHLog(DHLogLevel logLevel, const char *fmt, ...) +{ + char logBuf[LOG_MAX_LEN] = {0}; + va_list arg; + + (void)memset_s(&arg, sizeof(va_list), 0, sizeof(va_list)); + va_start(arg, fmt); + int32_t ret = vsprintf_s(logBuf, sizeof(logBuf), fmt, arg); + va_end(arg); + if (ret < 0) { + DHLogOut(logLevel, "DH log length error."); + return; + } + DHLogOut(logLevel, logBuf); +} +} // namespace DistributedHardware +} // namespace OHOS diff --git a/distributedcamera.gni b/distributedcamera.gni index b49d45a3..a2f9d59d 100644 --- a/distributedcamera.gni +++ b/distributedcamera.gni @@ -34,8 +34,6 @@ fwk_utils_path = "${distributedhardwarefwk_path}/utils" fwk_common_path = "${distributedhardwarefwk_path}/common" -fwk_services_path = "${distributedhardwarefwk_path}/services" - build_flags = [ "-Werror" ] declare_args() { diff --git a/interfaces/inner_kits/native_cpp/camera_sink/BUILD.gn b/interfaces/inner_kits/native_cpp/camera_sink/BUILD.gn index 08504b1b..127bd5cf 100644 --- a/interfaces/inner_kits/native_cpp/camera_sink/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/camera_sink/BUILD.gn @@ -17,11 +17,8 @@ import( ohos_shared_library("distributed_camera_sink_sdk") { include_dirs = [ - "//utils/native/base/include", + "//commonlibrary/c_utils/base/include", "//utils/system/safwk/native/include", - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", "${fwk_common_path}/utils/include", ] @@ -38,11 +35,7 @@ ohos_shared_library("distributed_camera_sink_sdk") { "src/distributed_camera_sink_proxy.cpp", ] - deps = [ - "${common_path}:distributed_camera_utils", - "${fwk_utils_path}:distributedhardwareutils", - "//utils/native/base:utils", - ] + deps = [ "${common_path}:distributed_camera_utils" ] defines = [ "HI_LOG_ENABLE", @@ -51,6 +44,7 @@ ohos_shared_library("distributed_camera_sink_sdk") { ] external_deps = [ + "c_utils:utils", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", "samgr_standard:samgr_proxy", diff --git a/interfaces/inner_kits/native_cpp/camera_source/BUILD.gn b/interfaces/inner_kits/native_cpp/camera_source/BUILD.gn index 756242d9..1d57f302 100644 --- a/interfaces/inner_kits/native_cpp/camera_source/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/camera_source/BUILD.gn @@ -17,11 +17,8 @@ import( ohos_shared_library("distributed_camera_source_sdk") { include_dirs = [ - "//utils/native/base/include", + "//commonlibrary/c_utils/base/include", "//utils/system/safwk/native/include", - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", "${fwk_common_path}/utils/include", ] @@ -41,11 +38,7 @@ ohos_shared_library("distributed_camera_source_sdk") { "src/distributed_camera_source_proxy.cpp", ] - deps = [ - "${common_path}:distributed_camera_utils", - "${fwk_utils_path}:distributedhardwareutils", - "//utils/native/base:utils", - ] + deps = [ "${common_path}:distributed_camera_utils" ] defines = [ "HI_LOG_ENABLE", @@ -54,6 +47,7 @@ ohos_shared_library("distributed_camera_source_sdk") { ] external_deps = [ + "c_utils:utils", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", "samgr_standard:samgr_proxy", diff --git a/interfaces/inner_kits/native_cpp/camera_source/src/dcamera_source_handler.cpp b/interfaces/inner_kits/native_cpp/camera_source/src/dcamera_source_handler.cpp index 14cc544b..0cbb17a8 100644 --- a/interfaces/inner_kits/native_cpp/camera_source/src/dcamera_source_handler.cpp +++ b/interfaces/inner_kits/native_cpp/camera_source/src/dcamera_source_handler.cpp @@ -20,7 +20,6 @@ #include "dcamera_source_callback.h" #include "dcamera_source_handler_ipc.h" #include "dcamera_source_load_callback.h" -#include "dh_utils_tool.h" #include "distributed_camera_constants.h" #include "distributed_camera_errno.h" #include "distributed_hardware_log.h" diff --git a/interfaces/inner_kits/native_cpp/test/fuzztest/onsinklocaldmsdied_fuzzer/BUILD.gn b/interfaces/inner_kits/native_cpp/test/fuzztest/onsinklocaldmsdied_fuzzer/BUILD.gn index 02e9a404..5780cf32 100644 --- a/interfaces/inner_kits/native_cpp/test/fuzztest/onsinklocaldmsdied_fuzzer/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/fuzztest/onsinklocaldmsdied_fuzzer/BUILD.gn @@ -27,9 +27,7 @@ ohos_fuzztest("OnSinkLocalDmsDiedFuzzTest") { include_dirs = [ "//utils/native/base/include", "//utils/system/safwk/native/include", - "${fwk_utils_path}/include/log", "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", "${fwk_common_path}/utils/include", ] @@ -50,7 +48,7 @@ ohos_fuzztest("OnSinkLocalDmsDiedFuzzTest") { sources = [ "onsinklocaldmsdied_fuzzer.cpp" ] deps = [ - "${fwk_utils_path}:distributedhardwareutils", + "${common_path}:distributed_camera_utils", "${innerkits_path}/native_cpp/camera_sink:distributed_camera_sink_sdk", "//utils/native/base:utils", ] diff --git a/interfaces/inner_kits/native_cpp/test/fuzztest/onsourcelocaldmsdied_fuzzer/BUILD.gn b/interfaces/inner_kits/native_cpp/test/fuzztest/onsourcelocaldmsdied_fuzzer/BUILD.gn index 6d9d072a..c432e71b 100644 --- a/interfaces/inner_kits/native_cpp/test/fuzztest/onsourcelocaldmsdied_fuzzer/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/fuzztest/onsourcelocaldmsdied_fuzzer/BUILD.gn @@ -36,7 +36,6 @@ ohos_fuzztest("OnSourceLocalDmsDiedFuzzTest") { "${common_path}/include/constants", "${innerkits_path}/native_cpp/camera_source/include", "${innerkits_path}/native_cpp/camera_source/include/callback", - "${fwk_services_path}/distributedhardwarefwkserviceimpl/include/componentmanager", ] cflags = [ @@ -48,11 +47,7 @@ ohos_fuzztest("OnSourceLocalDmsDiedFuzzTest") { sources = [ "onsourcelocaldmsdied_fuzzer.cpp" ] - deps = [ - "${fwk_utils_path}:distributedhardwareutils", - "${innerkits_path}/native_cpp/camera_source:distributed_camera_source_sdk", - "//utils/native/base:utils", - ] + deps = [ "${innerkits_path}/native_cpp/camera_source:distributed_camera_source_sdk" ] defines = [ "HI_LOG_ENABLE", @@ -61,11 +56,13 @@ ohos_fuzztest("OnSourceLocalDmsDiedFuzzTest") { ] external_deps = [ + "c_utils:utils", "eventhandler:libeventhandler", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", "safwk:system_ability_fwk", - "samgr_standard:samgr_proxy", + "samgr:samgr_proxy", + ] } @@ -74,4 +71,4 @@ group("fuzztest") { testonly = true deps = [ ":OnSourceLocalDmsDiedFuzzTest" ] } -############################################################################### +############################################################################### \ No newline at end of file diff --git a/interfaces/inner_kits/native_cpp/test/fuzztest/sinkonloadsystemabilityfail_fuzzer/BUILD.gn b/interfaces/inner_kits/native_cpp/test/fuzztest/sinkonloadsystemabilityfail_fuzzer/BUILD.gn index c98aaa46..80ce8ddc 100644 --- a/interfaces/inner_kits/native_cpp/test/fuzztest/sinkonloadsystemabilityfail_fuzzer/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/fuzztest/sinkonloadsystemabilityfail_fuzzer/BUILD.gn @@ -44,12 +44,8 @@ ohos_fuzztest("SinkOnLoadSystemAbilityFailFuzzTest") { sources = [ "sinkonloadsystemabilityfail_fuzzer.cpp" ] - deps = [ - "${fwk_utils_path}:distributedhardwareutils", - "${innerkits_path}/native_cpp/camera_sink:distributed_camera_sink_sdk", - "//utils/native/base:utils", - ] - + deps = + [ "${innerkits_path}/native_cpp/camera_sink:distributed_camera_sink_sdk" ] defines = [ "HI_LOG_ENABLE", "DH_LOG_TAG=\"SinkOnLoadSystemAbilityFailFuzzTest\"", @@ -57,6 +53,7 @@ ohos_fuzztest("SinkOnLoadSystemAbilityFailFuzzTest") { ] external_deps = [ + "c_utils:utils", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", "safwk:system_ability_fwk", diff --git a/interfaces/inner_kits/native_cpp/test/fuzztest/sinkonloadsystemabilitysuccess_fuzzer/BUILD.gn b/interfaces/inner_kits/native_cpp/test/fuzztest/sinkonloadsystemabilitysuccess_fuzzer/BUILD.gn index 54b16ed7..e38ea26a 100644 --- a/interfaces/inner_kits/native_cpp/test/fuzztest/sinkonloadsystemabilitysuccess_fuzzer/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/fuzztest/sinkonloadsystemabilitysuccess_fuzzer/BUILD.gn @@ -45,7 +45,6 @@ ohos_fuzztest("SinkOnLoadSystemAbilitySuccessFuzzTest") { sources = [ "sinkonloadsystemabilitysuccess_fuzzer.cpp" ] deps = [ - "${fwk_utils_path}:distributedhardwareutils", "${innerkits_path}/native_cpp/camera_sink:distributed_camera_sink_sdk", "//utils/native/base:utils", ] diff --git a/interfaces/inner_kits/native_cpp/test/fuzztest/sourcehandlerconfigdistributedhardware_fuzzer/BUILD.gn b/interfaces/inner_kits/native_cpp/test/fuzztest/sourcehandlerconfigdistributedhardware_fuzzer/BUILD.gn index 28b35b09..0888c65e 100644 --- a/interfaces/inner_kits/native_cpp/test/fuzztest/sourcehandlerconfigdistributedhardware_fuzzer/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/fuzztest/sourcehandlerconfigdistributedhardware_fuzzer/BUILD.gn @@ -25,7 +25,6 @@ ohos_fuzztest("SourceHandlerConfigDistributedHardwareFuzzTest") { include_dirs = [ "//utils/system/safwk/native/include", - "${fwk_common_path}/utils/include", ] include_dirs += [ @@ -34,7 +33,6 @@ ohos_fuzztest("SourceHandlerConfigDistributedHardwareFuzzTest") { "${common_path}/include/constants", "${innerkits_path}/native_cpp/camera_source/include", "${innerkits_path}/native_cpp/camera_source/include/callback", - "${fwk_services_path}/distributedhardwarefwkserviceimpl/include/componentmanager", ] cflags = [ @@ -47,8 +45,6 @@ ohos_fuzztest("SourceHandlerConfigDistributedHardwareFuzzTest") { sources = [ "sourcehandlerconfigdistributedhardware_fuzzer.cpp" ] deps = [ - "${fwk_services_path}/distributedhardwarefwkserviceimpl/:distributedhardwarefwksvr_impl", - "${fwk_utils_path}:distributedhardwareutils", "${innerkits_path}/native_cpp/camera_source:distributed_camera_source_sdk", "//utils/native/base:utils", ] diff --git a/interfaces/inner_kits/native_cpp/test/fuzztest/sourcehandlerinitsource_fuzzer/BUILD.gn b/interfaces/inner_kits/native_cpp/test/fuzztest/sourcehandlerinitsource_fuzzer/BUILD.gn index 1aced34d..0de0bcc7 100644 --- a/interfaces/inner_kits/native_cpp/test/fuzztest/sourcehandlerinitsource_fuzzer/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/fuzztest/sourcehandlerinitsource_fuzzer/BUILD.gn @@ -25,7 +25,6 @@ ohos_fuzztest("SourceHandlerInitSourceFuzzTest") { include_dirs = [ "//utils/system/safwk/native/include", - "${fwk_common_path}/utils/include", ] include_dirs += [ @@ -34,7 +33,6 @@ ohos_fuzztest("SourceHandlerInitSourceFuzzTest") { "${common_path}/include/constants", "${innerkits_path}/native_cpp/camera_source/include", "${innerkits_path}/native_cpp/camera_source/include/callback", - "${fwk_services_path}/distributedhardwarefwkserviceimpl/include/componentmanager", ] cflags = [ @@ -47,8 +45,6 @@ ohos_fuzztest("SourceHandlerInitSourceFuzzTest") { sources = [ "sourcehandlerinitsource_fuzzer.cpp" ] deps = [ - "${fwk_services_path}/distributedhardwarefwkserviceimpl/:distributedhardwarefwksvr_impl", - "${fwk_utils_path}:distributedhardwareutils", "${innerkits_path}/native_cpp/camera_source:distributed_camera_source_sdk", "//utils/native/base:utils", ] diff --git a/interfaces/inner_kits/native_cpp/test/fuzztest/sourcehandlerregisterdistributedhardware_fuzzer/BUILD.gn b/interfaces/inner_kits/native_cpp/test/fuzztest/sourcehandlerregisterdistributedhardware_fuzzer/BUILD.gn index b100dc5e..33d78943 100644 --- a/interfaces/inner_kits/native_cpp/test/fuzztest/sourcehandlerregisterdistributedhardware_fuzzer/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/fuzztest/sourcehandlerregisterdistributedhardware_fuzzer/BUILD.gn @@ -35,7 +35,7 @@ ohos_fuzztest("SourceHandlerRegisterDistributedHardwareFuzzTest") { "${common_path}/include/constants", "${innerkits_path}/native_cpp/camera_source/include", "${innerkits_path}/native_cpp/camera_source/include/callback", - "${fwk_services_path}/distributedhardwarefwkserviceimpl/include/componentmanager", + "${innerkits_path}/native_cpp/test/include", ] cflags = [ @@ -48,8 +48,6 @@ ohos_fuzztest("SourceHandlerRegisterDistributedHardwareFuzzTest") { sources = [ "sourcehandlerregisterdistributedhardware_fuzzer.cpp" ] deps = [ - "${fwk_services_path}/distributedhardwarefwkserviceimpl/:distributedhardwarefwksvr_impl", - "${fwk_utils_path}:distributedhardwareutils", "${innerkits_path}/native_cpp/camera_source:distributed_camera_source_sdk", "//utils/native/base:utils", ] diff --git a/interfaces/inner_kits/native_cpp/test/fuzztest/sourcehandlerunregisterdistributedhardware_fuzzer/BUILD.gn b/interfaces/inner_kits/native_cpp/test/fuzztest/sourcehandlerunregisterdistributedhardware_fuzzer/BUILD.gn index 2b106da6..1a254aec 100644 --- a/interfaces/inner_kits/native_cpp/test/fuzztest/sourcehandlerunregisterdistributedhardware_fuzzer/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/fuzztest/sourcehandlerunregisterdistributedhardware_fuzzer/BUILD.gn @@ -35,7 +35,7 @@ ohos_fuzztest("SourceHandlerUnregisterDistributedHardwareFuzzTest") { "${common_path}/include/constants", "${innerkits_path}/native_cpp/camera_source/include", "${innerkits_path}/native_cpp/camera_source/include/callback", - "${fwk_services_path}/distributedhardwarefwkserviceimpl/include/componentmanager", + "${innerkits_path}/native_cpp/test/include", ] cflags = [ @@ -48,8 +48,6 @@ ohos_fuzztest("SourceHandlerUnregisterDistributedHardwareFuzzTest") { sources = [ "sourcehandlerunregisterdistributedhardware_fuzzer.cpp" ] deps = [ - "${fwk_services_path}/distributedhardwarefwkserviceimpl/:distributedhardwarefwksvr_impl", - "${fwk_utils_path}:distributedhardwareutils", "${innerkits_path}/native_cpp/camera_source:distributed_camera_source_sdk", "//utils/native/base:utils", ] diff --git a/interfaces/inner_kits/native_cpp/test/fuzztest/sourceonloadsystemabilityfail_fuzzer/BUILD.gn b/interfaces/inner_kits/native_cpp/test/fuzztest/sourceonloadsystemabilityfail_fuzzer/BUILD.gn index 5f68d8a9..39dda0ce 100644 --- a/interfaces/inner_kits/native_cpp/test/fuzztest/sourceonloadsystemabilityfail_fuzzer/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/fuzztest/sourceonloadsystemabilityfail_fuzzer/BUILD.gn @@ -46,7 +46,6 @@ ohos_fuzztest("SourceOnLoadSystemAbilityFailFuzzTest") { sources = [ "sourceonloadsystemabilityfail_fuzzer.cpp" ] deps = [ - "${fwk_utils_path}:distributedhardwareutils", "${innerkits_path}/native_cpp/camera_source:distributed_camera_source_sdk", "//utils/native/base:utils", ] diff --git a/interfaces/inner_kits/native_cpp/test/fuzztest/sourceonloadsystemabilitysuccess_fuzzer/BUILD.gn b/interfaces/inner_kits/native_cpp/test/fuzztest/sourceonloadsystemabilitysuccess_fuzzer/BUILD.gn index 3312c6ec..112a35d0 100644 --- a/interfaces/inner_kits/native_cpp/test/fuzztest/sourceonloadsystemabilitysuccess_fuzzer/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/fuzztest/sourceonloadsystemabilitysuccess_fuzzer/BUILD.gn @@ -46,7 +46,6 @@ ohos_fuzztest("SourceOnLoadSystemAbilitySuccessFuzzTest") { sources = [ "sourceonloadsystemabilitysuccess_fuzzer.cpp" ] deps = [ - "${fwk_utils_path}:distributedhardwareutils", "${innerkits_path}/native_cpp/camera_source:distributed_camera_source_sdk", "//utils/native/base:utils", ] diff --git a/interfaces/inner_kits/native_cpp/test/include/mock_component_disable.h b/interfaces/inner_kits/native_cpp/test/include/mock_component_disable.h new file mode 100644 index 00000000..d76d3fe7 --- /dev/null +++ b/interfaces/inner_kits/native_cpp/test/include/mock_component_disable.h @@ -0,0 +1,48 @@ +/* + * Copyright (c) 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OHOS_DCAMERA_MOCK_COMPONENT_DISABLE_H +#define OHOS_DCAMERA_MOCK_COMPONENT_DISABLE_H + +#include "distributed_camera_errno.h" +#include "idistributed_hardware_source.h" + +namespace OHOS { +namespace DistributedHardware { +class MockComponentDisable : public std::enable_shared_from_this, public UnregisterCallback { +public: + MockComponentDisable() + { + } + + virtual ~MockComponentDisable() + { + } + + int32_t Disable(const std::string &networkId, const std::string &dhId, + IDistributedHardwareSource *handler) + { + return DCAMERA_OK; + } + + int32_t OnUnregisterResult(const std::string &networkId, const std::string &dhId, int32_t status, + const std::string &data) override + { + return DCAMERA_OK; + } +}; +} // namespace DistributedHardware +} // namespace OHOS +#endif diff --git a/interfaces/inner_kits/native_cpp/test/include/mock_component_enable.h b/interfaces/inner_kits/native_cpp/test/include/mock_component_enable.h new file mode 100644 index 00000000..c6b36623 --- /dev/null +++ b/interfaces/inner_kits/native_cpp/test/include/mock_component_enable.h @@ -0,0 +1,48 @@ +/* + * Copyright (c) 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OHOS_DCAMERA_MOCK_COMPONENT_ENABLE_H +#define OHOS_DCAMERA_MOCK_COMPONENT_ENABLE_H + +#include "distributed_camera_errno.h" +#include "idistributed_hardware_source.h" + +namespace OHOS { +namespace DistributedHardware { +class MockComponentEnable : public std::enable_shared_from_this, public RegisterCallback { +public: + explicit MockComponentEnable() + { + } + + virtual ~MockComponentEnable() + { + } + + int32_t Enable(const std::string &uuid, const std::string &dhId, const EnableParam ¶m, + IDistributedHardwareSource *handler) + { + return DCAMERA_OK; + } + + int32_t OnRegisterResult(const std::string &uuid, const std::string &dhId, int32_t status, + const std::string &data) override + { + return DCAMERA_OK; + } +}; +} // namespace DistributedHardware +} // namespace OHOS +#endif diff --git a/services/cameraservice/cameraoperator/client/BUILD.gn b/services/cameraservice/cameraoperator/client/BUILD.gn index 879511f6..bb0d57b0 100644 --- a/services/cameraservice/cameraoperator/client/BUILD.gn +++ b/services/cameraservice/cameraoperator/client/BUILD.gn @@ -32,10 +32,6 @@ ohos_shared_library("distributed_camera_client") { "${camerastandard_path}/services/camera_service/binder/client/include", "${camerastandard_path}/services/camera_service/binder/server/include", "${camerastandard_path}/services/camera_service/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", ] include_dirs += [ @@ -74,7 +70,6 @@ ohos_shared_library("distributed_camera_client") { deps = [ "${camerastandard_path}/frameworks/native/camera:camera_framework", "${common_path}:distributed_camera_utils", - "${fwk_utils_path}:distributedhardwareutils", "${graphicstandard_path}:libsurface", "//drivers/peripheral/camera/interfaces/metadata:metadata", "//third_party/jsoncpp:jsoncpp", diff --git a/services/cameraservice/cameraoperator/client/test/unittest/common/cameraoperator/BUILD.gn b/services/cameraservice/cameraoperator/client/test/unittest/common/cameraoperator/BUILD.gn index 08c9981d..69316e7f 100644 --- a/services/cameraservice/cameraoperator/client/test/unittest/common/cameraoperator/BUILD.gn +++ b/services/cameraservice/cameraoperator/client/test/unittest/common/cameraoperator/BUILD.gn @@ -22,7 +22,7 @@ config("module_private_config") { include_dirs = [ "//drivers/peripheral/camera/interfaces/metadata/include", "//third_party/jsoncpp/include", - "//utils/native/base/include", + "//commonlibrary/c_utils/base/include", "//utils/system/safwk/native/include", "${graphicstandard_path}/frameworks/surface/include", "${camerastandard_path}/interfaces/inner_api/native/camera/include", @@ -33,9 +33,7 @@ config("module_private_config") { "${camerastandard_path}/services/camera_service/binder/client/include", "${camerastandard_path}/services/camera_service/binder/server/include", "${camerastandard_path}/services/camera_service/include", - "${fwk_common_path}/log/include", "${fwk_common_path}/utils/include", - "${fwk_utils_path}/include/log", "${fwk_utils_path}/include", ] @@ -60,7 +58,6 @@ ohos_unittest("DCameraClientTest") { deps = [ "${camerastandard_path}/frameworks/native/camera:camera_framework", "${common_path}:distributed_camera_utils", - "${fwk_utils_path}:distributedhardwareutils", "${graphicstandard_path}:libsurface", "${services_path}/cameraservice/cameraoperator/client:distributed_camera_client", "${services_path}/cameraservice/cameraoperator/handler:distributed_camera_handler", @@ -68,10 +65,10 @@ ohos_unittest("DCameraClientTest") { "//drivers/peripheral/camera/interfaces/metadata:metadata", "//third_party/googletest:gtest_main", "//third_party/jsoncpp:jsoncpp", - "//utils/native/base:utils", ] external_deps = [ + "c_utils:utils", "drivers_interface_distributed_camera:libdistributed_camera_provider_proxy_1.0", "eventhandler:libeventhandler", "hiviewdfx_hilog_native:libhilog", diff --git a/services/cameraservice/cameraoperator/handler/BUILD.gn b/services/cameraservice/cameraoperator/handler/BUILD.gn index 6a61f095..8576724d 100644 --- a/services/cameraservice/cameraoperator/handler/BUILD.gn +++ b/services/cameraservice/cameraoperator/handler/BUILD.gn @@ -32,9 +32,7 @@ ohos_shared_library("distributed_camera_handler") { "${camerastandard_path}/services/camera_service/binder/server/include", "${camerastandard_path}/services/camera_service/include", "${mediastandard_path}/interfaces/innerkits/native/media/include", - "${fwk_common_path}/log/include", "${fwk_common_path}/utils/include", - "${fwk_utils_path}/include/log", "${fwk_utils_path}/include", ] @@ -56,7 +54,6 @@ ohos_shared_library("distributed_camera_handler") { deps = [ "${camerastandard_path}/frameworks/native/camera:camera_framework", "${common_path}:distributed_camera_utils", - "${fwk_utils_path}:distributedhardwareutils", "${graphicstandard_path}:libsurface", "//drivers/peripheral/camera/interfaces/metadata:metadata", "//third_party/jsoncpp:jsoncpp", diff --git a/services/cameraservice/cameraoperator/handler/test/unittest/common/dcamerahandler/BUILD.gn b/services/cameraservice/cameraoperator/handler/test/unittest/common/dcamerahandler/BUILD.gn index f459f094..6b841ccb 100644 --- a/services/cameraservice/cameraoperator/handler/test/unittest/common/dcamerahandler/BUILD.gn +++ b/services/cameraservice/cameraoperator/handler/test/unittest/common/dcamerahandler/BUILD.gn @@ -32,9 +32,7 @@ config("module_private_config") { "${camerastandard_path}/services/camera_service/binder/client/include", "${camerastandard_path}/services/camera_service/binder/server/include", "${camerastandard_path}/services/camera_service/include", - "${fwk_common_path}/log/include", "${fwk_common_path}/utils/include", - "${fwk_utils_path}/include/log", "${fwk_utils_path}/include", ] @@ -57,7 +55,6 @@ ohos_unittest("DCameraHandlerTest") { deps = [ "${camerastandard_path}/frameworks/native/camera:camera_framework", "${common_path}:distributed_camera_utils", - "${fwk_utils_path}:distributedhardwareutils", "${graphicstandard_path}:libsurface", "${services_path}/cameraservice/cameraoperator/handler:distributed_camera_handler", "//drivers/peripheral/camera/interfaces/metadata:metadata", diff --git a/services/cameraservice/sinkservice/BUILD.gn b/services/cameraservice/sinkservice/BUILD.gn index 6780bc1a..17ece613 100644 --- a/services/cameraservice/sinkservice/BUILD.gn +++ b/services/cameraservice/sinkservice/BUILD.gn @@ -30,11 +30,8 @@ ohos_shared_library("distributed_camera_sink") { "${camerastandard_path}/services/camera_service/binder/client/include", "${camerastandard_path}/services/camera_service/binder/server/include", "${camerastandard_path}/services/camera_service/include", - "${fwk_common_path}/log/include", "${fwk_common_path}/utils/include", "${fwk_utils_path}/include/eventbus", - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", "//third_party/jsoncpp/include", ] @@ -99,7 +96,6 @@ ohos_shared_library("distributed_camera_sink") { deps = [ "${camerastandard_path}/frameworks/native/camera:camera_framework", "${common_path}:distributed_camera_utils", - "${fwk_utils_path}:distributedhardwareutils", "${graphicstandard_path}:libsurface", "${services_path}/cameraservice/cameraoperator/client:distributed_camera_client", "${services_path}/cameraservice/cameraoperator/handler:distributed_camera_handler", diff --git a/services/cameraservice/sinkservice/test/unittest/common/distributedcamera/BUILD.gn b/services/cameraservice/sinkservice/test/unittest/common/distributedcamera/BUILD.gn index 8c30a5d9..fe4ee254 100644 --- a/services/cameraservice/sinkservice/test/unittest/common/distributedcamera/BUILD.gn +++ b/services/cameraservice/sinkservice/test/unittest/common/distributedcamera/BUILD.gn @@ -33,10 +33,6 @@ config("module_private_config") { "${camerastandard_path}/services/camera_service/binder/client/include", "${camerastandard_path}/services/camera_service/binder/server/include", "${camerastandard_path}/services/camera_service/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", ] include_dirs += [ @@ -58,7 +54,6 @@ ohos_unittest("DistributedCameraSinkServiceTest") { deps = [ "${camerastandard_path}/frameworks/native/camera:camera_framework", "${common_path}:distributed_camera_utils", - "${fwk_utils_path}:distributedhardwareutils", "${graphicstandard_path}:libsurface", "${innerkits_path}/native_cpp/camera_sink:distributed_camera_sink_sdk", "${services_path}/cameraservice/cameraoperator/handler:distributed_camera_handler", diff --git a/services/cameraservice/sinkservice/test/unittest/common/distributedcameramgr/BUILD.gn b/services/cameraservice/sinkservice/test/unittest/common/distributedcameramgr/BUILD.gn index 06587a6c..19de8ff3 100644 --- a/services/cameraservice/sinkservice/test/unittest/common/distributedcameramgr/BUILD.gn +++ b/services/cameraservice/sinkservice/test/unittest/common/distributedcameramgr/BUILD.gn @@ -48,11 +48,6 @@ config("module_private_config") { "${innerkits_path}/native_cpp/camera_source/include/callback", "${fwk_utils_path}/include/eventbus", - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/utils/include", - "${fwk_common_path}/log/include", - "//drivers/peripheral/base", "//drivers/peripheral/camera/interfaces/metadata/include", ] @@ -74,7 +69,6 @@ ohos_unittest("DCameraSinkMgrTest") { deps = [ "${camerastandard_path}/frameworks/native/camera:camera_framework", "${common_path}:distributed_camera_utils", - "${fwk_utils_path}:distributedhardwareutils", "${graphicstandard_path}:libsurface", "${services_path}/cameraservice/cameraoperator/handler:distributed_camera_handler", "${services_path}/cameraservice/sinkservice:distributed_camera_sink", diff --git a/services/cameraservice/sourceservice/BUILD.gn b/services/cameraservice/sourceservice/BUILD.gn index 1929f4e8..de818a1a 100644 --- a/services/cameraservice/sourceservice/BUILD.gn +++ b/services/cameraservice/sourceservice/BUILD.gn @@ -20,11 +20,8 @@ ohos_shared_library("distributed_camera_source") { include_dirs = [ "//utils/native/base/include", "//utils/system/safwk/native/include", - "${fwk_common_path}/log/include", "${fwk_common_path}/utils/include", "${fwk_utils_path}/include/eventbus", - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", "//third_party/jsoncpp/include", "//drivers/peripheral/base", ] @@ -87,7 +84,6 @@ ohos_shared_library("distributed_camera_source") { deps = [ "${common_path}:distributed_camera_utils", - "${fwk_utils_path}:distributedhardwareutils", "${services_path}/channel:distributed_camera_channel", "${services_path}/data_process:distributed_camera_data_process", "//third_party/jsoncpp:jsoncpp", diff --git a/services/cameraservice/sourceservice/test/unittest/common/distributedcameramgr/BUILD.gn b/services/cameraservice/sourceservice/test/unittest/common/distributedcameramgr/BUILD.gn index c9f1e981..df8521ff 100644 --- a/services/cameraservice/sourceservice/test/unittest/common/distributedcameramgr/BUILD.gn +++ b/services/cameraservice/sourceservice/test/unittest/common/distributedcameramgr/BUILD.gn @@ -41,12 +41,10 @@ config("module_private_config") { "${innerkits_path}/native_cpp/camera_source/include/callback", "${innerkits_path}/native_cpp/camera_sink/include", - "${fwk_utils_path}/include/log", "${fwk_utils_path}/include", "${fwk_utils_path}/include/eventbus", "${fwk_common_path}/utils/include", - "${fwk_common_path}/log/include", - "//utils/native/base/include", + "//commonlibrary/c_utils/base/include", "//utils/system/safwk/native/include", "//third_party/jsoncpp/include", "//drivers/peripheral/base/", @@ -62,7 +60,6 @@ ohos_unittest("DCameraSourceMgrTest") { deps = [ "${common_path}:distributed_camera_utils", - "${fwk_utils_path}:distributedhardwareutils", "${services_path}/cameraservice/sourceservice:distributed_camera_source", "${services_path}/channel:distributed_camera_channel", "//third_party/googletest:gtest_main", diff --git a/services/channel/BUILD.gn b/services/channel/BUILD.gn index 75cab6f2..72db816e 100644 --- a/services/channel/BUILD.gn +++ b/services/channel/BUILD.gn @@ -20,10 +20,7 @@ ohos_shared_library("distributed_camera_channel") { include_dirs = [ "//utils/native/base/include", "//utils/system/safwk/native/include", - "${fwk_common_path}/log/include", "${fwk_common_path}/utils/include", - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", ] include_dirs += [ @@ -41,8 +38,6 @@ ohos_shared_library("distributed_camera_channel") { deps = [ "${common_path}:distributed_camera_utils", - "${fwk_utils_path}:distributedhardwareutils", - "//utils/native/base:utils", ] defines = [ diff --git a/services/data_process/BUILD.gn b/services/data_process/BUILD.gn index 72e5e377..4f0b5d7e 100644 --- a/services/data_process/BUILD.gn +++ b/services/data_process/BUILD.gn @@ -25,11 +25,8 @@ ohos_shared_library("distributed_camera_data_process") { "//foundation/graphic/graphic_2d/interfaces/innerkits/surface", "//drivers/peripheral/display/interfaces/include", "//foundation/multimedia/player_framework/interfaces/innerkits/native/media/include", - "${fwk_common_path}/log/include", "${fwk_common_path}/utils/include", - "${fwk_utils_path}/include/log", "${fwk_utils_path}/include/eventbus", - "${fwk_utils_path}/include", ] include_dirs += [ @@ -74,7 +71,6 @@ ohos_shared_library("distributed_camera_data_process") { deps = [ "${common_path}:distributed_camera_utils", - "${fwk_utils_path}:distributedhardwareutils", "//foundation/graphic/graphic_2d/frameworks/surface:surface", "//utils/native/base:utils", ] -- Gitee