diff --git a/audiohandler/test/unittest/BUILD.gn b/audiohandler/test/unittest/BUILD.gn index 79f9e3cbb75f7c2b6121dd31404e67757e7fb266..57f9b1c38bd27b9bf5bd66b9ffc7fa66d318039e 100644 --- a/audiohandler/test/unittest/BUILD.gn +++ b/audiohandler/test/unittest/BUILD.gn @@ -20,15 +20,6 @@ config("module_private_config") { visibility = [ ":*" ] include_dirs = [ - "${fwk_common_path}/utils/include", - "${mediastandard_path}/interfaces/inner_api/native", - "${mediastandard_path}/services/utils/include", - "${mediastandardfwk_path}/audiocapturer/include", - "${mediastandardfwk_path}/audiocommon/include", - "${mediastandardfwk_path}/audiomanager/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${distributedaudio_path}/audiohandler/include", @@ -44,15 +35,15 @@ ohos_unittest("AudioHandlerTest") { configs = [ ":module_private_config" ] - deps = [ - "${distributedaudio_path}/audiohandler:distributed_audio_handler", - "//third_party/googletest:gtest_main", - ] + deps = [ "${distributedaudio_path}/audiohandler:distributed_audio_handler" ] external_deps = [ + "audio_framework:audio_capturer", + "audio_framework:audio_client", "audio_framework:audio_renderer", "cJSON:cjson", "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "hilog:libhilog", ] } diff --git a/common/dfx_utils/test/unittest/BUILD.gn b/common/dfx_utils/test/unittest/BUILD.gn index 9ccb142d4f8859a300995582edef46761cf4e567..a48b76519c0cbdfc07810011764a2a576bdc8107 100644 --- a/common/dfx_utils/test/unittest/BUILD.gn +++ b/common/dfx_utils/test/unittest/BUILD.gn @@ -34,8 +34,6 @@ config("module_private_config") { "${common_path}/include", "${common_path}/dfx_utils/include", "${distributedaudio_path}/audiohandler/include", - "${driver_audio_path}/include", - "${hdf_service_path}/hdi_service/common/include", "${interfaces_path}/inner_kits/native_cpp/audio_sink/include", "${interfaces_path}/inner_kits/native_cpp/audio_source/include", "${innerkits_path}/native_cpp/audio_source/include", @@ -44,11 +42,6 @@ config("module_private_config") { "${services_path}/common/audiodata/include", "${services_path}/common/audioeventcallback", "${services_path}/audiomanager/managersource/include", - "${fwk_common_path}/utils/include", - "${mediastandardfwk_path}/audiocapturer/include", - "${mediastandardfwk_path}/audiocommon/include", - "${mediastandardfwk_path}/audiorenderer/include", - "${mediastandardfwk_path}/audiomanager/include", ] } @@ -74,17 +67,18 @@ ohos_unittest("DAudioDfxTest") { deps = [ "${services_path}/audiomanager/servicesource:distributed_audio_source", "${services_path}/common:distributed_audio_utils", - "//third_party/googletest:gmock", - "//third_party/googletest:gtest_main", ] external_deps = [ "audio_framework:audio_capturer", + "audio_framework:audio_client", "audio_framework:audio_renderer", "cJSON:cjson", "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "drivers_interface_distributed_audio:libdaudio_proxy_1.0", "dsoftbus:softbus_client", + "googletest:gmock", "hisysevent:libhisysevent", "hitrace:hitrace_meter", "ipc:ipc_core", diff --git a/common/dfx_utils/test/unittest/src/daudio_hitrace_test.cpp b/common/dfx_utils/test/unittest/src/daudio_hitrace_test.cpp index 3b06c2ef6e4b06856b368cb46472943d5f79afa4..b8856bd445570c3d229723205b985558ce3cac3c 100644 --- a/common/dfx_utils/test/unittest/src/daudio_hitrace_test.cpp +++ b/common/dfx_utils/test/unittest/src/daudio_hitrace_test.cpp @@ -52,6 +52,7 @@ HWTEST_F(DAudioHitraceTest, End_001, TestSize.Level1) hitrace_->End(); hitrace_->isFinished_ = true; hitrace_->End(); + EXPECT_EQ(true, hitrace_->isFinished_); } } // DistributedHardware } // OHOS diff --git a/common/src/daudio_util.cpp b/common/src/daudio_util.cpp index 5ea63198dd5369295961eb3c677824a258230f90..2ea362b2cca21a10a5e4c905aea77d8f68a6bee3 100644 --- a/common/src/daudio_util.cpp +++ b/common/src/daudio_util.cpp @@ -263,7 +263,7 @@ int32_t GetAudioParamInt(const std::string ¶ms, const std::string &key, int3 DHLOGE("String is not number. str:%{public}s.", val.c_str()); return ERR_DH_AUDIO_NOT_SUPPORT; } - value = std::stoi(val); + value = std::atoi(val.c_str()); return DH_SUCCESS; } diff --git a/common/test/unittest/BUILD.gn b/common/test/unittest/BUILD.gn index ba2fef4ae01c7290df1763ba766f3e653bdd5fff..95bbdada75d98da49a64225630f2bfbc80d45009 100644 --- a/common/test/unittest/BUILD.gn +++ b/common/test/unittest/BUILD.gn @@ -21,9 +21,7 @@ module_output_path = "distributed_audio/common/daudio_util_test" config("module_private_config") { visibility = [ ":*" ] - include_dirs = [ "${fwk_common_path}/utils/include" ] - - include_dirs += [ + include_dirs = [ "${common_path}/include", "include", ] @@ -36,14 +34,12 @@ ohos_unittest("DaudioUtilsTest") { configs = [ ":module_private_config" ] - deps = [ - "${services_path}/common:distributed_audio_utils", - "//third_party/googletest:gtest_main", - ] + deps = [ "${services_path}/common:distributed_audio_utils" ] external_deps = [ "cJSON:cjson", "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "hilog:libhilog", ] diff --git a/interfaces/inner_kits/native_cpp/test/fuzztest/onremotesinksvrdied_fuzzer/BUILD.gn b/interfaces/inner_kits/native_cpp/test/fuzztest/onremotesinksvrdied_fuzzer/BUILD.gn index bc4c665cdb286acc963aa79106777a888ffbd722..ab6491ff1c1482860331278aaf42f8b768eaf5ba 100755 --- a/interfaces/inner_kits/native_cpp/test/fuzztest/onremotesinksvrdied_fuzzer/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/fuzztest/onremotesinksvrdied_fuzzer/BUILD.gn @@ -31,13 +31,6 @@ ohos_fuzztest("OnRemoteSinkSvrDiedFuzzTest") { sources = [ "onremotesinksvrdied_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${innerkits_path}/native_cpp/audio_sink/include", @@ -54,6 +47,7 @@ ohos_fuzztest("OnRemoteSinkSvrDiedFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "ipc:ipc_core", "samgr:samgr_proxy", ] diff --git a/interfaces/inner_kits/native_cpp/test/fuzztest/onremotesourcesvrdied_fuzzer/BUILD.gn b/interfaces/inner_kits/native_cpp/test/fuzztest/onremotesourcesvrdied_fuzzer/BUILD.gn index f4dff95c98d391e5dd3d704e706d3190ef4772b7..b26801616e90304d78367b3c7d022d50f2d38cae 100755 --- a/interfaces/inner_kits/native_cpp/test/fuzztest/onremotesourcesvrdied_fuzzer/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/fuzztest/onremotesourcesvrdied_fuzzer/BUILD.gn @@ -31,13 +31,6 @@ ohos_fuzztest("OnRemoteSourceSvrDiedFuzzTest") { sources = [ "onremotesourcesvrdied_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${innerkits_path}/native_cpp/audio_source/include", @@ -55,6 +48,7 @@ ohos_fuzztest("OnRemoteSourceSvrDiedFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "ipc:ipc_core", "samgr:samgr_proxy", ] diff --git a/interfaces/inner_kits/native_cpp/test/fuzztest/sinkhandlerfinishstartsa_fuzzer/BUILD.gn b/interfaces/inner_kits/native_cpp/test/fuzztest/sinkhandlerfinishstartsa_fuzzer/BUILD.gn index 1e4aa56f8e8882e3b749ba454b348e461f040b05..fd0eabae90d9c6ddcfb5c229d5a259dab50715e1 100755 --- a/interfaces/inner_kits/native_cpp/test/fuzztest/sinkhandlerfinishstartsa_fuzzer/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/fuzztest/sinkhandlerfinishstartsa_fuzzer/BUILD.gn @@ -30,13 +30,6 @@ ohos_fuzztest("SinkHandlerFinishStartSAFuzzTest") { sources = [ "sinkhandlerfinishstartsa_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${innerkits_path}/native_cpp/audio_sink/include", @@ -53,6 +46,7 @@ ohos_fuzztest("SinkHandlerFinishStartSAFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "ipc:ipc_core", "samgr:samgr_proxy", ] diff --git a/interfaces/inner_kits/native_cpp/test/fuzztest/sinkhandlerinitsink_fuzzer/BUILD.gn b/interfaces/inner_kits/native_cpp/test/fuzztest/sinkhandlerinitsink_fuzzer/BUILD.gn index 5fb5339eea02944719ce5475f23a9ea849898099..df0da7ae74940df6b7f2f7d8ddef96179f0d1b98 100755 --- a/interfaces/inner_kits/native_cpp/test/fuzztest/sinkhandlerinitsink_fuzzer/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/fuzztest/sinkhandlerinitsink_fuzzer/BUILD.gn @@ -31,13 +31,6 @@ ohos_fuzztest("SinkHandlerInitSinkFuzzTest") { sources = [ "sinkhandlerinitsink_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${innerkits_path}/native_cpp/audio_sink/include", @@ -46,7 +39,10 @@ ohos_fuzztest("SinkHandlerInitSinkFuzzTest") { deps = [ "${innerkits_path}/native_cpp/audio_sink:distributed_audio_sink_sdk" ] - external_deps = [ "c_utils:utils" ] + external_deps = [ + "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", + ] defines = [ "HI_LOG_ENABLE", diff --git a/interfaces/inner_kits/native_cpp/test/fuzztest/sinkhandlerpausedistributedhardware_fuzzer/BUILD.gn b/interfaces/inner_kits/native_cpp/test/fuzztest/sinkhandlerpausedistributedhardware_fuzzer/BUILD.gn index d56fa2b9bc1405b164711cc4d63e1ace9e0f01d4..dd472da60b503273dbcf197881ce9e2a8cdc752d 100644 --- a/interfaces/inner_kits/native_cpp/test/fuzztest/sinkhandlerpausedistributedhardware_fuzzer/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/fuzztest/sinkhandlerpausedistributedhardware_fuzzer/BUILD.gn @@ -31,13 +31,6 @@ ohos_fuzztest("SinkHandlerPauseDistributedHardwareFuzzTest") { sources = [ "sinkhandlerpausedistributedhardware_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${innerkits_path}/native_cpp/audio_sink/include", @@ -46,7 +39,10 @@ ohos_fuzztest("SinkHandlerPauseDistributedHardwareFuzzTest") { deps = [ "${innerkits_path}/native_cpp/audio_sink:distributed_audio_sink_sdk" ] - external_deps = [ "c_utils:utils" ] + external_deps = [ + "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", + ] defines = [ "HI_LOG_ENABLE", diff --git a/interfaces/inner_kits/native_cpp/test/fuzztest/sinkhandlerregisterprivacyresources_fuzzer/BUILD.gn b/interfaces/inner_kits/native_cpp/test/fuzztest/sinkhandlerregisterprivacyresources_fuzzer/BUILD.gn index c3bda4c4669bfe0baefcda62d15624b7a2cfb312..2d98fbf7d94eb85e9cf30caac2c7772d61654cf5 100644 --- a/interfaces/inner_kits/native_cpp/test/fuzztest/sinkhandlerregisterprivacyresources_fuzzer/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/fuzztest/sinkhandlerregisterprivacyresources_fuzzer/BUILD.gn @@ -31,19 +31,10 @@ ohos_fuzztest("SinkHandlerRegisterPrivacyResourcesFuzzTest") { sources = [ "sinkhandlerregisterprivacyresources_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${innerkits_path}/native_cpp/audio_sink/include", "${innerkits_path}/native_cpp/test/include", - "${fwk_services_path}/distributedhardwarefwkservice/include", - "${fwk_services_path}/distributedhardwarefwkservice/include/componentmanager", ] deps = @@ -51,6 +42,7 @@ ohos_fuzztest("SinkHandlerRegisterPrivacyResourcesFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "ipc:ipc_core", ] diff --git a/interfaces/inner_kits/native_cpp/test/fuzztest/sinkhandlerresumedistributedhardware_fuzzer/BUILD.gn b/interfaces/inner_kits/native_cpp/test/fuzztest/sinkhandlerresumedistributedhardware_fuzzer/BUILD.gn index 399a6eba58b7ba349fe8efe9d1aea3eef0fbc2ac..c4220b9dabe3fddf96ef92630bcc686b5976df02 100644 --- a/interfaces/inner_kits/native_cpp/test/fuzztest/sinkhandlerresumedistributedhardware_fuzzer/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/fuzztest/sinkhandlerresumedistributedhardware_fuzzer/BUILD.gn @@ -31,13 +31,6 @@ ohos_fuzztest("SinkHandlerResumeDistributedHardwareFuzzTest") { sources = [ "sinkhandlerresumedistributedhardware_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${innerkits_path}/native_cpp/audio_sink/include", @@ -46,7 +39,10 @@ ohos_fuzztest("SinkHandlerResumeDistributedHardwareFuzzTest") { deps = [ "${innerkits_path}/native_cpp/audio_sink:distributed_audio_sink_sdk" ] - external_deps = [ "c_utils:utils" ] + external_deps = [ + "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", + ] defines = [ "HI_LOG_ENABLE", diff --git a/interfaces/inner_kits/native_cpp/test/fuzztest/sinkhandlerstopdistributedhardware_fuzzer/BUILD.gn b/interfaces/inner_kits/native_cpp/test/fuzztest/sinkhandlerstopdistributedhardware_fuzzer/BUILD.gn index 34194f275601fe93f9b56073671bf1388feeb1d1..0d906a935034477dce70959dc0df102b160a8ce6 100644 --- a/interfaces/inner_kits/native_cpp/test/fuzztest/sinkhandlerstopdistributedhardware_fuzzer/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/fuzztest/sinkhandlerstopdistributedhardware_fuzzer/BUILD.gn @@ -31,13 +31,6 @@ ohos_fuzztest("SinkHandlerStopDistributedHardwareFuzzTest") { sources = [ "sinkhandlerstopdistributedhardware_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${innerkits_path}/native_cpp/audio_sink/include", @@ -46,7 +39,10 @@ ohos_fuzztest("SinkHandlerStopDistributedHardwareFuzzTest") { deps = [ "${innerkits_path}/native_cpp/audio_sink:distributed_audio_sink_sdk" ] - external_deps = [ "c_utils:utils" ] + external_deps = [ + "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", + ] defines = [ "HI_LOG_ENABLE", diff --git a/interfaces/inner_kits/native_cpp/test/fuzztest/sinkhandlersubscribelocalhardware_fuzzer/BUILD.gn b/interfaces/inner_kits/native_cpp/test/fuzztest/sinkhandlersubscribelocalhardware_fuzzer/BUILD.gn index 5bfdc9523b4e6048f01413f205586187ef406b69..1c9223cadfc41fe7471c0caf1c9742325ed29e7e 100755 --- a/interfaces/inner_kits/native_cpp/test/fuzztest/sinkhandlersubscribelocalhardware_fuzzer/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/fuzztest/sinkhandlersubscribelocalhardware_fuzzer/BUILD.gn @@ -31,13 +31,6 @@ ohos_fuzztest("SinkHandlerSubscribeLocalHardwareFuzzTest") { sources = [ "sinkhandlersubscribelocalhardware_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${innerkits_path}/native_cpp/audio_sink/include", @@ -48,6 +41,7 @@ ohos_fuzztest("SinkHandlerSubscribeLocalHardwareFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "ipc:ipc_core", ] diff --git a/interfaces/inner_kits/native_cpp/test/fuzztest/sinkhandlerunsubscribelocalhardware_fuzzer/BUILD.gn b/interfaces/inner_kits/native_cpp/test/fuzztest/sinkhandlerunsubscribelocalhardware_fuzzer/BUILD.gn index 30d66e897e48b4f9385ed149f7f12677415981f9..68ea68d76848069010bffae3576424a3658feefe 100755 --- a/interfaces/inner_kits/native_cpp/test/fuzztest/sinkhandlerunsubscribelocalhardware_fuzzer/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/fuzztest/sinkhandlerunsubscribelocalhardware_fuzzer/BUILD.gn @@ -31,13 +31,6 @@ ohos_fuzztest("SinkHandlerUnsubscribeLocalHardwareFuzzTest") { sources = [ "sinkhandlerunsubscribelocalhardware_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${innerkits_path}/native_cpp/audio_sink/include", @@ -48,6 +41,7 @@ ohos_fuzztest("SinkHandlerUnsubscribeLocalHardwareFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "ipc:ipc_core", ] diff --git a/interfaces/inner_kits/native_cpp/test/fuzztest/sinkipccallbackonnotifyresourceinfo_fuzzer/BUILD.gn b/interfaces/inner_kits/native_cpp/test/fuzztest/sinkipccallbackonnotifyresourceinfo_fuzzer/BUILD.gn index 2843357e531c36330baa451d152177d948285c34..a4731dc40e63784f5cc2ac61798c6847fcd09ec3 100644 --- a/interfaces/inner_kits/native_cpp/test/fuzztest/sinkipccallbackonnotifyresourceinfo_fuzzer/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/fuzztest/sinkipccallbackonnotifyresourceinfo_fuzzer/BUILD.gn @@ -31,13 +31,6 @@ ohos_fuzztest("SinkIpcCallbackOnNotifyResourceInfoFuzzTest") { sources = [ "sinkipccallbackonnotifyresourceinfo_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${innerkits_path}/native_cpp/audio_sink/include", @@ -54,6 +47,7 @@ ohos_fuzztest("SinkIpcCallbackOnNotifyResourceInfoFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "ipc:ipc_core", ] } diff --git a/interfaces/inner_kits/native_cpp/test/fuzztest/sinkipccallbackonnotifyresourceinfoinner_fuzzer/BUILD.gn b/interfaces/inner_kits/native_cpp/test/fuzztest/sinkipccallbackonnotifyresourceinfoinner_fuzzer/BUILD.gn index e15a8c1b9cbeab324e2741be5052adb2693a9e6c..0a83b5aa9418802101dbcf16f18842e4de1e5168 100644 --- a/interfaces/inner_kits/native_cpp/test/fuzztest/sinkipccallbackonnotifyresourceinfoinner_fuzzer/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/fuzztest/sinkipccallbackonnotifyresourceinfoinner_fuzzer/BUILD.gn @@ -33,13 +33,6 @@ ohos_fuzztest("SinkIpcCallbackOnNotifyResourceInfoInnerFuzzTest") { sources = [ "sinkipccallbackonnotifyresourceinfoinner_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${innerkits_path}/native_cpp/audio_sink/include", @@ -56,6 +49,7 @@ ohos_fuzztest("SinkIpcCallbackOnNotifyResourceInfoInnerFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "ipc:ipc_core", ] } diff --git a/interfaces/inner_kits/native_cpp/test/fuzztest/sinkipccallbackonremoterequest_fuzzer/BUILD.gn b/interfaces/inner_kits/native_cpp/test/fuzztest/sinkipccallbackonremoterequest_fuzzer/BUILD.gn index 0f07c22805513d3f7c522e234e7d0a45fc2aa4e7..62fda7d7f704ef8baa30a8e97d75e55a27d4c048 100644 --- a/interfaces/inner_kits/native_cpp/test/fuzztest/sinkipccallbackonremoterequest_fuzzer/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/fuzztest/sinkipccallbackonremoterequest_fuzzer/BUILD.gn @@ -33,13 +33,6 @@ ohos_fuzztest("SinkIpcCallbackOnRemoteRequestFuzzTest") { sources = [ "sinkipccallbackonremoterequest_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${innerkits_path}/native_cpp/audio_sink/include", @@ -56,6 +49,7 @@ ohos_fuzztest("SinkIpcCallbackOnRemoteRequestFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "ipc:ipc_core", ] } 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 1ea9b07ac378f0db78a014d0408c33fcdec808ec..bc310fb15ed72ea7042e81794c40257fbe931d5e 100755 --- a/interfaces/inner_kits/native_cpp/test/fuzztest/sinkonloadsystemabilityfail_fuzzer/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/fuzztest/sinkonloadsystemabilityfail_fuzzer/BUILD.gn @@ -30,13 +30,6 @@ ohos_fuzztest("SinkOnLoadSystemAbilityFailFuzzTest") { sources = [ "sinkonloadsystemabilityfail_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${innerkits_path}/native_cpp/audio_sink/include", @@ -53,6 +46,7 @@ ohos_fuzztest("SinkOnLoadSystemAbilityFailFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "ipc:ipc_core", ] } 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 75aa5b1b7e296a2dd5c0ad891aee81f89407cc89..9b1e0b531d002c9e85d2f0ac8756b1ba28462345 100755 --- a/interfaces/inner_kits/native_cpp/test/fuzztest/sinkonloadsystemabilitysuccess_fuzzer/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/fuzztest/sinkonloadsystemabilitysuccess_fuzzer/BUILD.gn @@ -31,13 +31,6 @@ ohos_fuzztest("SinkOnLoadSystemAbilitySuccessFuzzTest") { sources = [ "sinkonloadsystemabilitysuccess_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${innerkits_path}/native_cpp/audio_sink/include", @@ -54,6 +47,7 @@ ohos_fuzztest("SinkOnLoadSystemAbilitySuccessFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "ipc:ipc_core", "samgr:samgr_proxy", ] diff --git a/interfaces/inner_kits/native_cpp/test/fuzztest/sinkproxydaudionotify_fuzzer/BUILD.gn b/interfaces/inner_kits/native_cpp/test/fuzztest/sinkproxydaudionotify_fuzzer/BUILD.gn index 3e143bcc83bb7df69a9edec1974fdb419933328c..63a91e9b537a3551d3119d05cd8a07840c84a7be 100755 --- a/interfaces/inner_kits/native_cpp/test/fuzztest/sinkproxydaudionotify_fuzzer/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/fuzztest/sinkproxydaudionotify_fuzzer/BUILD.gn @@ -31,13 +31,6 @@ ohos_fuzztest("SinkProxyDAudioNotifyFuzzTest") { sources = [ "sinkproxydaudionotify_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${innerkits_path}/native_cpp/audio_sink/include", @@ -54,6 +47,7 @@ ohos_fuzztest("SinkProxyDAudioNotifyFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "ipc:ipc_core", "samgr:samgr_proxy", ] diff --git a/interfaces/inner_kits/native_cpp/test/fuzztest/sinkproxyinitsink_fuzzer/BUILD.gn b/interfaces/inner_kits/native_cpp/test/fuzztest/sinkproxyinitsink_fuzzer/BUILD.gn index d187ea7717673a3d0f82d76237d1a60b363c5bec..705503db0e43a58697924c174458cd3043baf426 100755 --- a/interfaces/inner_kits/native_cpp/test/fuzztest/sinkproxyinitsink_fuzzer/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/fuzztest/sinkproxyinitsink_fuzzer/BUILD.gn @@ -31,13 +31,6 @@ ohos_fuzztest("SinkProxyInitSinkFuzzTest") { sources = [ "sinkproxyinitsink_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${innerkits_path}/native_cpp/audio_sink/include", @@ -54,6 +47,7 @@ ohos_fuzztest("SinkProxyInitSinkFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "ipc:ipc_core", "samgr:samgr_proxy", ] diff --git a/interfaces/inner_kits/native_cpp/test/fuzztest/sinkproxysubscribelocalhardware_fuzzer/BUILD.gn b/interfaces/inner_kits/native_cpp/test/fuzztest/sinkproxysubscribelocalhardware_fuzzer/BUILD.gn index a3ddfb9e188782bb98464943708866562b53e9e6..782b4c1b9571ae2a4ab185ce9718885745bb1c44 100755 --- a/interfaces/inner_kits/native_cpp/test/fuzztest/sinkproxysubscribelocalhardware_fuzzer/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/fuzztest/sinkproxysubscribelocalhardware_fuzzer/BUILD.gn @@ -31,13 +31,6 @@ ohos_fuzztest("SinkProxySubscribeLocalHardwareFuzzTest") { sources = [ "sinkproxysubscribelocalhardware_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${innerkits_path}/native_cpp/audio_sink/include", @@ -54,6 +47,7 @@ ohos_fuzztest("SinkProxySubscribeLocalHardwareFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "ipc:ipc_core", "samgr:samgr_proxy", ] diff --git a/interfaces/inner_kits/native_cpp/test/fuzztest/sinkproxyunsubscribelocalhardware_fuzzer/BUILD.gn b/interfaces/inner_kits/native_cpp/test/fuzztest/sinkproxyunsubscribelocalhardware_fuzzer/BUILD.gn index 8c62abfd25f04ef2b3a8e1d926286acea8750e65..dbf0384ecd74ccdfbe9cad8a6f86b7fbf02a2954 100755 --- a/interfaces/inner_kits/native_cpp/test/fuzztest/sinkproxyunsubscribelocalhardware_fuzzer/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/fuzztest/sinkproxyunsubscribelocalhardware_fuzzer/BUILD.gn @@ -31,13 +31,6 @@ ohos_fuzztest("SinkProxyUnsubscribeLocalHardwareFuzzTest") { sources = [ "sinkproxyunsubscribelocalhardware_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${innerkits_path}/native_cpp/audio_sink/include", @@ -54,6 +47,7 @@ ohos_fuzztest("SinkProxyUnsubscribeLocalHardwareFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "ipc:ipc_core", "samgr:samgr_proxy", ] 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 77ff30fa976ed2f0a44652120f6f3ccedc3fee3c..20bcc0c400179d66e6824ba7b39f0d0d2dcf31b3 100755 --- a/interfaces/inner_kits/native_cpp/test/fuzztest/sourcehandlerconfigdistributedhardware_fuzzer/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/fuzztest/sourcehandlerconfigdistributedhardware_fuzzer/BUILD.gn @@ -31,13 +31,6 @@ ohos_fuzztest("SourceHandlerConfigDistributedHardwareFuzzTest") { sources = [ "sourcehandlerconfigdistributedhardware_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${innerkits_path}/native_cpp/audio_source/include", @@ -49,6 +42,7 @@ ohos_fuzztest("SourceHandlerConfigDistributedHardwareFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "ipc:ipc_core", ] diff --git a/interfaces/inner_kits/native_cpp/test/fuzztest/sourcehandlerfinishstartsa_fuzzer/BUILD.gn b/interfaces/inner_kits/native_cpp/test/fuzztest/sourcehandlerfinishstartsa_fuzzer/BUILD.gn index e9a9e9feefad3e41c75bb0faeeb93f52f7388d4d..fa27f6fa9759502d97f556e0cc244c017879dff2 100755 --- a/interfaces/inner_kits/native_cpp/test/fuzztest/sourcehandlerfinishstartsa_fuzzer/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/fuzztest/sourcehandlerfinishstartsa_fuzzer/BUILD.gn @@ -30,13 +30,6 @@ ohos_fuzztest("SourceHandlerFinishStartSAFuzzTest") { sources = [ "sourcehandlerfinishstartsa_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${innerkits_path}/native_cpp/audio_source/include", @@ -54,6 +47,7 @@ ohos_fuzztest("SourceHandlerFinishStartSAFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "ipc:ipc_core", "samgr:samgr_proxy", ] 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 77c81ad11e75840e8b7ddc2ea57bcedaecafa8e6..5032301d8f86d9d89986de9a4133a904fea888ca 100755 --- a/interfaces/inner_kits/native_cpp/test/fuzztest/sourcehandlerinitsource_fuzzer/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/fuzztest/sourcehandlerinitsource_fuzzer/BUILD.gn @@ -30,13 +30,6 @@ ohos_fuzztest("SourceHandlerInitSourceFuzzTest") { sources = [ "sourcehandlerinitsource_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${innerkits_path}/native_cpp/audio_source/include", @@ -48,6 +41,7 @@ ohos_fuzztest("SourceHandlerInitSourceFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "ipc:ipc_core", ] 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 2b49400e2586138f7b1c09b499fad9ada74dcf3d..046b29c8249907850e8126b9a754a11f96447864 100755 --- a/interfaces/inner_kits/native_cpp/test/fuzztest/sourcehandlerregisterdistributedhardware_fuzzer/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/fuzztest/sourcehandlerregisterdistributedhardware_fuzzer/BUILD.gn @@ -31,19 +31,10 @@ ohos_fuzztest("SourceHandlerRegisterDistributedHardwareFuzzTest") { sources = [ "sourcehandlerregisterdistributedhardware_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${innerkits_path}/native_cpp/audio_source/include", "${innerkits_path}/native_cpp/test/include", - "${fwk_services_path}/distributedhardwarefwkservice/include", - "${fwk_services_path}/distributedhardwarefwkservice/include/componentmanager", ] deps = [ @@ -52,6 +43,7 @@ ohos_fuzztest("SourceHandlerRegisterDistributedHardwareFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "ipc:ipc_core", ] 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 8721723a65c099c57c438101bcfa636fff3025d9..a18a1391962d574ded4d1a602d058a82f1b515d6 100755 --- a/interfaces/inner_kits/native_cpp/test/fuzztest/sourcehandlerunregisterdistributedhardware_fuzzer/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/fuzztest/sourcehandlerunregisterdistributedhardware_fuzzer/BUILD.gn @@ -31,19 +31,10 @@ ohos_fuzztest("SourceHandlerUnregisterDistributedHardwareFuzzTest") { sources = [ "sourcehandlerunregisterdistributedhardware_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${innerkits_path}/native_cpp/audio_source/include", "${innerkits_path}/native_cpp/test/include", - "${fwk_services_path}/distributedhardwarefwkservice/include", - "${fwk_services_path}/distributedhardwarefwkservice/include/componentmanager", ] deps = [ @@ -52,6 +43,7 @@ ohos_fuzztest("SourceHandlerUnregisterDistributedHardwareFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "ipc:ipc_core", ] diff --git a/interfaces/inner_kits/native_cpp/test/fuzztest/sourceipccallbackonnotifyregresult_fuzzer/BUILD.gn b/interfaces/inner_kits/native_cpp/test/fuzztest/sourceipccallbackonnotifyregresult_fuzzer/BUILD.gn index 81b0b92ee08ffc199cb3fc2570db28636d634a2f..cf1e38e37f46c8cc5f44ce52df0e829ebd4b3371 100755 --- a/interfaces/inner_kits/native_cpp/test/fuzztest/sourceipccallbackonnotifyregresult_fuzzer/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/fuzztest/sourceipccallbackonnotifyregresult_fuzzer/BUILD.gn @@ -31,13 +31,6 @@ ohos_fuzztest("SourceIpcCallbackOnNotifyRegResultFuzzTest") { sources = [ "sourceipccallbackonnotifyregresult_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${innerkits_path}/native_cpp/audio_source/include", @@ -55,6 +48,7 @@ ohos_fuzztest("SourceIpcCallbackOnNotifyRegResultFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "ipc:ipc_core", ] } diff --git a/interfaces/inner_kits/native_cpp/test/fuzztest/sourceipccallbackonnotifyunregresult_fuzzer/BUILD.gn b/interfaces/inner_kits/native_cpp/test/fuzztest/sourceipccallbackonnotifyunregresult_fuzzer/BUILD.gn index 8934af8a49fb8dd95db131708c7f848c52d03543..e377161f737f249dfc670a7269b2b01a5bad46f3 100755 --- a/interfaces/inner_kits/native_cpp/test/fuzztest/sourceipccallbackonnotifyunregresult_fuzzer/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/fuzztest/sourceipccallbackonnotifyunregresult_fuzzer/BUILD.gn @@ -31,13 +31,6 @@ ohos_fuzztest("SourceIpcCallbackOnNotifyUnregResultFuzzTest") { sources = [ "sourceipccallbackonnotifyunregresult_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${innerkits_path}/native_cpp/audio_source/include", @@ -55,6 +48,7 @@ ohos_fuzztest("SourceIpcCallbackOnNotifyUnregResultFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "ipc:ipc_core", ] } 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 9778413ddbe8da980856f5e70d6dd3c2641e8b86..948acdc185b3386d899d6414aef5bdf1c8633df9 100755 --- a/interfaces/inner_kits/native_cpp/test/fuzztest/sourceonloadsystemabilityfail_fuzzer/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/fuzztest/sourceonloadsystemabilityfail_fuzzer/BUILD.gn @@ -31,13 +31,6 @@ ohos_fuzztest("SourceOnLoadSystemAbilityFailFuzzTest") { sources = [ "sourceonloadsystemabilityfail_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${innerkits_path}/native_cpp/audio_source/include", @@ -55,6 +48,7 @@ ohos_fuzztest("SourceOnLoadSystemAbilityFailFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "ipc:ipc_core", ] } 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 dcddf784bc2146c2e179c8408f830ad2a1786e70..690c83b61693a0a0b065def57251ee9a240c9cf9 100755 --- a/interfaces/inner_kits/native_cpp/test/fuzztest/sourceonloadsystemabilitysuccess_fuzzer/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/fuzztest/sourceonloadsystemabilitysuccess_fuzzer/BUILD.gn @@ -31,13 +31,6 @@ ohos_fuzztest("SourceOnLoadSystemAbilitySuccessFuzzTest") { sources = [ "sourceonloadsystemabilitysuccess_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${innerkits_path}/native_cpp/audio_source/include", @@ -55,6 +48,7 @@ ohos_fuzztest("SourceOnLoadSystemAbilitySuccessFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "ipc:ipc_core", "samgr:samgr_proxy", ] diff --git a/interfaces/inner_kits/native_cpp/test/fuzztest/sourceproxyconfigdistributedhardware_fuzzer/BUILD.gn b/interfaces/inner_kits/native_cpp/test/fuzztest/sourceproxyconfigdistributedhardware_fuzzer/BUILD.gn index 0436003da33beadd06e1b1bcdef436589787e69e..899798da997263241a0071bf04aaad2426e147d3 100755 --- a/interfaces/inner_kits/native_cpp/test/fuzztest/sourceproxyconfigdistributedhardware_fuzzer/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/fuzztest/sourceproxyconfigdistributedhardware_fuzzer/BUILD.gn @@ -31,13 +31,6 @@ ohos_fuzztest("SourceProxyConfigDistributedHardwareFuzzTest") { sources = [ "sourceproxyconfigdistributedhardware_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${innerkits_path}/native_cpp/audio_source/include", @@ -55,6 +48,7 @@ ohos_fuzztest("SourceProxyConfigDistributedHardwareFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "ipc:ipc_core", "samgr:samgr_proxy", ] diff --git a/interfaces/inner_kits/native_cpp/test/fuzztest/sourceproxydaudionotify_fuzzer/BUILD.gn b/interfaces/inner_kits/native_cpp/test/fuzztest/sourceproxydaudionotify_fuzzer/BUILD.gn index c87d0d1917143268690d26fd0effad257b8469e3..37ecb991d65b0336803160808c3ae721e4f430da 100755 --- a/interfaces/inner_kits/native_cpp/test/fuzztest/sourceproxydaudionotify_fuzzer/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/fuzztest/sourceproxydaudionotify_fuzzer/BUILD.gn @@ -30,13 +30,6 @@ ohos_fuzztest("SourceProxyDAudioNotifyFuzzTest") { sources = [ "sourceproxydaudionotify_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${innerkits_path}/native_cpp/audio_source/include", @@ -54,6 +47,7 @@ ohos_fuzztest("SourceProxyDAudioNotifyFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "ipc:ipc_core", "samgr:samgr_proxy", ] diff --git a/interfaces/inner_kits/native_cpp/test/fuzztest/sourceproxyinitsource_fuzzer/BUILD.gn b/interfaces/inner_kits/native_cpp/test/fuzztest/sourceproxyinitsource_fuzzer/BUILD.gn index 2668c088fcb2b81df1b90d1ad81e1dbd8066b8a1..563b3697046a1613e538d79116bd168559d5cbef 100755 --- a/interfaces/inner_kits/native_cpp/test/fuzztest/sourceproxyinitsource_fuzzer/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/fuzztest/sourceproxyinitsource_fuzzer/BUILD.gn @@ -31,13 +31,6 @@ ohos_fuzztest("SourceProxyInitSourceFuzzTest") { sources = [ "sourceproxyinitsource_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${innerkits_path}/native_cpp/audio_source/include", @@ -55,6 +48,7 @@ ohos_fuzztest("SourceProxyInitSourceFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "ipc:ipc_core", "samgr:samgr_proxy", ] diff --git a/interfaces/inner_kits/native_cpp/test/fuzztest/sourceproxyregisterdistributedhardware_fuzzer/BUILD.gn b/interfaces/inner_kits/native_cpp/test/fuzztest/sourceproxyregisterdistributedhardware_fuzzer/BUILD.gn index b79ae416b7eee5035c6e120f33d575ae943b8af7..ca01fa1b70b625b0c1baee785772df2969bc5d54 100755 --- a/interfaces/inner_kits/native_cpp/test/fuzztest/sourceproxyregisterdistributedhardware_fuzzer/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/fuzztest/sourceproxyregisterdistributedhardware_fuzzer/BUILD.gn @@ -31,13 +31,6 @@ ohos_fuzztest("SourceProxyRegisterDistributedHardwareFuzzTest") { sources = [ "sourceproxyregisterdistributedhardware_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${innerkits_path}/native_cpp/audio_source/include", @@ -55,6 +48,7 @@ ohos_fuzztest("SourceProxyRegisterDistributedHardwareFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "ipc:ipc_core", "samgr:samgr_proxy", ] diff --git a/interfaces/inner_kits/native_cpp/test/fuzztest/sourceproxyunregisterdistributedhardware_fuzzer/BUILD.gn b/interfaces/inner_kits/native_cpp/test/fuzztest/sourceproxyunregisterdistributedhardware_fuzzer/BUILD.gn index 01a80ccfc7bcf60f9ee942588999436acab1bb19..075f93003b95982f5684a0e7cecce907ca855567 100755 --- a/interfaces/inner_kits/native_cpp/test/fuzztest/sourceproxyunregisterdistributedhardware_fuzzer/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/fuzztest/sourceproxyunregisterdistributedhardware_fuzzer/BUILD.gn @@ -31,13 +31,6 @@ ohos_fuzztest("SourceProxyUnregisterDistributedHardwareFuzzTest") { sources = [ "sourceproxyunregisterdistributedhardware_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${innerkits_path}/native_cpp/audio_source/include", @@ -55,6 +48,7 @@ ohos_fuzztest("SourceProxyUnregisterDistributedHardwareFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "ipc:ipc_core", "samgr:samgr_proxy", ] diff --git a/interfaces/inner_kits/native_cpp/test/unittest/audiosinktest/BUILD.gn b/interfaces/inner_kits/native_cpp/test/unittest/audiosinktest/BUILD.gn index 3e4bc07a165de09c1ee4db80dadae902d7ec7d63..ecbd5500712c3bfbca917c3dc97b95f9f19b67a3 100755 --- a/interfaces/inner_kits/native_cpp/test/unittest/audiosinktest/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/unittest/audiosinktest/BUILD.gn @@ -20,11 +20,6 @@ config("module_private_config") { visibility = [ ":*" ] include_dirs = [ - "${fwk_common_path}/utils/include", - "${fwk_utils_path}/include", - ] - - include_dirs += [ "./include", "${common_path}/include", "${interfaces_path}/inner_kits/native_cpp/audio_sink/include", @@ -43,14 +38,12 @@ ohos_unittest("AudioSinkTest") { configs = [ ":module_private_config" ] - deps = [ - "${distributedaudio_path}/interfaces/inner_kits/native_cpp/audio_sink:distributed_audio_sink_sdk", - "//third_party/googletest:gmock", - "//third_party/googletest:gtest_main", - ] + deps = [ "${distributedaudio_path}/interfaces/inner_kits/native_cpp/audio_sink:distributed_audio_sink_sdk" ] external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", + "googletest:gmock", "hilog:libhilog", "ipc:ipc_core", "samgr:samgr_proxy", diff --git a/interfaces/inner_kits/native_cpp/test/unittest/audiosourcetest/BUILD.gn b/interfaces/inner_kits/native_cpp/test/unittest/audiosourcetest/BUILD.gn index 0c1d9cd76e68e89c097dfa3451ccb34f93c0ea44..c9eae86fcef546eee520e9cfbe6b59fa567ae6eb 100755 --- a/interfaces/inner_kits/native_cpp/test/unittest/audiosourcetest/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/test/unittest/audiosourcetest/BUILD.gn @@ -20,13 +20,6 @@ config("module_private_config") { visibility = [ ":*" ] include_dirs = [ - "${fwk_common_path}/utils/include", - "${fwk_utils_path}/include", - "${fwk_utils_path}/include/log", - "${fwk_common_path}/log/include", - ] - - include_dirs += [ "./include", "${common_path}/include", "${interfaces_path}/inner_kits/native_cpp/audio_source/include", @@ -49,14 +42,12 @@ ohos_unittest("AudioSourceTest") { configs = [ ":module_private_config" ] - deps = [ - "${interfaces_path}/inner_kits/native_cpp/audio_source:distributed_audio_source_sdk", - "//third_party/googletest:gmock", - "//third_party/googletest:gtest_main", - ] + deps = [ "${interfaces_path}/inner_kits/native_cpp/audio_source:distributed_audio_source_sdk" ] external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", + "googletest:gmock", "ipc:ipc_core", "samgr:samgr_proxy", ] diff --git a/services/audioclient/test/unittest/micclient/BUILD.gn b/services/audioclient/test/unittest/micclient/BUILD.gn index 3c488189672dc47501b11f6b3e862f181f2313e9..eefb95b0fad74f10e7bbf7ec6cb50e19ed91cd31 100644 --- a/services/audioclient/test/unittest/micclient/BUILD.gn +++ b/services/audioclient/test/unittest/micclient/BUILD.gn @@ -21,9 +21,7 @@ module_out_path = "distributed_audio/services/audioclient/mic_client_test" config("module_private_config") { visibility = [ ":*" ] - include_dirs = [ "${mediastandardfwk_path}/audiocommon/include" ] - - include_dirs += [ + include_dirs = [ "${audio_client_path}/interface", "${audio_client_path}/micclient/include", "${audio_client_path}/test/unittest/micclient/include", @@ -33,7 +31,6 @@ config("module_private_config") { "${audio_transport_path}/receiverengine/include", "${audio_transport_path}/senderengine/include", "${common_path}/include", - "${fwk_common_path}/utils/include", "${services_path}/common/audioeventcallback", "${services_path}/common/audiodata/include", "${services_path}/common/audioparam", @@ -50,17 +47,17 @@ ohos_unittest("MicClientTest") { configs = [ ":module_private_config" ] - deps = [ - "${services_path}/audiomanager/servicesink:distributed_audio_sink", - "//third_party/googletest:gmock", - "//third_party/googletest:gtest_main", - ] + deps = [ "${services_path}/audiomanager/servicesink:distributed_audio_sink" ] external_deps = [ "audio_framework:audio_capturer", + "audio_framework:audio_client", + "audio_framework:audio_renderer", "cJSON:cjson", "distributed_hardware_fwk:distributed_av_receiver", "distributed_hardware_fwk:distributed_av_sender", + "distributed_hardware_fwk:distributedhardwareutils", + "googletest:gmock", ] } diff --git a/services/audioclient/test/unittest/spkclient/BUILD.gn b/services/audioclient/test/unittest/spkclient/BUILD.gn index a5d99386f2e5e9dfbd5b50f02c7b401f6b27f32f..8c506328d463c66d77d557e72d06d492b4728ee2 100644 --- a/services/audioclient/test/unittest/spkclient/BUILD.gn +++ b/services/audioclient/test/unittest/spkclient/BUILD.gn @@ -22,12 +22,6 @@ config("module_private_config") { visibility = [ ":*" ] include_dirs = [ - "${mediastandardfwk_path}/audiocommon/include", - "${mediastandardfwk_path}/audiomanager/include", - "${mediastandardfwk_path}/audiorenderer/include", - ] - - include_dirs += [ "${audio_client_path}/interface", "${audio_client_path}/spkclient/include", "${audio_client_path}/test/unittest/spkclient/include", @@ -37,7 +31,6 @@ config("module_private_config") { "${audio_transport_path}/receiverengine/include", "${audio_transport_path}/senderengine/include", "${common_path}/include", - "${fwk_common_path}/utils/include", "${services_path}/common/audioeventcallback", "${services_path}/common/audiodata/include", "${services_path}/common/audioparam", @@ -57,15 +50,17 @@ ohos_unittest("SpeakerClientTest") { deps = [ "${services_path}/audiomanager/servicesink:distributed_audio_sink", "${services_path}/common:distributed_audio_utils", - "//third_party/googletest:gmock", - "//third_party/googletest:gtest_main", ] external_deps = [ + "audio_framework:audio_capturer", "audio_framework:audio_client", + "audio_framework:audio_renderer", "cJSON:cjson", "distributed_hardware_fwk:distributed_av_receiver", "distributed_hardware_fwk:distributed_av_sender", + "distributed_hardware_fwk:distributedhardwareutils", + "googletest:gmock", ] } diff --git a/services/audiocontrol/test/unittest/controlsink/BUILD.gn b/services/audiocontrol/test/unittest/controlsink/BUILD.gn index d8f272d1e885b4317171434c55a41496966cd6f3..76fba4a48847c4559309d3a23fcc0a553b83fe87 100644 --- a/services/audiocontrol/test/unittest/controlsink/BUILD.gn +++ b/services/audiocontrol/test/unittest/controlsink/BUILD.gn @@ -19,9 +19,7 @@ module_out_path = "distributed_audio/services/audiocontrol/control_sink_test" config("module_private_config") { visibility = [ ":*" ] - include_dirs = [ "${fwk_common_path}/utils/include" ] - - include_dirs += [ + include_dirs = [ "include", "${common_path}/include", "${services_path}/common/audiodata/include", @@ -43,13 +41,13 @@ ohos_unittest("ControlSinkTest") { configs = [ ":module_private_config" ] - deps = [ - "${services_path}/audiomanager/servicesink:distributed_audio_sink", - "//third_party/googletest:gmock", - "//third_party/googletest:gtest_main", - ] + deps = [ "${services_path}/audiomanager/servicesink:distributed_audio_sink" ] - external_deps = [ "c_utils:utils" ] + external_deps = [ + "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", + "googletest:gmock", + ] } group("control_sink_test") { diff --git a/services/audiocontrol/test/unittest/controlsource/BUILD.gn b/services/audiocontrol/test/unittest/controlsource/BUILD.gn index 4bdab18487ff47c93e73d28134d845df8abcaf7f..ad6bb9647a37eae0c465ccc6e6a2bf1dbf95966d 100644 --- a/services/audiocontrol/test/unittest/controlsource/BUILD.gn +++ b/services/audiocontrol/test/unittest/controlsource/BUILD.gn @@ -19,9 +19,7 @@ module_out_path = "distributed_audio/services/audiocontrol/control_source_test" config("module_private_config") { visibility = [ ":*" ] - include_dirs = [ "${fwk_common_path}/utils/include" ] - - include_dirs += [ + include_dirs = [ "include", "${common_path}/include", "${services_path}/common/audioparam", @@ -41,17 +39,16 @@ ohos_unittest("ControlSourceTest") { configs = [ ":module_private_config" ] - deps = [ - "${services_path}/audiomanager/servicesource:distributed_audio_source", - "//third_party/googletest:gmock", - "//third_party/googletest:gtest_main", - ] + deps = + [ "${services_path}/audiomanager/servicesource:distributed_audio_source" ] external_deps = [ "access_token:libaccesstoken_sdk", "access_token:libnativetoken_shared", "access_token:libtokensetproc_shared", "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", + "googletest:gmock", ] } diff --git a/services/audiohdiproxy/test/unittest/daudio_hdi_handler/BUILD.gn b/services/audiohdiproxy/test/unittest/daudio_hdi_handler/BUILD.gn index 435689f48c44abeef413776754fd814bdf6be244..c04d0cdbfc6a9230887ef4d217ef9232e6582806 100644 --- a/services/audiohdiproxy/test/unittest/daudio_hdi_handler/BUILD.gn +++ b/services/audiohdiproxy/test/unittest/daudio_hdi_handler/BUILD.gn @@ -21,9 +21,7 @@ module_out_path = "distributed_audio/services/audiohdiproxy/daudio_hdi_handler" config("module_private_config") { visibility = [ ":*" ] - include_dirs = [ "${fwk_common_path}/utils/include" ] - - include_dirs += [ + include_dirs = [ "include", "${common_path}/include", "${services_path}/common/audiodata/include", @@ -41,15 +39,14 @@ ohos_unittest("DAudioHdiHandlerTest") { configs = [ ":module_private_config" ] - deps = [ - "${services_path}/audiomanager/servicesource:distributed_audio_source", - "//third_party/googletest:gmock", - "//third_party/googletest:gtest_main", - ] + deps = + [ "${services_path}/audiomanager/servicesource:distributed_audio_source" ] external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "drivers_interface_distributed_audio:libdaudioext_proxy_2.0", + "googletest:gmock", "ipc:ipc_core", ] } diff --git a/services/audiohdiproxy/test/unittest/daudio_manager_callback/BUILD.gn b/services/audiohdiproxy/test/unittest/daudio_manager_callback/BUILD.gn index 8ab6898a3c9b232fccd9453ee30f6c627aea9bdd..c29d047acb35e8c19654ce6083f4fac546cc67a0 100644 --- a/services/audiohdiproxy/test/unittest/daudio_manager_callback/BUILD.gn +++ b/services/audiohdiproxy/test/unittest/daudio_manager_callback/BUILD.gn @@ -22,9 +22,7 @@ module_out_path = config("module_private_config") { visibility = [ ":*" ] - include_dirs = [ "${fwk_common_path}/utils/include" ] - - include_dirs += [ + include_dirs = [ "include", "${common_path}/include", "${audio_hdi_proxy_path}/include", @@ -45,13 +43,13 @@ ohos_unittest("DAudioManagerCallbackTest") { deps = [ "${services_path}/audiomanager/servicesource:distributed_audio_source", "${services_path}/common:distributed_audio_utils", - "//third_party/googletest:gmock", - "//third_party/googletest:gtest_main", ] external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "drivers_interface_distributed_audio:libdaudioext_proxy_2.0", + "googletest:gmock", "ipc:ipc_core", ] } diff --git a/services/audiomanager/managersink/src/daudio_sink_dev.cpp b/services/audiomanager/managersink/src/daudio_sink_dev.cpp index 1ce46fd91368a37a737b5972fac0cfd55dd6e193..b87c8e44ccd16f1db136f2e1a356039b02da1913 100644 --- a/services/audiomanager/managersink/src/daudio_sink_dev.cpp +++ b/services/audiomanager/managersink/src/daudio_sink_dev.cpp @@ -472,7 +472,7 @@ int32_t DAudioSinkDev::ConvertString2Int(std::string val) DHLOGE("String is not number. str:%{public}s.", val.c_str()); return -1; } - return std::stoi(val); + return std::atoi(val.c_str()); } void DAudioSinkDev::PullUpPage() diff --git a/services/audiomanager/managersink/src/daudio_sink_manager.cpp b/services/audiomanager/managersink/src/daudio_sink_manager.cpp index 497467aa99dfa9c97303644fea6d6aedb1966cf0..aef501e8fca4aca596ae05306651856a3ad75ff9 100644 --- a/services/audiomanager/managersink/src/daudio_sink_manager.cpp +++ b/services/audiomanager/managersink/src/daudio_sink_manager.cpp @@ -42,11 +42,6 @@ const std::string SENDER_SO_NAME = "libdistributed_av_sender.z.so"; const std::string GET_SENDER_PROVIDER_FUNC = "GetAVSenderEngineProvider"; const std::string RECEIVER_SO_NAME = "libdistributed_av_receiver.z.so"; const std::string GET_RECEIVER_PROVIDER_FUNC = "GetAVReceiverEngineProvider"; -#ifdef __LP64__ -const std::string LIB_LOAD_PATH = "/system/lib64/"; -#else -const std::string LIB_LOAD_PATH = "/system/lib/"; -#endif DAudioSinkManager::DAudioSinkManager() { DHLOGD("Distributed audio sink manager constructed."); @@ -304,13 +299,11 @@ void DAudioSinkManager::ClearAudioDev(const std::string &devId) int32_t DAudioSinkManager::LoadAVReceiverEngineProvider() { DHLOGI("LoadAVReceiverEngineProvider enter"); - char path[PATH_MAX + 1] = {0x00}; - if ((LIB_LOAD_PATH.length() + RECEIVER_SO_NAME.length()) > PATH_MAX || - realpath((LIB_LOAD_PATH + RECEIVER_SO_NAME).c_str(), path) == nullptr) { + if (RECEIVER_SO_NAME.length() > PATH_MAX) { DHLOGE("File open failed"); return ERR_DH_AUDIO_NULLPTR; } - pRHandler_ = dlopen(path, RTLD_LAZY | RTLD_NODELETE); + pRHandler_ = dlopen(RECEIVER_SO_NAME.c_str(), RTLD_LAZY | RTLD_NODELETE); CHECK_NULL_RETURN(pRHandler_, ERR_DH_AUDIO_NULLPTR); AVTransProviderClass getEngineFactoryFunc = (AVTransProviderClass)dlsym(pRHandler_, @@ -339,13 +332,11 @@ int32_t DAudioSinkManager::UnloadAVReceiverEngineProvider() int32_t DAudioSinkManager::LoadAVSenderEngineProvider() { DHLOGI("LoadAVSenderEngineProvider enter"); - char path[PATH_MAX + 1] = {0x00}; - if ((LIB_LOAD_PATH.length() + SENDER_SO_NAME.length()) > PATH_MAX || - realpath((LIB_LOAD_PATH + SENDER_SO_NAME).c_str(), path) == nullptr) { + if (SENDER_SO_NAME.length() > PATH_MAX) { DHLOGE("File open failed"); return ERR_DH_AUDIO_NULLPTR; } - pSHandler_ = dlopen(path, RTLD_LAZY | RTLD_NODELETE); + pSHandler_ = dlopen(SENDER_SO_NAME.c_str(), RTLD_LAZY | RTLD_NODELETE); CHECK_NULL_RETURN(pSHandler_, ERR_DH_AUDIO_NULLPTR); AVTransProviderClass getEngineFactoryFunc = (AVTransProviderClass)dlsym(pSHandler_, diff --git a/services/audiomanager/managersource/include/dmic_dev.h b/services/audiomanager/managersource/include/dmic_dev.h index 17b6ca9086a06b9e19554077d46b81f0578fcc09..0bfd1a84d19f94e9618cfef69e92197d0aac9cb9 100644 --- a/services/audiomanager/managersource/include/dmic_dev.h +++ b/services/audiomanager/managersource/include/dmic_dev.h @@ -101,8 +101,6 @@ private: const std::string DUMP_DAUDIO_MIC_READ_FROM_BUF_NAME = "dump_source_mic_read_from_trans.pcm"; const std::string DUMP_DAUDIO_LOWLATENCY_MIC_FROM_BUF_NAME = "dump_source_mic_write_to_ashmem.pcm"; const int32_t ASHMEM_MAX_LEN = 2 * 4096; - static constexpr size_t NOTIFY_WAIT_FRAMES = 5; - static constexpr uint32_t NOTIFY_WAIT_TIME_US = 20000; std::weak_ptr audioEventCallback_; std::mutex dataQueueMtx_; diff --git a/services/audiomanager/managersource/src/daudio_echo_cannel_manager.cpp b/services/audiomanager/managersource/src/daudio_echo_cannel_manager.cpp index 38943b19ad08c7681ee00395db0020afb48d815f..51c3e2fdfc97fb53dc9e184f16d1a614281f46b6 100644 --- a/services/audiomanager/managersource/src/daudio_echo_cannel_manager.cpp +++ b/services/audiomanager/managersource/src/daudio_echo_cannel_manager.cpp @@ -35,11 +35,6 @@ using AecEffectProcessorProvider = AecEffector *(*)(); const std::string ECHOCANNEL_SO_NAME = "libdaudio_aec_effect_processor.z.so"; const std::string GET_AEC_EFFECT_PROCESSOR_FUNC = "GetAecEffector"; const int32_t FRAME_SIZE_NORMAL = 3840; -#ifdef __LP64__ -const std::string LIB_LOAD_PATH = "/system/lib64/"; -#else -const std::string LIB_LOAD_PATH = "/system/lib/"; -#endif DAudioEchoCannelManager::DAudioEchoCannelManager() { @@ -328,13 +323,11 @@ int32_t DAudioEchoCannelManager::AudioCaptureRelease() int32_t DAudioEchoCannelManager::LoadAecProcessor() { DHLOGI("LoadAecEffectProcessor enter"); - char path[PATH_MAX + 1] = {0x00}; - if ((LIB_LOAD_PATH.length() + ECHOCANNEL_SO_NAME.length()) > PATH_MAX || - realpath((LIB_LOAD_PATH+ ECHOCANNEL_SO_NAME).c_str(), path) == nullptr) { + if (ECHOCANNEL_SO_NAME.length() > PATH_MAX) { DHLOGE("File open failed"); return ERR_DH_AUDIO_NULLPTR; } - aecHandler_ = dlopen(path, RTLD_LAZY | RTLD_NODELETE); + aecHandler_ = dlopen(ECHOCANNEL_SO_NAME.c_str(), RTLD_LAZY | RTLD_NODELETE); CHECK_AND_RETURN_RET_LOG(aecHandler_ == nullptr, ERR_DH_AUDIO_NULLPTR, "dlOpen error."); AecEffectProcessorProvider getAecEffectProcessorFunc = (AecEffectProcessorProvider)dlsym(aecHandler_, GET_AEC_EFFECT_PROCESSOR_FUNC.c_str()); diff --git a/services/audiomanager/managersource/src/daudio_source_dev.cpp b/services/audiomanager/managersource/src/daudio_source_dev.cpp index dff98d344bb4e3883472f7dbfb2ee87a4c76a974..c906571acb800354021834af6fc04069d014ad70 100644 --- a/services/audiomanager/managersource/src/daudio_source_dev.cpp +++ b/services/audiomanager/managersource/src/daudio_source_dev.cpp @@ -904,7 +904,7 @@ int32_t DAudioSourceDev::ConvertString2Int(std::string val) DHLOGE("String is not number. str:%{public}s.", val.c_str()); return ERR_DH_AUDIO_FAILED; } - return std::stoi(val); + return std::atoi(val.c_str()); } int32_t DAudioSourceDev::OpenDSpeakerInner(std::shared_ptr &speaker, const int32_t dhId) diff --git a/services/audiomanager/managersource/src/daudio_source_manager.cpp b/services/audiomanager/managersource/src/daudio_source_manager.cpp index 9dcb012c716d62a880210dfd1ec6a5b4f9d68e99..f84878aced3918ff96091cb07eef5141b006f764 100644 --- a/services/audiomanager/managersource/src/daudio_source_manager.cpp +++ b/services/audiomanager/managersource/src/daudio_source_manager.cpp @@ -43,11 +43,6 @@ const std::string SENDER_SO_NAME = "libdistributed_av_sender.z.so"; const std::string GET_SENDER_PROVIDER_FUNC = "GetAVSenderEngineProvider"; const std::string RECEIVER_SO_NAME = "libdistributed_av_receiver.z.so"; const std::string GET_RECEIVER_PROVIDER_FUNC = "GetAVReceiverEngineProvider"; -#ifdef __LP64__ -const std::string LIB_LOAD_PATH = "/system/lib64/"; -#else -const std::string LIB_LOAD_PATH = "/system/lib/"; -#endif DAudioSourceManager::DAudioSourceManager() { @@ -134,6 +129,12 @@ int32_t DAudioSourceManager::UnInit() listenThread_.join(); } + if (handler_ != nullptr) { + while (!handler_->IsIdle()) { + DHLOGD("manager handler is running, wait for idle."); + usleep(WAIT_HANDLER_IDLE_TIME_US); + } + } ipcCallback_ = nullptr; daudioMgrCallback_ = nullptr; if (DAudioHdiHandler::GetInstance().UninitHdiHandler() != DH_SUCCESS) { @@ -141,11 +142,6 @@ int32_t DAudioSourceManager::UnInit() return ERR_DH_AUDIO_FAILED; } - CHECK_NULL_RETURN(handler_, DH_SUCCESS); - while (!handler_->IsIdle()) { - DHLOGD("manager handler is running, wait for idle."); - usleep(WAIT_HANDLER_IDLE_TIME_US); - } DHLOGD("Uninit audio source manager exit."); return DH_SUCCESS; } @@ -503,13 +499,11 @@ void DAudioSourceManager::ListenAudioDev() int32_t DAudioSourceManager::LoadAVSenderEngineProvider() { DHLOGI("LoadAVSenderEngineProvider enter"); - char path[PATH_MAX + 1] = {0x00}; - if ((LIB_LOAD_PATH.length() + SENDER_SO_NAME.length()) > PATH_MAX || - realpath((LIB_LOAD_PATH + SENDER_SO_NAME).c_str(), path) == nullptr) { + if (SENDER_SO_NAME.length() > PATH_MAX) { DHLOGE("File open failed"); return ERR_DH_AUDIO_NULLPTR; } - pSHandler_ = dlopen(path, RTLD_LAZY | RTLD_NODELETE); + pSHandler_ = dlopen(SENDER_SO_NAME.c_str(), RTLD_LAZY | RTLD_NODELETE); CHECK_NULL_RETURN(pSHandler_, ERR_DH_AUDIO_NULLPTR); AVTransProviderClass getEngineFactoryFunc = (AVTransProviderClass)dlsym(pSHandler_, GET_SENDER_PROVIDER_FUNC.c_str()); @@ -538,13 +532,11 @@ int32_t DAudioSourceManager::UnloadAVSenderEngineProvider() int32_t DAudioSourceManager::LoadAVReceiverEngineProvider() { DHLOGI("LoadAVReceiverEngineProvider enter"); - char path[PATH_MAX + 1] = {0x00}; - if ((LIB_LOAD_PATH.length() + RECEIVER_SO_NAME.length()) > PATH_MAX || - realpath((LIB_LOAD_PATH + RECEIVER_SO_NAME).c_str(), path) == nullptr) { + if (RECEIVER_SO_NAME.length() > PATH_MAX) { DHLOGE("File canonicalization failed"); return ERR_DH_AUDIO_NULLPTR; } - pRHandler_ = dlopen(path, RTLD_LAZY | RTLD_NODELETE); + pRHandler_ = dlopen(RECEIVER_SO_NAME.c_str(), RTLD_LAZY | RTLD_NODELETE); CHECK_NULL_RETURN(pRHandler_, ERR_DH_AUDIO_NULLPTR); AVTransProviderClass getEngineFactoryFunc = (AVTransProviderClass)dlsym(pRHandler_, GET_RECEIVER_PROVIDER_FUNC.c_str()); diff --git a/services/audiomanager/managersource/src/dmic_dev.cpp b/services/audiomanager/managersource/src/dmic_dev.cpp index fb4889b0a1713a7c7984ffca099f5874e2b55e9a..1dd07fd93c4bafbdc4b124fb762c7115f11afd72 100644 --- a/services/audiomanager/managersource/src/dmic_dev.cpp +++ b/services/audiomanager/managersource/src/dmic_dev.cpp @@ -212,13 +212,6 @@ int32_t DMicDev::NotifyEvent(const int32_t streamId, const AudioEvent &event) switch (event.type) { case AudioEventType::AUDIO_START: curStatus_ = AudioStatus::STATUS_START; - while (isTransReady_.load()) { - std::lock_guard lock(dataQueueMtx_); - if (dataQueue_.size() >= NOTIFY_WAIT_FRAMES) { - break; - } - usleep(NOTIFY_WAIT_TIME_US); - } isExistedEmpty_.store(false); break; case AudioEventType::AUDIO_STOP: diff --git a/services/audiomanager/servicesink/include/daudio_sink_stub.h b/services/audiomanager/servicesink/include/daudio_sink_stub.h index 723811e6a7e200f582c886fd49e3d9209c11deeb..d9882b4f06050a2f8093a7ddc712476c3f597789 100644 --- a/services/audiomanager/servicesink/include/daudio_sink_stub.h +++ b/services/audiomanager/servicesink/include/daudio_sink_stub.h @@ -40,7 +40,6 @@ private: int32_t PauseDistributedHardwareInner(MessageParcel &data, MessageParcel &reply, MessageOption &option); int32_t ResumeDistributedHardwareInner(MessageParcel &data, MessageParcel &reply, MessageOption &option); int32_t StopDistributedHardwareInner(MessageParcel &data, MessageParcel &reply, MessageOption &option); - bool HasAccessDHPermission(); using DAudioSinkServiceFunc = int32_t (DAudioSinkStub::*)(MessageParcel &data, MessageParcel &reply, MessageOption &option); diff --git a/services/audiomanager/servicesink/src/daudio_sink_stub.cpp b/services/audiomanager/servicesink/src/daudio_sink_stub.cpp index 5c2695803becb3e3520d08a257f34d3a32a6b4b3..7a47305e8de3551c975875c1c6041ce37e7c858f 100644 --- a/services/audiomanager/servicesink/src/daudio_sink_stub.cpp +++ b/services/audiomanager/servicesink/src/daudio_sink_stub.cpp @@ -128,6 +128,10 @@ int32_t DAudioSinkStub::ReleaseSinkInner(MessageParcel &data, MessageParcel &rep int32_t DAudioSinkStub::SubscribeLocalHardwareInner(MessageParcel &data, MessageParcel &reply, MessageOption &option) { + if (!VerifyPermission()) { + DHLOGE("Permission verification fail."); + return ERR_DH_AUDIO_SA_PERMISSION_FAIED; + } std::string dhId = data.ReadString(); std::string param = data.ReadString(); int32_t ret = SubscribeLocalHardware(dhId, param); @@ -137,6 +141,10 @@ int32_t DAudioSinkStub::SubscribeLocalHardwareInner(MessageParcel &data, Message int32_t DAudioSinkStub::UnsubscribeLocalHardwareInner(MessageParcel &data, MessageParcel &reply, MessageOption &option) { + if (!VerifyPermission()) { + DHLOGE("Permission verification fail."); + return ERR_DH_AUDIO_SA_PERMISSION_FAIED; + } std::string dhId = data.ReadString(); int32_t ret = UnsubscribeLocalHardware(dhId); reply.WriteInt32(ret); @@ -156,9 +164,9 @@ int32_t DAudioSinkStub::DAudioNotifyInner(MessageParcel &data, MessageParcel &re int32_t DAudioSinkStub::PauseDistributedHardwareInner(MessageParcel &data, MessageParcel &reply, MessageOption &option) { - if (!HasAccessDHPermission()) { - DHLOGE("The caller has no ACCESS_DISTRIBUTED_HARDWARE permission."); - return ERR_DH_AUDIO_ACCESS_PERMISSION_CHECK_FAIL; + if (!VerifyPermission()) { + DHLOGE("Permission verification fail."); + return ERR_DH_AUDIO_SA_PERMISSION_FAIED; } std::string networkId = data.ReadString(); int32_t ret = PauseDistributedHardware(networkId); @@ -168,9 +176,9 @@ int32_t DAudioSinkStub::PauseDistributedHardwareInner(MessageParcel &data, Messa int32_t DAudioSinkStub::ResumeDistributedHardwareInner(MessageParcel &data, MessageParcel &reply, MessageOption &option) { - if (!HasAccessDHPermission()) { - DHLOGE("The caller has no ACCESS_DISTRIBUTED_HARDWARE permission."); - return ERR_DH_AUDIO_ACCESS_PERMISSION_CHECK_FAIL; + if (!VerifyPermission()) { + DHLOGE("Permission verification fail."); + return ERR_DH_AUDIO_SA_PERMISSION_FAIED; } std::string networkId = data.ReadString(); int32_t ret = ResumeDistributedHardware(networkId); @@ -180,22 +188,14 @@ int32_t DAudioSinkStub::ResumeDistributedHardwareInner(MessageParcel &data, Mess int32_t DAudioSinkStub::StopDistributedHardwareInner(MessageParcel &data, MessageParcel &reply, MessageOption &option) { - if (!HasAccessDHPermission()) { - DHLOGE("The caller has no ACCESS_DISTRIBUTED_HARDWARE permission."); - return ERR_DH_AUDIO_ACCESS_PERMISSION_CHECK_FAIL; + if (!VerifyPermission()) { + DHLOGE("Permission verification fail."); + return ERR_DH_AUDIO_SA_PERMISSION_FAIED; } std::string networkId = data.ReadString(); int32_t ret = StopDistributedHardware(networkId); reply.WriteInt32(ret); return DH_SUCCESS; } - -bool DAudioSinkStub::HasAccessDHPermission() -{ - Security::AccessToken::AccessTokenID callerToken = IPCSkeleton::GetCallingTokenID(); - const std::string permissionName = "ohos.permission.ACCESS_DISTRIBUTED_HARDWARE"; - int32_t result = Security::AccessToken::AccessTokenKit::VerifyAccessToken(callerToken, permissionName); - return (result == Security::AccessToken::PERMISSION_GRANTED); -} } // namespace DistributedHardware } // namespace OHOS \ No newline at end of file diff --git a/services/audiomanager/servicesource/src/daudio_source_stub.cpp b/services/audiomanager/servicesource/src/daudio_source_stub.cpp index a44a5dd48aa29cc21b9c9e1e4557908ab7561e91..93491e4d1f8deaf2267684e520128d6413950fdc 100644 --- a/services/audiomanager/servicesource/src/daudio_source_stub.cpp +++ b/services/audiomanager/servicesource/src/daudio_source_stub.cpp @@ -153,6 +153,10 @@ int32_t DAudioSourceStub::UnregisterDistributedHardwareInner(MessageParcel &data int32_t DAudioSourceStub::ConfigDistributedHardwareInner(MessageParcel &data, MessageParcel &reply, MessageOption &option) { + if (!VerifyPermission()) { + DHLOGE("Permission verification fail."); + return ERR_DH_AUDIO_SA_PERMISSION_FAIED; + } std::string networkId = data.ReadString(); std::string dhId = data.ReadString(); std::string key = data.ReadString(); diff --git a/services/audiomanager/test/fuzztest/sinkservicedaudionotify_fuzzer/BUILD.gn b/services/audiomanager/test/fuzztest/sinkservicedaudionotify_fuzzer/BUILD.gn index afbe42c88dec4f528cfc5d87322f0d8db4195183..4f0d2e21537d4c8b78feb5aa9adb754a127d4371 100644 --- a/services/audiomanager/test/fuzztest/sinkservicedaudionotify_fuzzer/BUILD.gn +++ b/services/audiomanager/test/fuzztest/sinkservicedaudionotify_fuzzer/BUILD.gn @@ -31,13 +31,6 @@ ohos_fuzztest("SinkServiceDAudioNotifyFuzzTest") { sources = [ "sinkservicedaudionotify_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${innerkits_path}/native_cpp/audio_sink/include", @@ -54,6 +47,7 @@ ohos_fuzztest("SinkServiceDAudioNotifyFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "ipc:ipc_core", "samgr:samgr_proxy", ] diff --git a/services/audiomanager/test/fuzztest/sinkserviceinitsink_fuzzer/BUILD.gn b/services/audiomanager/test/fuzztest/sinkserviceinitsink_fuzzer/BUILD.gn index deabbf84d1a8a24fad0222a8b704646990b100fd..5d15d5f91e9132c917deed7033141a11b3dcc507 100644 --- a/services/audiomanager/test/fuzztest/sinkserviceinitsink_fuzzer/BUILD.gn +++ b/services/audiomanager/test/fuzztest/sinkserviceinitsink_fuzzer/BUILD.gn @@ -31,13 +31,6 @@ ohos_fuzztest("SinkServiceInitSinkFuzzTest") { sources = [ "sinkserviceinitsink_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${innerkits_path}/native_cpp/audio_sink/include", @@ -57,6 +50,7 @@ ohos_fuzztest("SinkServiceInitSinkFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "ipc:ipc_core", "samgr:samgr_proxy", ] diff --git a/services/audiomanager/test/fuzztest/sinkservicepausedistributedhardware_fuzzer/BUILD.gn b/services/audiomanager/test/fuzztest/sinkservicepausedistributedhardware_fuzzer/BUILD.gn index fc5c105d7299cd40f458b5bd8b3c87abf96fc6fa..872458c61252f12a5c6b51839e5373781ed389ba 100644 --- a/services/audiomanager/test/fuzztest/sinkservicepausedistributedhardware_fuzzer/BUILD.gn +++ b/services/audiomanager/test/fuzztest/sinkservicepausedistributedhardware_fuzzer/BUILD.gn @@ -31,13 +31,6 @@ ohos_fuzztest("SinkServicePauseDistributedHardwareFuzzTest") { sources = [ "sinkservicepausedistributedhardware_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${innerkits_path}/native_cpp/audio_sink/include", @@ -54,6 +47,7 @@ ohos_fuzztest("SinkServicePauseDistributedHardwareFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "ipc:ipc_core", "samgr:samgr_proxy", ] diff --git a/services/audiomanager/test/fuzztest/sinkservicereleasesink_fuzzer/BUILD.gn b/services/audiomanager/test/fuzztest/sinkservicereleasesink_fuzzer/BUILD.gn index 15f0f52575727f73fca8f49b045f34160760b0e4..683f3806dcde42cef56e0e1e9a378faf39db0dd7 100644 --- a/services/audiomanager/test/fuzztest/sinkservicereleasesink_fuzzer/BUILD.gn +++ b/services/audiomanager/test/fuzztest/sinkservicereleasesink_fuzzer/BUILD.gn @@ -31,13 +31,6 @@ ohos_fuzztest("SinkServiceReleaseSinkFuzzTest") { sources = [ "sinkservicereleasesink_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${innerkits_path}/native_cpp/audio_sink/include", @@ -54,6 +47,7 @@ ohos_fuzztest("SinkServiceReleaseSinkFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "ipc:ipc_core", "samgr:samgr_proxy", ] diff --git a/services/audiomanager/test/fuzztest/sinkserviceresumedistributedhardware_fuzzer/BUILD.gn b/services/audiomanager/test/fuzztest/sinkserviceresumedistributedhardware_fuzzer/BUILD.gn index 9f52119de2d7d7551ea2e4b4b0dd5ae6abc458c2..7ec7bf5d6a04c2fbe1fb983398f8a43fbb09f863 100644 --- a/services/audiomanager/test/fuzztest/sinkserviceresumedistributedhardware_fuzzer/BUILD.gn +++ b/services/audiomanager/test/fuzztest/sinkserviceresumedistributedhardware_fuzzer/BUILD.gn @@ -30,13 +30,6 @@ ohos_fuzztest("SinkServiceResumeDistributedHardwareFuzzTest") { sources = [ "sinkserviceresumedistributedhardware_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${innerkits_path}/native_cpp/audio_sink/include", @@ -53,6 +46,7 @@ ohos_fuzztest("SinkServiceResumeDistributedHardwareFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "ipc:ipc_core", "samgr:samgr_proxy", ] diff --git a/services/audiomanager/test/fuzztest/sinkservicestopdistributedhardware_fuzzer/BUILD.gn b/services/audiomanager/test/fuzztest/sinkservicestopdistributedhardware_fuzzer/BUILD.gn index e3f16e8210216642eaa5396e91e5fcae6d45e5f7..8daeaef971730074d6c130730ee0254fb4d440a3 100644 --- a/services/audiomanager/test/fuzztest/sinkservicestopdistributedhardware_fuzzer/BUILD.gn +++ b/services/audiomanager/test/fuzztest/sinkservicestopdistributedhardware_fuzzer/BUILD.gn @@ -31,13 +31,6 @@ ohos_fuzztest("SinkServiceStopDistributedHardwareFuzzTest") { sources = [ "sinkservicestopdistributedhardware_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${innerkits_path}/native_cpp/audio_sink/include", @@ -54,6 +47,7 @@ ohos_fuzztest("SinkServiceStopDistributedHardwareFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "ipc:ipc_core", "samgr:samgr_proxy", ] diff --git a/services/audiomanager/test/fuzztest/sinkservicesubscribelocalhardware_fuzzer/BUILD.gn b/services/audiomanager/test/fuzztest/sinkservicesubscribelocalhardware_fuzzer/BUILD.gn index 891dc4fded09e0bf2cc7c315eb27f1863d12c78e..9a3c8a9a66c9f7b2a292dd6acf9424b2ac4dd5bc 100644 --- a/services/audiomanager/test/fuzztest/sinkservicesubscribelocalhardware_fuzzer/BUILD.gn +++ b/services/audiomanager/test/fuzztest/sinkservicesubscribelocalhardware_fuzzer/BUILD.gn @@ -31,13 +31,6 @@ ohos_fuzztest("SinkServiceSubscribeLocalHardwareFuzzTest") { sources = [ "sinkservicesubscribelocalhardware_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${innerkits_path}/native_cpp/audio_sink/include", @@ -54,6 +47,7 @@ ohos_fuzztest("SinkServiceSubscribeLocalHardwareFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "ipc:ipc_core", "samgr:samgr_proxy", ] diff --git a/services/audiomanager/test/fuzztest/sinkserviceunsubscribelocalhardware_fuzzer/BUILD.gn b/services/audiomanager/test/fuzztest/sinkserviceunsubscribelocalhardware_fuzzer/BUILD.gn index d2915a3c5eb92c82b6c97fafad1e803e843e9e9f..1c162ad6f4d95557474217da0a9e5a9c60ed5d90 100644 --- a/services/audiomanager/test/fuzztest/sinkserviceunsubscribelocalhardware_fuzzer/BUILD.gn +++ b/services/audiomanager/test/fuzztest/sinkserviceunsubscribelocalhardware_fuzzer/BUILD.gn @@ -31,13 +31,6 @@ ohos_fuzztest("SinkServiceUnSubscribeLocalHardwareFuzzTest") { sources = [ "sinkserviceunsubscribelocalhardware_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${innerkits_path}/native_cpp/audio_sink/include", @@ -54,6 +47,7 @@ ohos_fuzztest("SinkServiceUnSubscribeLocalHardwareFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "ipc:ipc_core", "samgr:samgr_proxy", ] diff --git a/services/audiomanager/test/fuzztest/sinkstubdaudiosinkstub_fuzzer/BUILD.gn b/services/audiomanager/test/fuzztest/sinkstubdaudiosinkstub_fuzzer/BUILD.gn index 1f2357f5b32534f5fdc0ecc25e19a760061b607c..7e6bf9457f0e9ef9326300f1c48352c5cd630823 100644 --- a/services/audiomanager/test/fuzztest/sinkstubdaudiosinkstub_fuzzer/BUILD.gn +++ b/services/audiomanager/test/fuzztest/sinkstubdaudiosinkstub_fuzzer/BUILD.gn @@ -33,13 +33,6 @@ ohos_fuzztest("SinkStubDaudioSinkStubFuzzTest") { sources = [ "sinkstubdaudiosinkstub_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${innerkits_path}/native_cpp/audio_sink/include", @@ -56,6 +49,7 @@ ohos_fuzztest("SinkStubDaudioSinkStubFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "ipc:ipc_core", "samgr:samgr_proxy", ] diff --git a/services/audiomanager/test/fuzztest/sinkstubonremoterequest_fuzzer/BUILD.gn b/services/audiomanager/test/fuzztest/sinkstubonremoterequest_fuzzer/BUILD.gn index 3963021c87fe295da987f4df03147c3234d65e06..dd60e266939cc8078cb1e48538c8a85ad6513b6d 100644 --- a/services/audiomanager/test/fuzztest/sinkstubonremoterequest_fuzzer/BUILD.gn +++ b/services/audiomanager/test/fuzztest/sinkstubonremoterequest_fuzzer/BUILD.gn @@ -33,13 +33,6 @@ ohos_fuzztest("SinkStubOnRemoteRequestFuzzTest") { sources = [ "sinkstubonremoterequest_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${innerkits_path}/native_cpp/audio_sink/include", @@ -56,6 +49,7 @@ ohos_fuzztest("SinkStubOnRemoteRequestFuzzTest") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "ipc:ipc_core", "samgr:samgr_proxy", ] diff --git a/services/audiomanager/test/fuzztest/sourceserviceconfigdistributedhardware_fuzzer/BUILD.gn b/services/audiomanager/test/fuzztest/sourceserviceconfigdistributedhardware_fuzzer/BUILD.gn index fbe97d2578425bc84f411ccd83aa15d8aa9462c8..99fd85541907003899e6e86e084a8bb1060cf9fb 100644 --- a/services/audiomanager/test/fuzztest/sourceserviceconfigdistributedhardware_fuzzer/BUILD.gn +++ b/services/audiomanager/test/fuzztest/sourceserviceconfigdistributedhardware_fuzzer/BUILD.gn @@ -30,17 +30,6 @@ ohos_fuzztest("SourceServiceConfigDistributedHardwareFuzzTest") { sources = [ "sourceserviceconfigdistributedhardware_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - "${driver_audio_path}/include", - "${mediastandardfwk_path}/audiocapturer/include", - "${mediastandardfwk_path}/audiomanager/include", - "${mediastandardfwk_path}/audiocommon/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${common_path}/dfx_utils/include", @@ -60,9 +49,12 @@ ohos_fuzztest("SourceServiceConfigDistributedHardwareFuzzTest") { ] external_deps = [ + "audio_framework:audio_capturer", + "audio_framework:audio_client", "audio_framework:audio_renderer", "cJSON:cjson", "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "drivers_interface_distributed_audio:libdaudio_proxy_1.0", "ipc:ipc_core", "safwk:system_ability_fwk", diff --git a/services/audiomanager/test/fuzztest/sourceservicedaudionotify_fuzzer/BUILD.gn b/services/audiomanager/test/fuzztest/sourceservicedaudionotify_fuzzer/BUILD.gn index 5ccb792fe89884176e61b50703c2d76b38a5dce5..b9723e07c1381c640e56a319e66600626aa66759 100644 --- a/services/audiomanager/test/fuzztest/sourceservicedaudionotify_fuzzer/BUILD.gn +++ b/services/audiomanager/test/fuzztest/sourceservicedaudionotify_fuzzer/BUILD.gn @@ -31,17 +31,6 @@ ohos_fuzztest("SourceServiceDAudioNotifyFuzzTest") { sources = [ "sourceservicedaudionotify_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - "${driver_audio_path}/include", - "${mediastandardfwk_path}/audiocapturer/include", - "${mediastandardfwk_path}/audiomanager/include", - "${mediastandardfwk_path}/audiocommon/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${common_path}/dfx_utils/include", @@ -61,9 +50,12 @@ ohos_fuzztest("SourceServiceDAudioNotifyFuzzTest") { ] external_deps = [ + "audio_framework:audio_capturer", + "audio_framework:audio_client", "audio_framework:audio_renderer", "cJSON:cjson", "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "drivers_interface_distributed_audio:libdaudio_proxy_1.0", "ipc:ipc_core", "safwk:system_ability_fwk", diff --git a/services/audiomanager/test/fuzztest/sourceserviceinitsource_fuzzer/BUILD.gn b/services/audiomanager/test/fuzztest/sourceserviceinitsource_fuzzer/BUILD.gn index a11e0bae3837c2688ce7ec2231c97a3314a0e275..3159bb8d36eef9a1428e936a866f8a242d38e470 100644 --- a/services/audiomanager/test/fuzztest/sourceserviceinitsource_fuzzer/BUILD.gn +++ b/services/audiomanager/test/fuzztest/sourceserviceinitsource_fuzzer/BUILD.gn @@ -31,17 +31,6 @@ ohos_fuzztest("SourceServiceInitSourceFuzzTest") { sources = [ "sourceserviceinitsource_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - "${driver_audio_path}/include", - "${mediastandardfwk_path}/audiocapturer/include", - "${mediastandardfwk_path}/audiomanager/include", - "${mediastandardfwk_path}/audiocommon/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${common_path}/dfx_utils/include", @@ -63,9 +52,12 @@ ohos_fuzztest("SourceServiceInitSourceFuzzTest") { ] external_deps = [ + "audio_framework:audio_capturer", + "audio_framework:audio_client", "audio_framework:audio_renderer", "cJSON:cjson", "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "drivers_interface_distributed_audio:libdaudio_proxy_1.0", "ipc:ipc_core", "safwk:system_ability_fwk", diff --git a/services/audiomanager/test/fuzztest/sourceserviceregisterdistributedhardware_fuzzer/BUILD.gn b/services/audiomanager/test/fuzztest/sourceserviceregisterdistributedhardware_fuzzer/BUILD.gn index 9885f135eadd9d848645fdcb41f33f3066d88402..334c1a7d516ec2aaa9d770cda28cd70c7cea7ae7 100644 --- a/services/audiomanager/test/fuzztest/sourceserviceregisterdistributedhardware_fuzzer/BUILD.gn +++ b/services/audiomanager/test/fuzztest/sourceserviceregisterdistributedhardware_fuzzer/BUILD.gn @@ -30,17 +30,6 @@ ohos_fuzztest("SourceServiceRegisterDistributedHardwareFuzzTest") { sources = [ "sourceserviceregisterdistributedhardware_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - "${driver_audio_path}/include", - "${mediastandardfwk_path}/audiocapturer/include", - "${mediastandardfwk_path}/audiomanager/include", - "${mediastandardfwk_path}/audiocommon/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${common_path}/dfx_utils/include", @@ -60,9 +49,12 @@ ohos_fuzztest("SourceServiceRegisterDistributedHardwareFuzzTest") { ] external_deps = [ + "audio_framework:audio_capturer", + "audio_framework:audio_client", "audio_framework:audio_renderer", "cJSON:cjson", "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "drivers_interface_distributed_audio:libdaudio_proxy_1.0", "ipc:ipc_core", "safwk:system_ability_fwk", diff --git a/services/audiomanager/test/fuzztest/sourceservicereleasesource_fuzzer/BUILD.gn b/services/audiomanager/test/fuzztest/sourceservicereleasesource_fuzzer/BUILD.gn index 87faef22ce04fabdb0d1a9aec88b2065b8924c3f..12a50c7542a9c928f056144bfd8a359d24e61b19 100644 --- a/services/audiomanager/test/fuzztest/sourceservicereleasesource_fuzzer/BUILD.gn +++ b/services/audiomanager/test/fuzztest/sourceservicereleasesource_fuzzer/BUILD.gn @@ -31,17 +31,6 @@ ohos_fuzztest("SourceServiceReleaseSourceFuzzTest") { sources = [ "sourceservicereleasesource_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - "${driver_audio_path}/include", - "${mediastandardfwk_path}/audiocapturer/include", - "${mediastandardfwk_path}/audiomanager/include", - "${mediastandardfwk_path}/audiocommon/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${common_path}/dfx_utils/include", @@ -61,9 +50,12 @@ ohos_fuzztest("SourceServiceReleaseSourceFuzzTest") { ] external_deps = [ + "audio_framework:audio_capturer", + "audio_framework:audio_client", "audio_framework:audio_renderer", "cJSON:cjson", "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "drivers_interface_distributed_audio:libdaudio_proxy_1.0", "ipc:ipc_core", "safwk:system_ability_fwk", diff --git a/services/audiomanager/test/fuzztest/sourceserviceunregisterdistributedhardware_fuzzer/BUILD.gn b/services/audiomanager/test/fuzztest/sourceserviceunregisterdistributedhardware_fuzzer/BUILD.gn index e506205b8b948e8d180561d1b17afb8db0d8a63b..fa3b4f86ca3ee4685487c5d2fae8b426f8e73f0e 100644 --- a/services/audiomanager/test/fuzztest/sourceserviceunregisterdistributedhardware_fuzzer/BUILD.gn +++ b/services/audiomanager/test/fuzztest/sourceserviceunregisterdistributedhardware_fuzzer/BUILD.gn @@ -30,17 +30,6 @@ ohos_fuzztest("SourceServiceUnregisterDistributedHardwareFuzzTest") { sources = [ "sourceserviceunregisterdistributedhardware_fuzzer.cpp" ] include_dirs = [ - "${fwk_utils_path}/include/log", - "${fwk_utils_path}/include", - "${fwk_common_path}/log/include", - "${fwk_common_path}/utils/include", - "${driver_audio_path}/include", - "${mediastandardfwk_path}/audiocapturer/include", - "${mediastandardfwk_path}/audiomanager/include", - "${mediastandardfwk_path}/audiocommon/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${common_path}/dfx_utils/include", @@ -60,9 +49,12 @@ ohos_fuzztest("SourceServiceUnregisterDistributedHardwareFuzzTest") { ] external_deps = [ + "audio_framework:audio_capturer", + "audio_framework:audio_client", "audio_framework:audio_renderer", "cJSON:cjson", "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "drivers_interface_distributed_audio:libdaudio_proxy_1.0", "ipc:ipc_core", "safwk:system_ability_fwk", diff --git a/services/audiomanager/test/unittest/audiomanagertestutils/include/audio_manager_test_utils.h b/services/audiomanager/test/unittest/audiomanagertestutils/include/audio_manager_test_utils.h index 57e9235885118947e1756895c04a9859588910fa..5e1b4687e841d6c050d0905b820ad9654c4e7bcb 100644 --- a/services/audiomanager/test/unittest/audiomanagertestutils/include/audio_manager_test_utils.h +++ b/services/audiomanager/test/unittest/audiomanagertestutils/include/audio_manager_test_utils.h @@ -89,6 +89,63 @@ public: return 0; } }; + +class MockIAudioDataTransportInner : public IAudioDataTransport { +public: + MockIAudioDataTransportInner() = default; + ~MockIAudioDataTransportInner() = default; + + int32_t SetUp(const AudioParam &localParam, const AudioParam &remoteParam, + const std::shared_ptr &callback, const PortCapType capType) override + { + return ERR_DH_AUDIO_FAILED; + } + + int32_t Start() override + { + return ERR_DH_AUDIO_FAILED; + } + + int32_t Stop() override + { + return ERR_DH_AUDIO_FAILED; + } + + int32_t Release() override + { + return ERR_DH_AUDIO_FAILED; + } + + int32_t Pause() override + { + return ERR_DH_AUDIO_FAILED; + } + + int32_t Restart(const AudioParam &localParam, const AudioParam &remoteParam) override + { + return ERR_DH_AUDIO_FAILED; + } + + int32_t FeedAudioData(std::shared_ptr &audioData) override + { + return ERR_DH_AUDIO_FAILED; + } + + int32_t InitEngine(IAVEngineProvider *providerPtr) override + { + return ERR_DH_AUDIO_FAILED; + } + + int32_t SendMessage(uint32_t type, std::string content, std::string dstDevId) override + { + return ERR_DH_AUDIO_FAILED; + } + + int32_t CreateCtrl() override + { + return ERR_DH_AUDIO_FAILED; + } +}; } // namespace DistributedHardware } // namespace OHOS #endif // OHOS_AUDIO_MANAGER_TEST_UTILS diff --git a/services/audiomanager/test/unittest/managersink/BUILD.gn b/services/audiomanager/test/unittest/managersink/BUILD.gn index 8bacf59bcec5b3ec6c42474be14e050abc92d970..2e90a403bdb2ee5b98c2890316d20c51a2fcfb18 100644 --- a/services/audiomanager/test/unittest/managersink/BUILD.gn +++ b/services/audiomanager/test/unittest/managersink/BUILD.gn @@ -22,15 +22,6 @@ config("module_private_config") { visibility = [ ":*" ] include_dirs = [ - "${audio_framework_path}/audiopolicy/include", - "${mediastandardfwk_path}/audiocapturer/include", - "${mediastandardfwk_path}/audiocommon/include", - "${mediastandardfwk_path}/audiorenderer/include", - "${mediastandardfwk_path}/audiomanager/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "${audio_client_path}/micclient/include", "${audio_client_path}/spkclient/include", "${audio_client_path}/interface", @@ -64,8 +55,6 @@ ohos_unittest("DaudioSinkDevTest") { "${innerkits_path}/native_cpp/audio_sink:distributed_audio_sink_sdk", "${services_path}/audiomanager/servicesink:distributed_audio_sink", "${services_path}/common:distributed_audio_utils", - "//third_party/googletest:gmock", - "//third_party/googletest:gtest_main", ] external_deps = [ @@ -78,7 +67,9 @@ ohos_unittest("DaudioSinkDevTest") { "device_security_level:dslm_sdk", "distributed_hardware_fwk:distributed_av_receiver", "distributed_hardware_fwk:distributed_av_sender", + "distributed_hardware_fwk:distributedhardwareutils", "eventhandler:libeventhandler", + "googletest:gmock", "hdf_core:libhdf_ipc_adapter", "hdf_core:libhdf_utils", "hdf_core:libhdi", @@ -101,8 +92,6 @@ ohos_unittest("DAudioSinkManagerTest") { deps = [ "${innerkits_path}/native_cpp/audio_sink:distributed_audio_sink_sdk", "${services_path}/audiomanager/servicesink:distributed_audio_sink", - "//third_party/googletest:gmock", - "//third_party/googletest:gtest_main", ] external_deps = [ @@ -115,6 +104,8 @@ ohos_unittest("DAudioSinkManagerTest") { "device_security_level:dslm_sdk", "distributed_hardware_fwk:distributed_av_receiver", "distributed_hardware_fwk:distributed_av_sender", + "distributed_hardware_fwk:distributedhardwareutils", + "googletest:gmock", "hdf_core:libhdf_ipc_adapter", "hdf_core:libhdf_utils", "hdf_core:libhdi", diff --git a/services/audiomanager/test/unittest/servicesink/BUILD.gn b/services/audiomanager/test/unittest/servicesink/BUILD.gn index 80186d8f400ac377dc87df92d33910691f568f8c..7396b13df36cddd1c208382f42b5749e8b5de653 100644 --- a/services/audiomanager/test/unittest/servicesink/BUILD.gn +++ b/services/audiomanager/test/unittest/servicesink/BUILD.gn @@ -22,15 +22,6 @@ config("module_private_config") { visibility = [ ":*" ] include_dirs = [ - "${audio_framework_path}/audiopolicy/include", - "${fwk_common_path}/utils/include", - "${mediastandardfwk_path}/audiocapturer/include", - "${mediastandardfwk_path}/audiocommon/include", - "${mediastandardfwk_path}/audiorenderer/include", - "${mediastandardfwk_path}/audiomanager/include", - ] - - include_dirs += [ "${audio_client_path}/micclient/include", "${audio_client_path}/spkclient/include", "${audio_control_path}/controlsink/include", @@ -59,18 +50,16 @@ ohos_unittest("DaudioSinkServiceTest") { configs = [ ":module_private_config" ] - deps = [ - "${services_path}/audiomanager/servicesink:distributed_audio_sink", - "//third_party/googletest:gmock", - "//third_party/googletest:gtest_main", - ] + deps = [ "${services_path}/audiomanager/servicesink:distributed_audio_sink" ] external_deps = [ "audio_framework:audio_capturer", "audio_framework:audio_client", "audio_framework:audio_renderer", "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "dsoftbus:softbus_client", + "googletest:gmock", "hisysevent:libhisysevent", "hitrace:hitrace_meter", "ipc:ipc_core", @@ -96,11 +85,7 @@ ohos_unittest("DaudioSinkStubTest") { configs = [ ":module_private_config" ] - deps = [ - "${services_path}/audiomanager/servicesink:distributed_audio_sink", - "//third_party/googletest:gmock", - "//third_party/googletest:gtest_main", - ] + deps = [ "${services_path}/audiomanager/servicesink:distributed_audio_sink" ] external_deps = [ "access_token:libaccesstoken_sdk", @@ -109,7 +94,9 @@ ohos_unittest("DaudioSinkStubTest") { "audio_framework:audio_client", "audio_framework:audio_renderer", "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "dsoftbus:softbus_client", + "googletest:gmock", "hisysevent:libhisysevent", "hitrace:hitrace_meter", "ipc:ipc_core", diff --git a/services/audiomanager/test/unittest/servicesink/src/daudio_sink_stub_test.cpp b/services/audiomanager/test/unittest/servicesink/src/daudio_sink_stub_test.cpp index afda823da630f52bb1b7929731c99cce85bc2835..4c51bde6a1827c38a2e92f89fe418ca6b8f0efef 100644 --- a/services/audiomanager/test/unittest/servicesink/src/daudio_sink_stub_test.cpp +++ b/services/audiomanager/test/unittest/servicesink/src/daudio_sink_stub_test.cpp @@ -98,11 +98,11 @@ HWTEST_F(DAudioSinkStubTest, PauseDistributedHardwareInner_001, TestSize.Level1) MessageParcel data; MessageParcel reply; MessageOption option; - EXPECT_EQ(ERR_DH_AUDIO_ACCESS_PERMISSION_CHECK_FAIL, + EXPECT_EQ(ERR_DH_AUDIO_SA_PERMISSION_FAIED, sinkStub_->PauseDistributedHardwareInner(data, reply, option)); - EXPECT_EQ(ERR_DH_AUDIO_ACCESS_PERMISSION_CHECK_FAIL, + EXPECT_EQ(ERR_DH_AUDIO_SA_PERMISSION_FAIED, sinkStub_->ResumeDistributedHardwareInner(data, reply, option)); - EXPECT_EQ(ERR_DH_AUDIO_ACCESS_PERMISSION_CHECK_FAIL, + EXPECT_EQ(ERR_DH_AUDIO_SA_PERMISSION_FAIED, sinkStub_->StopDistributedHardwareInner(data, reply, option)); } @@ -117,8 +117,8 @@ HWTEST_F(DAudioSinkStubTest, SubscribeLocalHardwareInner_001, TestSize.Level1) MessageParcel data; MessageParcel reply; MessageOption option; - EXPECT_EQ(DH_SUCCESS, sinkStub_->SubscribeLocalHardwareInner(data, reply, option)); - EXPECT_EQ(DH_SUCCESS, sinkStub_->UnsubscribeLocalHardwareInner(data, reply, option)); + EXPECT_EQ(ERR_DH_AUDIO_SA_PERMISSION_FAIED, sinkStub_->SubscribeLocalHardwareInner(data, reply, option)); + EXPECT_EQ(ERR_DH_AUDIO_SA_PERMISSION_FAIED, sinkStub_->UnsubscribeLocalHardwareInner(data, reply, option)); EXPECT_EQ(DH_SUCCESS, sinkStub_->DAudioNotifyInner(data, reply, option)); } } // DistributedHardware diff --git a/services/audiomanager/test/unittest/servicesource/BUILD.gn b/services/audiomanager/test/unittest/servicesource/BUILD.gn index cfc419181f0f79e550ce8177587b8ec17fd463bd..568dbaa686ff7da1c6ab91e7bb44f643336778ec 100644 --- a/services/audiomanager/test/unittest/servicesource/BUILD.gn +++ b/services/audiomanager/test/unittest/servicesource/BUILD.gn @@ -22,16 +22,6 @@ config("module_private_config") { visibility = [ ":*" ] include_dirs = [ - "${audio_framework_path}/audiopolicy/include", - "${driver_audio_path}/include", - "${fwk_common_path}/utils/include", - "${mediastandardfwk_path}/audiocapturer/include", - "${mediastandardfwk_path}/audiocommon/include", - "${mediastandardfwk_path}/audiorenderer/include", - "${mediastandardfwk_path}/audiomanager/include", - ] - - include_dirs += [ "${audio_control_path}/controlsource/include", "${audio_hdi_proxy_path}/include", "${audio_processor_path}/interface", @@ -41,7 +31,6 @@ config("module_private_config") { "${common_path}/include", "${common_path}/dfx_utils/include", "${distributedaudio_path}/audiohandler/include", - "${hdf_service_path}/hdi_service/common/include", "${innerkits_path}/native_cpp/audio_sink/include", "${innerkits_path}/native_cpp/audio_source/include", "${interfaces_path}/inner_kits/native_cpp/audio_sink/include", @@ -67,11 +56,8 @@ ohos_unittest("DaudioSourceServiceTest") { configs = [ ":module_private_config" ] - deps = [ - "${services_path}/audiomanager/servicesource:distributed_audio_source", - "//third_party/googletest:gmock", - "//third_party/googletest:gtest_main", - ] + deps = + [ "${services_path}/audiomanager/servicesource:distributed_audio_source" ] external_deps = [ "audio_framework:audio_capturer", @@ -79,8 +65,10 @@ ohos_unittest("DaudioSourceServiceTest") { "audio_framework:audio_renderer", "cJSON:cjson", "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "drivers_interface_distributed_audio:libdaudio_proxy_1.0", "dsoftbus:softbus_client", + "googletest:gmock", "hisysevent:libhisysevent", "hitrace:hitrace_meter", "ipc:ipc_core", @@ -106,11 +94,8 @@ ohos_unittest("DaudioSourceStubTest") { configs = [ ":module_private_config" ] - deps = [ - "${services_path}/audiomanager/servicesource:distributed_audio_source", - "//third_party/googletest:gmock", - "//third_party/googletest:gtest_main", - ] + deps = + [ "${services_path}/audiomanager/servicesource:distributed_audio_source" ] external_deps = [ "access_token:libaccesstoken_sdk", @@ -120,8 +105,10 @@ ohos_unittest("DaudioSourceStubTest") { "audio_framework:audio_renderer", "cJSON:cjson", "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "drivers_interface_distributed_audio:libdaudio_proxy_1.0", "dsoftbus:softbus_client", + "googletest:gmock", "hisysevent:libhisysevent", "hitrace:hitrace_meter", "ipc:ipc_core", diff --git a/services/audiomanager/test/unittest/servicesource/src/daudio_source_stub_test.cpp b/services/audiomanager/test/unittest/servicesource/src/daudio_source_stub_test.cpp index 31ae3a6a9ba0ba68e1b9fda4b7e1af4ee0509381..56f609f9eef1774552bc90f15aadf3aebb99549b 100644 --- a/services/audiomanager/test/unittest/servicesource/src/daudio_source_stub_test.cpp +++ b/services/audiomanager/test/unittest/servicesource/src/daudio_source_stub_test.cpp @@ -114,7 +114,7 @@ HWTEST_F(DAudioSourceStubTest, ConfigDistributedHardwareInner_001, TestSize.Leve MessageParcel data; MessageParcel reply; MessageOption option; - EXPECT_EQ(DH_SUCCESS, sourceStub_->ConfigDistributedHardwareInner(data, reply, option)); + EXPECT_EQ(ERR_DH_AUDIO_SA_PERMISSION_FAIED, sourceStub_->ConfigDistributedHardwareInner(data, reply, option)); EXPECT_EQ(DH_SUCCESS, sourceStub_->DAudioNotifyInner(data, reply, option)); } } // DistributedHardware diff --git a/services/audiomanager/test/unittest/sourcedevice/BUILD.gn b/services/audiomanager/test/unittest/sourcedevice/BUILD.gn index 9300602ba11257d77b0f1d5153fd1c27ddb6adc2..0542a837fbd0b3f8b74bca6449681002e7d60909 100644 --- a/services/audiomanager/test/unittest/sourcedevice/BUILD.gn +++ b/services/audiomanager/test/unittest/sourcedevice/BUILD.gn @@ -20,14 +20,6 @@ config("module_private_config") { visibility = [ ":*" ] include_dirs = [ - "${driver_audio_path}/include", - "${fwk_common_path}/utils/include", - "${mediastandardfwk_path}/audiocapturer/include", - "${mediastandardfwk_path}/audiocommon/include", - "${mediastandardfwk_path}/audiomanager/include", - ] - - include_dirs += [ "include", "${audio_control_path}/controlsource/include", "${audio_hdi_proxy_path}/include", @@ -38,7 +30,6 @@ config("module_private_config") { "${common_path}/include", "${common_path}/dfx_utils/include", "${distributedaudio_path}/audiohandler/include", - "${hdf_service_path}/hdi_service/common/include", "${innerkits_path}/native_cpp/audio_source/include", "${innerkits_path}/native_cpp/audio_sink/include", "${interfaces_path}/inner_kits/native_cpp/audio_sink/include", @@ -74,18 +65,21 @@ ohos_unittest("DaudioSourceDevTest") { "${audio_transport_path}/senderengine:distributed_audio_encode_transport", "${services_path}/audiomanager/servicesource:distributed_audio_source", "${services_path}/common:distributed_audio_utils", - "//third_party/googletest:gmock", - "//third_party/googletest:gtest_main", ] external_deps = [ + "audio_framework:audio_capturer", + "audio_framework:audio_client", + "audio_framework:audio_renderer", "cJSON:cjson", "c_utils:utils", "distributed_hardware_fwk:distributed_av_receiver", "distributed_hardware_fwk:distributed_av_sender", + "distributed_hardware_fwk:distributedhardwareutils", "drivers_interface_distributed_audio:libdaudioext_proxy_2.0", "dsoftbus:softbus_client", "eventhandler:libeventhandler", + "googletest:gmock", "hilog:libhilog", "ipc:ipc_core", "samgr:samgr_proxy", @@ -112,15 +106,17 @@ ohos_unittest("DMicDevTest") { "${audio_transport_path}/receiverengine:distributed_audio_decode_transport", "${services_path}/audiomanager/servicesource:distributed_audio_source", "${services_path}/common:distributed_audio_utils", - "//third_party/googletest:gmock", - "//third_party/googletest:gtest_main", ] external_deps = [ + "audio_framework:audio_capturer", + "audio_framework:audio_client", + "audio_framework:audio_renderer", "cJSON:cjson", "distributed_hardware_fwk:distributed_av_receiver", "distributed_hardware_fwk:distributed_av_sender", "drivers_interface_distributed_audio:libdaudioext_proxy_2.0", + "googletest:gmock", "hilog:libhilog", "ipc:ipc_core", "samgr:samgr_proxy", @@ -147,16 +143,18 @@ ohos_unittest("DSpeakerDevTest") { "${audio_transport_path}/senderengine:distributed_audio_encode_transport", "${services_path}/audiomanager/servicesource:distributed_audio_source", "${services_path}/common:distributed_audio_utils", - "//third_party/googletest:gmock", - "//third_party/googletest:gtest_main", ] external_deps = [ + "audio_framework:audio_capturer", + "audio_framework:audio_client", + "audio_framework:audio_renderer", "cJSON:cjson", "c_utils:utils", "distributed_hardware_fwk:distributed_av_receiver", "distributed_hardware_fwk:distributed_av_sender", "drivers_interface_distributed_audio:libdaudioext_proxy_2.0", + "googletest:gmock", "hilog:libhilog", "ipc:ipc_core", "samgr:samgr_proxy", @@ -187,11 +185,12 @@ ohos_unittest("DAudioEchoCannelManagerTest") { "${audio_transport_path}/senderengine:distributed_audio_encode_transport", "${services_path}/audiomanager/servicesource:distributed_audio_source", "${services_path}/common:distributed_audio_utils", - "//third_party/googletest:gmock", - "//third_party/googletest:gtest_main", ] external_deps = [ + "audio_framework:audio_capturer", + "audio_framework:audio_client", + "audio_framework:audio_renderer", "cJSON:cjson", "c_utils:utils", "distributed_hardware_fwk:distributed_av_receiver", @@ -199,6 +198,7 @@ ohos_unittest("DAudioEchoCannelManagerTest") { "drivers_interface_distributed_audio:libdaudioext_proxy_2.0", "dsoftbus:softbus_client", "eventhandler:libeventhandler", + "googletest:gmock", "hilog:libhilog", "ipc:ipc_core", "samgr:samgr_proxy", diff --git a/services/audiomanager/test/unittest/sourcedevice/src/daudio_echo_cannel_manager_test.cpp b/services/audiomanager/test/unittest/sourcedevice/src/daudio_echo_cannel_manager_test.cpp index c77832ac87fbc5df214a36b4dab63b3c69e7cf0f..7158b4da0f20d3d50f7cc417fdb45e20a8c7e2b3 100644 --- a/services/audiomanager/test/unittest/sourcedevice/src/daudio_echo_cannel_manager_test.cpp +++ b/services/audiomanager/test/unittest/sourcedevice/src/daudio_echo_cannel_manager_test.cpp @@ -74,9 +74,9 @@ HWTEST_F(DAudioEchoCannelManagerTest, OnMicDataReceived_001, TestSize.Level1) */ HWTEST_F(DAudioEchoCannelManagerTest, AudioCaptureSetUp_001, TestSize.Level1) { - EXPECT_EQ(DH_SUCCESS, echoCannelManager_->AudioCaptureSetUp()); - EXPECT_EQ(DH_SUCCESS, echoCannelManager_->AudioCaptureStart()); - EXPECT_EQ(DH_SUCCESS, echoCannelManager_->AudioCaptureStop()); + EXPECT_EQ(ERR_DH_AUDIO_FAILED, echoCannelManager_->AudioCaptureSetUp()); + EXPECT_EQ(ERR_DH_AUDIO_FAILED, echoCannelManager_->AudioCaptureStart()); + EXPECT_EQ(ERR_DH_AUDIO_FAILED, echoCannelManager_->AudioCaptureStop()); EXPECT_EQ(DH_SUCCESS, echoCannelManager_->AudioCaptureRelease()); } diff --git a/services/audiomanager/test/unittest/sourcedevice/src/dmic_dev_test.cpp b/services/audiomanager/test/unittest/sourcedevice/src/dmic_dev_test.cpp index 7e157abb87802ce5a36e64192ff50a7babddda63..5e333186ffd2ec8453574f7230b514c97da5b924 100644 --- a/services/audiomanager/test/unittest/sourcedevice/src/dmic_dev_test.cpp +++ b/services/audiomanager/test/unittest/sourcedevice/src/dmic_dev_test.cpp @@ -20,6 +20,7 @@ using namespace testing::ext; namespace OHOS { namespace DistributedHardware { constexpr int32_t DH_ID = 1; +constexpr size_t NOTIFY_WAIT_FRAMES = 5; constexpr int32_t DH_ID_MIC = 134217728; const std::string DEV_ID = "Test_Dev_Id"; const std::string CAP = "Test_Capability"; @@ -59,6 +60,12 @@ HWTEST_F(DMicDevTest, InitReceiverEngine_001, TestSize.Level1) EXPECT_EQ(ERR_DH_AUDIO_NULLPTR, mic_->InitReceiverEngine(providerPtr)); mic_->micTrans_ = std::make_shared(); EXPECT_EQ(DH_SUCCESS, mic_->InitReceiverEngine(providerPtr)); + + event = { EventType::EVENT_STOP_SUCCESS, "", "" }; + mic_->OnEngineTransEvent(event); + + mic_->echoCannelOn_ = true; + mic_->OnEngineTransDataAvailable(audioData); } /** @@ -162,6 +169,22 @@ HWTEST_F(DMicDevTest, NotifyEvent_001, TestSize.Level1) event.type = EVENT_UNKNOWN; EXPECT_EQ(DH_SUCCESS, mic_->NotifyEvent(streamId_, event)); + mic_->isTransReady_ = false; + event.type = AUDIO_START; + EXPECT_EQ(DH_SUCCESS, mic_->NotifyEvent(streamId_, event)); + + event.type = AUDIO_STOP; + EXPECT_EQ(DH_SUCCESS, mic_->NotifyEvent(streamId_, event)); + + mic_->isTransReady_ = true; + for (int32_t i = 0; i < NOTIFY_WAIT_FRAMES; i++) { + size_t size = 4096; + auto audioData = std::make_shared(size); + mic_->dataQueue_.push(audioData); + } + event.type = AUDIO_START; + EXPECT_EQ(DH_SUCCESS, mic_->NotifyEvent(streamId_, event)); + eventCb_ = nullptr; EXPECT_EQ(ERR_DH_AUDIO_NULLPTR, mic_->NotifyEvent(streamId_, event)); } @@ -179,6 +202,9 @@ HWTEST_F(DMicDevTest, SetUp_001, TestSize.Level1) mic_->micTrans_ = std::make_shared(); EXPECT_EQ(DH_SUCCESS, mic_->SetUp()); + + mic_->micTrans_ = std::make_shared(); + EXPECT_EQ(ERR_DH_AUDIO_FAILED, mic_->SetUp()); } /** @@ -306,6 +332,16 @@ HWTEST_F(DMicDevTest, ReadStreamData_001, TestSize.Level1) std::shared_ptr readData1 = nullptr; EXPECT_EQ(DH_SUCCESS, mic_->ReadStreamData(streamId_, readData1)); + + mic_->curStatus_ = AudioStatus::STATUS_STOP; + EXPECT_EQ(ERR_DH_AUDIO_FAILED, mic_->ReadStreamData(streamId_, readData1)); + + mic_->curStatus_ = AudioStatus::STATUS_START; + mic_->insertFrameCnt_ = 1; + EXPECT_EQ(DH_SUCCESS, mic_->ReadStreamData(streamId_, readData1)); + + mic_->insertFrameCnt_ = 11; + EXPECT_EQ(DH_SUCCESS, mic_->ReadStreamData(streamId_, readData1)); } /** diff --git a/services/audiomanager/test/unittest/sourcemanager/BUILD.gn b/services/audiomanager/test/unittest/sourcemanager/BUILD.gn index e2fa7e5d1c98b9b22f9dcf1815908c666970fd55..7f32080a0c8da54710ca0442026a140d3c07803e 100644 --- a/services/audiomanager/test/unittest/sourcemanager/BUILD.gn +++ b/services/audiomanager/test/unittest/sourcemanager/BUILD.gn @@ -20,14 +20,6 @@ config("module_private_config") { visibility = [ ":*" ] include_dirs = [ - "${driver_audio_path}/include", - "${fwk_common_path}/utils/include", - "${mediastandardfwk_path}/audiocapturer/include", - "${mediastandardfwk_path}/audiocommon/include", - "${mediastandardfwk_path}/audiomanager/include", - ] - - include_dirs += [ "include", "${audio_control_path}/controlsource/include", "${audio_hdi_proxy_path}/include", @@ -41,7 +33,6 @@ config("module_private_config") { "${common_path}/include", "${common_path}/dfx_utils/include", "${distributedaudio_path}/audiohandler/include", - "${hdf_service_path}/hdi_service/common/include", "${interfaces_path}/inner_kits/native_cpp/audio_sink/include", "${interfaces_path}/inner_kits/native_cpp/audio_source/include", "${innerkits_path}/native_cpp/audio_source/include", @@ -67,18 +58,21 @@ ohos_unittest("DaudioSourceMgrTest") { "${innerkits_path}/native_cpp/audio_source:distributed_audio_source_sdk", "${services_path}/audiomanager/servicesource:distributed_audio_source", "${services_path}/common:distributed_audio_utils", - "//third_party/googletest:gmock", - "//third_party/googletest:gtest_main", ] external_deps = [ + "audio_framework:audio_capturer", + "audio_framework:audio_client", + "audio_framework:audio_renderer", "cJSON:cjson", "c_utils:utils", "distributed_hardware_fwk:distributed_av_receiver", "distributed_hardware_fwk:distributed_av_sender", + "distributed_hardware_fwk:distributedhardwareutils", "drivers_interface_distributed_audio:libdaudioext_proxy_2.0", "dsoftbus:softbus_client", "eventhandler:libeventhandler", + "googletest:gmock", "hdf_core:libhdi", "ipc:ipc_core", "ipc:ipc_single", diff --git a/services/audioprocessor/test/unittest/common/directprocessor/BUILD.gn b/services/audioprocessor/test/unittest/common/directprocessor/BUILD.gn index b0c396a3ec10ec78ed8e950aa2c24c51ec61ea1f..91ecaea29ae80cea25a99b709d930e2b8e8111e0 100644 --- a/services/audioprocessor/test/unittest/common/directprocessor/BUILD.gn +++ b/services/audioprocessor/test/unittest/common/directprocessor/BUILD.gn @@ -23,12 +23,6 @@ config("module_private_config") { visibility = [ ":*" ] include_dirs = [ - "${mediastandard_path}/interfaces/innerkits/native/media/include", - "${mediastandardfwk_path}/audiocommon/include", - "${fwk_common_path}/utils/include", - ] - - include_dirs += [ "${common_path}/include", "${services_path}/common/audioparam", "${services_path}/common/audiodata/include", @@ -47,11 +41,14 @@ ohos_unittest("DirectProcessorTest") { deps = [ "${audio_transport_path}/receiverengine:distributed_audio_decode_transport", "${services_path}/common:distributed_audio_utils", - "//third_party/googletest:gtest_main", ] external_deps = [ + "audio_framework:audio_capturer", + "audio_framework:audio_client", + "audio_framework:audio_renderer", "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "player_framework:media_client", ] diff --git a/services/audiotransport/receiverengine/src/av_receiver_engine_transport.cpp b/services/audiotransport/receiverengine/src/av_receiver_engine_transport.cpp index 6849ae299e34a9e4df69a539c483daa430328f65..f5ab6aa187346774d2beac4972512fbda2b7dc68 100644 --- a/services/audiotransport/receiverengine/src/av_receiver_engine_transport.cpp +++ b/services/audiotransport/receiverengine/src/av_receiver_engine_transport.cpp @@ -129,6 +129,7 @@ void AVTransReceiverTransport::OnEngineDataAvailable(const std::shared_ptrGetBufferData(0); + CHECK_NULL_VOID(bufferData); std::shared_ptr audioData = std::make_shared(bufferData->GetSize()); int32_t ret = memcpy_s(audioData->Data(), audioData->Capacity(), bufferData->GetAddress(), bufferData->GetSize()); if (ret != EOK) { diff --git a/services/audiotransport/test/unittest/receiverengine/BUILD.gn b/services/audiotransport/test/unittest/receiverengine/BUILD.gn index 756eeaee67320336b71e6dac0f10d8a8cbd74d81..f54940196feea1d864f3b1e5647620488755e292 100644 --- a/services/audiotransport/test/unittest/receiverengine/BUILD.gn +++ b/services/audiotransport/test/unittest/receiverengine/BUILD.gn @@ -21,11 +21,6 @@ config("module_private_config") { visibility = [ ":*" ] include_dirs = [ - "${mediastandard_path}/interfaces/innerkits/native/media/include", - "${mediastandardfwk_path}/audiocommon/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${common_path}/dfx_utils/include", @@ -51,14 +46,16 @@ ohos_unittest("AVTransReceiverAdapterTest") { deps = [ "${audio_transport_path}/receiverengine:distributed_audio_decode_transport", "${services_path}/common:distributed_audio_utils", - "//third_party/googletest:gmock", - "//third_party/googletest:gtest_main", ] external_deps = [ + "audio_framework:audio_capturer", + "audio_framework:audio_client", + "audio_framework:audio_renderer", "cJSON:cjson", "distributed_hardware_fwk:distributed_av_receiver", "dsoftbus:softbus_client", + "googletest:gmock", ] } diff --git a/services/audiotransport/test/unittest/receiverengine/engineutils/include/engine_test_utils.h b/services/audiotransport/test/unittest/receiverengine/engineutils/include/engine_test_utils.h index 781ef4034b54c382ad3cd0002b837666d4f0e548..a72d6c5cefc2b752d04699ba6ceedd82bfcd9297 100644 --- a/services/audiotransport/test/unittest/receiverengine/engineutils/include/engine_test_utils.h +++ b/services/audiotransport/test/unittest/receiverengine/engineutils/include/engine_test_utils.h @@ -105,7 +105,7 @@ public: return 0; } - int32_t RegisterReceiverCallback(const std::shared_ptr &callback) + int32_t RegisterReceiverCallback(const std::shared_ptr &callback) override { (void) callback; return 0; @@ -177,7 +177,7 @@ public: return 0; } - int32_t RegisterSenderCallback(const std::shared_ptr &callback) + int32_t RegisterSenderCallback(const std::shared_ptr &callback) override { (void) callback; return 0; @@ -249,7 +249,7 @@ public: return 1; } - int32_t RegisterSenderCallback(const std::shared_ptr &callback) + int32_t RegisterSenderCallback(const std::shared_ptr &callback) override { (void) callback; return 0; diff --git a/services/audiotransport/test/unittest/senderengine/BUILD.gn b/services/audiotransport/test/unittest/senderengine/BUILD.gn index 6351564e5d8365d5768a9134726c7585557f690a..c262132dc9574cf9b4d9804468915553396bd4ab 100644 --- a/services/audiotransport/test/unittest/senderengine/BUILD.gn +++ b/services/audiotransport/test/unittest/senderengine/BUILD.gn @@ -20,11 +20,6 @@ config("module_private_config") { visibility = [ ":*" ] include_dirs = [ - "${mediastandard_path}/interfaces/innerkits/native/media/include", - "${mediastandardfwk_path}/audiocommon/include", - ] - - include_dirs += [ "include", "${common_path}/include", "${common_path}/dfx_utils/include", @@ -50,14 +45,16 @@ ohos_unittest("AVTransSenderAdapterTest") { deps = [ "${audio_transport_path}/senderengine:distributed_audio_encode_transport", "${services_path}/common:distributed_audio_utils", - "//third_party/googletest:gmock", - "//third_party/googletest:gtest_main", ] external_deps = [ + "audio_framework:audio_capturer", + "audio_framework:audio_client", + "audio_framework:audio_renderer", "cJSON:cjson", "distributed_hardware_fwk:distributed_av_sender", "dsoftbus:softbus_client", + "googletest:gmock", ] } diff --git a/services/common/test/unittest/audiodata/BUILD.gn b/services/common/test/unittest/audiodata/BUILD.gn index 4ade4027807432911318e9f1a792dcc90604fcd2..b51ce065eaa230b333d7facd3b0c46821112f2cd 100644 --- a/services/common/test/unittest/audiodata/BUILD.gn +++ b/services/common/test/unittest/audiodata/BUILD.gn @@ -34,15 +34,12 @@ ohos_unittest("AudioDataTest") { configs = [ ":module_private_config" ] - deps = [ - "${services_path}/common:distributed_audio_utils", - "//third_party/googletest:gmock", - "//third_party/googletest:gtest_main", - ] + deps = [ "${services_path}/common:distributed_audio_utils" ] external_deps = [ "c_utils:utils", "dsoftbus:softbus_client", + "googletest:gmock", ] }