From b2a9785b5194d54df8b15247a6dc4942148b7fa1 Mon Sep 17 00:00:00 2001 From: zhanghanwu Date: Wed, 9 Apr 2025 17:49:31 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=96=B0=E9=9C=80=E6=B1=82]:=20[=E9=83=A8?= =?UTF-8?q?=E4=BB=B6=E5=8C=96=E6=B2=BB=E7=90=86]=E7=A6=81=E6=AD=A2?= =?UTF-8?q?=E7=BB=9D=E5=AF=B9=E8=B7=AF=E5=BE=84=E4=BE=9D=E8=B5=96=E5=85=B6?= =?UTF-8?q?=E5=AE=83=E9=83=A8=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frameworks/ans/BUILD.gn | 236 +----------------- frameworks/core/BUILD.gn | 1 + frameworks/core/test/unittest/BUILD.gn | 1 + .../ans_notification_annex_test/BUILD.gn | 2 +- frameworks/js/napi/BUILD.gn | 8 +- frameworks/js/napi/src/manager/BUILD.gn | 4 +- frameworks/js/napi/src/reminder/BUILD.gn | 8 +- frameworks/js/napi/src/subscribe/BUILD.gn | 6 +- frameworks/reminder/BUILD.gn | 2 - frameworks/test/moduletest/BUILD.gn | 13 +- notification_ability_runtime.gni | 214 ++++++++++++++++ services/ans/BUILD.gn | 6 +- .../live_publish_process.cpp | 2 +- .../add_do_not_disturb_profiles.cpp | 2 +- .../get_do_not_disturb_date.cpp | 2 +- .../get_do_not_disturb_profile.cpp | 2 +- .../set_do_not_disturb_date.cpp | 2 +- services/ans/src/slot_manager/AddSlots.cpp | 2 +- .../setNotificationEnableSlot.cpp | 2 +- services/ans/test/unittest/BUILD.gn | 85 ++----- services/distributed/test/unittest/BUILD.gn | 18 +- services/test/moduletest/BUILD.gn | 1 - .../notification_publish_test/BUILD.gn | 4 +- .../notification_services_test/BUILD.gn | 7 +- .../BUILD.gn | 4 +- test/fuzztest/ansmanagerstub_fuzzer/BUILD.gn | 4 +- .../ansmanagerstubannex_fuzzer/BUILD.gn | 4 +- test/fuzztest/fuzz_common_base/BUILD.gn | 4 + tools/test/unittest/dump/BUILD.gn | 5 +- 29 files changed, 296 insertions(+), 355 deletions(-) create mode 100644 notification_ability_runtime.gni diff --git a/frameworks/ans/BUILD.gn b/frameworks/ans/BUILD.gn index 80a21b60f..4ebcb614e 100644 --- a/frameworks/ans/BUILD.gn +++ b/frameworks/ans/BUILD.gn @@ -30,30 +30,6 @@ idl_gen_interface("ans_dialog_callback_interface") { part_name = "distributed_notification_service" } -idl_gen_interface("ans_operation_callback_interface") { - sources = [ "IAnsOperationCallback.idl" ] - log_domainid = "0xD001203" - log_tag = "Ans" - subsystem_name = "notification" - part_name = "distributed_notification_service" -} - -idl_gen_interface("ans_subscriber_local_live_view_interface") { - sources = [ "IAnsSubscriberLocalLiveView.idl" ] - log_domainid = "0xD001203" - log_tag = "Ans" - subsystem_name = "notification" - part_name = "distributed_notification_service" -} - -idl_gen_interface("ans_subscriber_interface") { - sources = [ "IAnsSubscriber.idl" ] - log_domainid = "0xD001203" - log_tag = "Ans" - subsystem_name = "notification" - part_name = "distributed_notification_service" -} - group("ans_client") { deps = [ ":ans_innerkits" ] } @@ -67,7 +43,6 @@ config("ans_innerkits_public_config") { "${core_path}/common/include", "${core_path}/include", "${target_gen_dir}", - "//third_party/json/single_include", ] configs = [ "${multimedia_path}/interfaces/innerkits:image_external_config" ] } @@ -85,19 +60,6 @@ config("ans_innerkits_config") { configs = [ "${multimedia_path}/interfaces/innerkits:image_external_config" ] } -config("ans_operation_callback_config") { - visibility = [ "./../../*" ] - - include_dirs = [ - "${inner_api_path}", - "${interfaces_path}/kits/native", - "${core_path}/common/include", - "${core_path}/include", - "${target_gen_dir}", - ] - configs = [ "${multimedia_path}/interfaces/innerkits:image_external_config" ] -} - config("swing_call_back_config") { visibility = [ "./../../*" ] @@ -111,32 +73,6 @@ config("swing_call_back_config") { configs = [ "${multimedia_path}/interfaces/innerkits:image_external_config" ] } -config("ans_subscriber_local_live_view_config") { - visibility = [ "./../../*" ] - - include_dirs = [ - "${inner_api_path}", - "${interfaces_path}/kits/native", - "${core_path}/common/include", - "${core_path}/include", - "${target_gen_dir}", - ] - configs = [ "${multimedia_path}/interfaces/innerkits:image_external_config" ] -} - -config("ans_subscriber_config") { - visibility = [ "./../../*" ] - - include_dirs = [ - "${inner_api_path}", - "${interfaces_path}/kits/native", - "${core_path}/common/include", - "${core_path}/include", - "${target_gen_dir}", - ] - configs = [ "${multimedia_path}/interfaces/innerkits:image_external_config" ] -} - ohos_source_set("swing_call_back_proxy") { sanitize = { integer_overflow = true @@ -201,7 +137,13 @@ ohos_shared_library("ans_innerkits") { "${core_path}/src/ans_image_util.cpp", "${core_path}/src/ans_notification.cpp", "${core_path}/src/dialog_status_data.cpp", + "${core_path}/src/listener/ans_operation_callback_proxy.cpp", + "${core_path}/src/listener/ans_operation_callback_stub.cpp", "${core_path}/src/listener/ans_subscriber_listener.cpp", + "${core_path}/src/listener/ans_subscriber_local_live_view_proxy.cpp", + "${core_path}/src/listener/ans_subscriber_local_live_view_stub.cpp", + "${core_path}/src/listener/ans_subscriber_proxy.cpp", + "${core_path}/src/listener/ans_subscriber_stub.cpp", "${core_path}/src/listener/swing_callback_service.cpp", "${core_path}/src/manager/ans_manager_death_recipient.cpp", "${core_path}/src/manager/ans_manager_proxy.cpp", @@ -266,17 +208,12 @@ ohos_shared_library("ans_innerkits") { deps = [ ":ans_dialog_callback_proxy", ":ans_dialog_callback_stub", - ":ans_operation_callback_proxy", - ":ans_operation_callback_stub", - ":ans_subscriber_local_live_view_proxy", - ":ans_subscriber_local_live_view_stub", - ":ans_subscriber_proxy", - ":ans_subscriber_stub", ] external_deps = [ "ability_base:want", "ability_base:zuri", + "ability_runtime:app_context", "ability_runtime:appkit_native", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", @@ -293,6 +230,7 @@ ohos_shared_library("ans_innerkits") { public_external_deps = [ "ability_runtime:wantagent_innerkits", "image_framework:image_native", + "json:nlohmann_json_static", ] if (is_double_framework) { @@ -365,161 +303,3 @@ ohos_source_set("ans_dialog_callback_stub") { subsystem_name = "notification" part_name = "distributed_notification_service" } - -ohos_source_set("ans_operation_callback_proxy") { - sanitize = { - integer_overflow = true - ubsan = true - boundary_sanitize = true - cfi = true - cfi_cross_dso = true - debug = false - } - public_configs = [ ":ans_operation_callback_config" ] - output_values = get_target_outputs(":ans_operation_callback_interface") - sources = filter_include(output_values, [ "*_proxy.cpp" ]) - deps = [ ":ans_operation_callback_interface" ] - external_deps = [ - "c_utils:utils", - "hilog:libhilog", - "ipc:ipc_core", - "samgr:samgr_proxy", - ] - subsystem_name = "notification" - part_name = "distributed_notification_service" -} - -ohos_source_set("ans_operation_callback_stub") { - sanitize = { - integer_overflow = true - ubsan = true - boundary_sanitize = true - cfi = true - cfi_cross_dso = true - debug = false - } - public_configs = [ ":ans_operation_callback_config" ] - output_values = get_target_outputs(":ans_operation_callback_interface") - sources = filter_include(output_values, [ "*_stub.cpp" ]) - deps = [ ":ans_operation_callback_interface" ] - external_deps = [ - "c_utils:utils", - "hilog:libhilog", - "ipc:ipc_core", - "samgr:samgr_proxy", - ] - subsystem_name = "notification" - part_name = "distributed_notification_service" -} - -ohos_source_set("ans_subscriber_local_live_view_proxy") { - sanitize = { - integer_overflow = true - ubsan = true - boundary_sanitize = true - cfi = true - cfi_cross_dso = true - debug = false - } - public_configs = [ ":ans_subscriber_local_live_view_config" ] - output_values = - get_target_outputs(":ans_subscriber_local_live_view_interface") - sources = filter_include(output_values, [ "*_proxy.cpp" ]) - deps = [ ":ans_subscriber_local_live_view_interface" ] - external_deps = [ - "ability_base:want", - "c_utils:utils", - "hilog:libhilog", - "ipc:ipc_core", - "samgr:samgr_proxy", - ] - subsystem_name = "notification" - part_name = "distributed_notification_service" -} - -ohos_source_set("ans_subscriber_local_live_view_stub") { - sanitize = { - integer_overflow = true - ubsan = true - boundary_sanitize = true - cfi = true - cfi_cross_dso = true - debug = false - } - public_configs = [ ":ans_subscriber_local_live_view_config" ] - output_values = - get_target_outputs(":ans_subscriber_local_live_view_interface") - sources = filter_include(output_values, [ "*_stub.cpp" ]) - deps = [ ":ans_subscriber_local_live_view_interface" ] - external_deps = [ - "ability_base:want", - "c_utils:utils", - "hilog:libhilog", - "ipc:ipc_core", - "samgr:samgr_proxy", - ] - subsystem_name = "notification" - part_name = "distributed_notification_service" -} - -ohos_source_set("ans_subscriber_proxy") { - sanitize = { - integer_overflow = true - ubsan = true - boundary_sanitize = true - cfi = true - cfi_cross_dso = true - debug = false - } - public_configs = [ ":ans_subscriber_config" ] - output_values = get_target_outputs(":ans_subscriber_interface") - sources = filter_include(output_values, [ "*_proxy.cpp" ]) - deps = [ ":ans_subscriber_interface" ] - external_deps = [ - "c_utils:utils", - "hicollie:libhicollie", - "hilog:libhilog", - "i18n:intl_util", - "ipc:ipc_core", - "samgr:samgr_proxy", - ] - - public_external_deps = [ - "ability_runtime:wantagent_innerkits", - "image_framework:image_native", - ] - - subsystem_name = "notification" - part_name = "distributed_notification_service" -} - -ohos_source_set("ans_subscriber_stub") { - sanitize = { - integer_overflow = true - ubsan = true - boundary_sanitize = true - cfi = true - cfi_cross_dso = true - debug = false - } - public_configs = [ ":ans_subscriber_config" ] - output_values = get_target_outputs(":ans_subscriber_interface") - sources = filter_include(output_values, [ "*_stub.cpp" ]) - deps = [ ":ans_subscriber_interface" ] - external_deps = [ - "c_utils:utils", - "hicollie:libhicollie", - "hilog:libhilog", - "i18n:intl_util", - "ipc:ipc_core", - "samgr:samgr_proxy", - ] - - public_external_deps = [ - "ability_runtime:wantagent_innerkits", - "image_framework:image_native", - ] - - subsystem_name = "notification" - part_name = "distributed_notification_service" -} diff --git a/frameworks/core/BUILD.gn b/frameworks/core/BUILD.gn index 74a703fdc..c90cde0df 100644 --- a/frameworks/core/BUILD.gn +++ b/frameworks/core/BUILD.gn @@ -72,6 +72,7 @@ ohos_shared_library("ans_core") { external_deps = [ "ability_base:want", "ability_base:zuri", + "ability_runtime:app_context", "ability_runtime:wantagent_innerkits", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", diff --git a/frameworks/core/test/unittest/BUILD.gn b/frameworks/core/test/unittest/BUILD.gn index 1cc7baa08..f8305fd0d 100644 --- a/frameworks/core/test/unittest/BUILD.gn +++ b/frameworks/core/test/unittest/BUILD.gn @@ -23,6 +23,7 @@ group("unittest") { "ans_notification_test:unittest", "ans_subscriber_proxy_branch_test:unittest", "ans_subscriber_proxy_test:unittest", + "ans_subscriber_stub_test:unittest", "swing_callback_test:unittest", ] } diff --git a/frameworks/core/test/unittest/ans_notification_annex_test/BUILD.gn b/frameworks/core/test/unittest/ans_notification_annex_test/BUILD.gn index b77177586..c99fc185a 100644 --- a/frameworks/core/test/unittest/ans_notification_annex_test/BUILD.gn +++ b/frameworks/core/test/unittest/ans_notification_annex_test/BUILD.gn @@ -26,7 +26,6 @@ ohos_unittest("ans_notification_annex_test") { deps = [ "${frameworks_module_ans_path}:ans_innerkits", - "//third_party/googletest:gtest_main", ] external_deps = [ @@ -38,6 +37,7 @@ ohos_unittest("ans_notification_annex_test") { "image_framework:image_native", "ipc:ipc_single", "relational_store:native_rdb", + "googletest:gtest_main", ] subsystem_name = "${subsystem_name}" diff --git a/frameworks/js/napi/BUILD.gn b/frameworks/js/napi/BUILD.gn index 0e776651b..0378bfb06 100644 --- a/frameworks/js/napi/BUILD.gn +++ b/frameworks/js/napi/BUILD.gn @@ -62,12 +62,7 @@ ohos_shared_library("notification") { branch_protector_ret = "pac_ret" include_dirs = [ - "${ability_runtime_path}/interfaces/kits/native/ability/native", - "${ability_runtime_napi_path}/inner/napi_common", "include", - "//third_party/node/src", - "//third_party/libuv/include", - "//third_party/json/single_include", ] configs = [ ":native_module_config" ] @@ -139,6 +134,9 @@ ohos_shared_library("notification") { "napi:ace_napi", "relational_store:native_rdb", "resource_management:global_resmgr", + "json:nlohmann_json_static", + "node:node_header_notice", + "libuv:uv", ] relative_install_dir = "module" diff --git a/frameworks/js/napi/src/manager/BUILD.gn b/frameworks/js/napi/src/manager/BUILD.gn index 817088fd1..3a7e5a31c 100644 --- a/frameworks/js/napi/src/manager/BUILD.gn +++ b/frameworks/js/napi/src/manager/BUILD.gn @@ -47,11 +47,8 @@ ohos_shared_library("notificationmanager") { branch_protector_ret = "pac_ret" include_dirs = [ - "${ability_runtime_path}/interfaces/kits/native/ability/native", - "${ability_runtime_napi_path}/inner/napi_common", "../../include", "../../include/manager", - "//third_party/node/src", ] configs = [ ":native_module_config" ] @@ -122,6 +119,7 @@ ohos_shared_library("notificationmanager") { "ipc:ipc_single", "napi:ace_napi", "relational_store:native_rdb", + "node:node_header_notice", ] defines = [] diff --git a/frameworks/js/napi/src/reminder/BUILD.gn b/frameworks/js/napi/src/reminder/BUILD.gn index a47a16503..edb5a19de 100644 --- a/frameworks/js/napi/src/reminder/BUILD.gn +++ b/frameworks/js/napi/src/reminder/BUILD.gn @@ -39,8 +39,6 @@ ohos_shared_library("reminderagent") { include_dirs = [ "../../include", - "//third_party/node/src", - "//third_party/libuv/include", ] configs = [ ":native_module_config" ] @@ -78,6 +76,8 @@ ohos_shared_library("reminderagent") { "ipc:ipc_single", "napi:ace_napi", "relational_store:native_rdb", + "node:node_header_notice", + "libuv:uv", ] relative_install_dir = "module" @@ -100,8 +100,6 @@ ohos_shared_library("reminderagentmanager") { include_dirs = [ "../../include", "../../include/manager", - "//third_party/node/src", - "//third_party/libuv/include", ] configs = [ ":native_module_config" ] @@ -136,6 +134,8 @@ ohos_shared_library("reminderagentmanager") { "ipc:ipc_single", "napi:ace_napi", "relational_store:native_rdb", + "node:node_header_notice", + "libuv:uv", ] relative_install_dir = "module" diff --git a/frameworks/js/napi/src/subscribe/BUILD.gn b/frameworks/js/napi/src/subscribe/BUILD.gn index e4445a45c..51fa5e3be 100644 --- a/frameworks/js/napi/src/subscribe/BUILD.gn +++ b/frameworks/js/napi/src/subscribe/BUILD.gn @@ -47,12 +47,8 @@ ohos_shared_library("notificationsubscribe") { branch_protector_ret = "pac_ret" include_dirs = [ - "${ability_runtime_path}/interfaces/kits/native/ability/native", - "${ability_runtime_napi_path}/inner/napi_common", "../../include", "../../include/subscribe", - "//third_party/node/src", - "//third_party/libuv/include", ] configs = [ ":native_module_config" ] @@ -90,6 +86,8 @@ ohos_shared_library("notificationsubscribe") { "ipc:ipc_single", "napi:ace_napi", "relational_store:native_rdb", + "node:node_header_notice", + "libuv:uv", ] relative_install_dir = "module" diff --git a/frameworks/reminder/BUILD.gn b/frameworks/reminder/BUILD.gn index cad0d54d8..35f1f04e2 100644 --- a/frameworks/reminder/BUILD.gn +++ b/frameworks/reminder/BUILD.gn @@ -58,8 +58,6 @@ ohos_shared_library("reminder_innerkits") { public_configs = [ ":reminder_innerkits_public_config", "${frameworks_path}/ans:ans_innerkits_config", - "${frameworks_path}/ans:ans_subscriber_local_live_view_config", - "${frameworks_path}/ans:ans_subscriber_config", ] output_values = get_target_outputs(":reminder_service_interface") sources = [ diff --git a/frameworks/test/moduletest/BUILD.gn b/frameworks/test/moduletest/BUILD.gn index 1ed0daf2b..f5e40f5b6 100644 --- a/frameworks/test/moduletest/BUILD.gn +++ b/frameworks/test/moduletest/BUILD.gn @@ -35,7 +35,6 @@ ohos_moduletest("ans_fw_module_test") { "${core_path}/common/include", "${core_path}/include", "${component_path}/services/ans/include", - "//third_party/json/include", "${inner_api_path}", "${core_path}/common/include", "${core_path}/include", @@ -61,7 +60,6 @@ ohos_moduletest("ans_fw_module_test") { deps = [ "${frameworks_module_ans_path}:ans_innerkits", "${services_path}/ans:libans", - "//third_party/googletest:gtest_main", ] defines = [] @@ -88,6 +86,8 @@ ohos_moduletest("ans_fw_module_test") { "relational_store:native_rdb", "safwk:system_ability_fwk", "samgr:samgr_proxy", + "googletest:gtest_main", + "json:nlohmann_json_static", ] subsystem_name = "${subsystem_name}" @@ -112,7 +112,6 @@ ohos_moduletest("ans_innerkits_module_publish_test") { "${core_path}/common/include", "${core_path}/include", "${component_path}/services/ans/include", - "//third_party/json/include", "${inner_api_path}", "${core_path}/common/include", "${core_path}/include", @@ -164,6 +163,7 @@ ohos_moduletest("ans_innerkits_module_publish_test") { "relational_store:native_rdb", "safwk:system_ability_fwk", "samgr:samgr_proxy", + "json:nlohmann_json_static", ] subsystem_name = "${subsystem_name}" @@ -202,7 +202,6 @@ ohos_moduletest("ans_innerkits_module_slot_test") { deps = [ "${frameworks_module_ans_path}:ans_innerkits", "${services_path}/ans:libans", - "//third_party/googletest:gtest_main", ] defines = [] @@ -231,6 +230,8 @@ ohos_moduletest("ans_innerkits_module_slot_test") { "relational_store:native_rdb", "safwk:system_ability_fwk", "samgr:samgr_proxy", + "googletest:gtest_main", + "json:nlohmann_json_static", ] subsystem_name = "${subsystem_name}" @@ -255,7 +256,6 @@ ohos_moduletest("ans_innerkits_module_setting_test") { "${frameworks_path}/ans/core/common/include", "${frameworks_path}/ans/core/include", "${component_path}/services/ans/include", - "//third_party/json/include", "${inner_api_path}", "${core_path}/common/include", "${core_path}/include", @@ -275,7 +275,6 @@ ohos_moduletest("ans_innerkits_module_setting_test") { deps = [ "${frameworks_module_ans_path}:ans_innerkits", "${services_path}/ans:libans", - "//third_party/googletest:gtest_main", ] defines = [] @@ -304,6 +303,8 @@ ohos_moduletest("ans_innerkits_module_setting_test") { "relational_store:native_rdb", "safwk:system_ability_fwk", "samgr:samgr_proxy", + "googletest:gtest_main", + "json:nlohmann_json_static", ] subsystem_name = "${subsystem_name}" diff --git a/notification_ability_runtime.gni b/notification_ability_runtime.gni new file mode 100644 index 000000000..97ca5b6da --- /dev/null +++ b/notification_ability_runtime.gni @@ -0,0 +1,214 @@ +# Copyright (c) 2021-2024 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") + +ability_runtime_path = "//foundation/ability/ability_runtime" +ability_runtime_napi_path = "${ability_runtime_path}/frameworks/js/napi" +ability_base_path = "//foundation/ability/ability_base" +form_fwk_path = "//foundation/ability/form_fwk" +ability_runtime_innerkits_path = "${ability_runtime_path}/interfaces/inner_api" +ability_runtime_ndk_path = "${ability_runtime_path}/interfaces/kits/c" +ability_runtime_native_path = "${ability_runtime_path}/frameworks/native" +ability_runtime_services_path = "${ability_runtime_path}/services" +ability_runtime_abilitymgr_path = "${ability_runtime_services_path}/abilitymgr" +ability_runtime_test_path = "${ability_runtime_path}/test" +ability_runtime_utils_path = "${ability_runtime_path}/utils" +ace_engine_path = "//foundation/arkui/ace_engine" +arkui_path = "//foundation/arkui" +previewer_path = "//ide/tools/previewer" +simulator_path = "//foundation/ability/ability_runtime/frameworks/simulator" + +bundlefwk_path = "//foundation/bundlemanager/bundle_framework" +bundlefwk_inner_api_path = "${bundlefwk_path}/interfaces/inner_api" +c_utils_base_path = "//commonlibrary/c_utils/base" +ets_utils_path = "//commonlibrary/ets_utils" +print_fwk_path = "//base/print/print_fwk" +imf_path = "//base/inputmethod/imf" +wallpaper_mgr_path = "//base/theme/wallpaper_mgr" +os_account_path = "//base/account/os_account" +distributed_notification_service_path = + "//base/notification/distributed_notification_service" +power_manager_path = "//base/powermgr/power_manager" +request_path = "//base/request/request" +hiebpf_path = "//developtools/profiler/hiebpf" + +multimedia_path = "//foundation/multimedia/image_framework" +multimodalinput_path = "//foundation/multimodalinput/input" +windowmanager_path = "//foundation/window/window_manager" +graphic_path = "//foundation/graphic/graphic_2d" +global_path = "//base/global" +distributedschedule_path = "//foundation/systemabilitymgr" +eventhandler_path = "//base/notification/eventhandler" +distributeddatamgr_path = "//foundation/distributeddatamgr" +form_fwk_napi_path = "${form_fwk_path}/frameworks/js/napi" +ability_base_kits_path = "${ability_base_path}/interfaces/kits/native" +ability_base_native_path = "${ability_base_path}/frameworks/native" +appspawn_path = "//base/startup/appspawn" +init_path = "//base/startup/init" +ipc_native_path = "//foundation/communication/ipc/ipc/native" +third_party_path = "//third_party" +hiviewdfx_path = "//base/hiviewdfx/hiview" +hilog_path = "//base/hiviewdfx/hilog" +webview_path = "//base/web/webview" +resource_management_path = "//base/global/resource_management" +common_event_service_path = "//base/notification/common_event_service" +safwk_path = "//utils/system/safwk" +user_file_service_innerkits_path = + "//foundation/filemanagement/user_file_service/interfaces/inner_api" +resourceschedule_path = "//foundation/resourceschedule" +device_usage_statistics_path = + "//foundation/resourceschedule/device_usage_statistics" +device_manager_path = "//foundation/distributedhardware/device_manager" +graphic_2d_path = "//foundation/graphic/graphic_2d" +srms_inner_api_path = + "${ability_runtime_path}/service_router_framework/interfaces/inner_api" +fuzz_test_output_path = "ability_runtime/ability_runtime" +accessibility_path = "//foundation/barrierfree/accessibility" +relational_store_base_path = "//foundation/distributeddatamgr/relational_store" +relational_store_napi_path = "${relational_store_base_path}/frameworks/js/napi" +common_tool_path = "//foundation/distributeddatamgr/kv_store/frameworks/common" +relational_store_common_path = "${relational_store_base_path}/frameworks/common" +ability_base_path = "//foundation/ability/ability_base" +ability_base_innerapi_path = "${ability_base_path}/interfaces/inner_api" +relational_store_innerapi_path = + "${relational_store_base_path}/interfaces/inner_api" +bgtaskmgr_root_path = "//foundation/resourceschedule/background_task_mgr" +bgtaskmgr_interfaces_path = "${bgtaskmgr_root_path}/interfaces" +bgtaskmgr_frameworks_path = "${bgtaskmgr_root_path}/frameworks" +os_account_path = "//base/account/os_account" +access_token_path = "//base/security/access_token" + +declare_args() { + background_task_mgr_continuous_task_enable = true + resource_schedule_service_enable = true + ability_runtime_feature_sandboxmanager = false + ability_runtime_power = true + ability_runtime_relational = true + ability_runtime_ces = true + ability_runtime_resource = true + ability_runtime_action_extension = true + ability_runtime_photo_editor_extension = true + ability_runtime_share_extension = true + ability_runtime_ui_service_extension = true + ability_runtime_appspawn = true + ability_runtime_auto_fill = true + ability_runtime_child_process = true + ability_fault_and_exit_test = false + ability_command_for_test = false + ability_runtime_feature_coverage = false + ability_runtime_auto_fill_ability = + "com.ohos.passwordbox/entry/AutoFillAbility" + ability_runtime_smart_auto_fill_ability = + "com.ohos.textautofill/entry/TextAutoFillAbility" + ability_runtime_upms = true + cj_frontend = true + ability_runtime_app_no_response_dialog = false + ability_runtime_app_no_response_bundlename = "com.ohos.taskmanager" + include_app_domain_verify = true + ability_runtime_start_window_options_with_pixelmap = false + ability_runtime_check_internet_permission = false + ability_runtime_media_library_enable = true + + if (!defined(global_parts_info) || + defined(global_parts_info.account_os_account)) { + os_account_part_enabled = true + } else { + os_account_part_enabled = false + } + + if (defined(global_parts_info) && + !defined(global_parts_info.resourceschedule_background_task_mgr)) { + background_task_mgr_continuous_task_enable = false + } + + if (defined(global_parts_info) && + !defined(global_parts_info.resourceschedule_resource_schedule_service)) { + resource_schedule_service_enable = false + } + + if (defined(global_parts_info) && + !defined(global_parts_info.powermgr_power_manager)) { + ability_runtime_power = false + } + + if (defined(global_parts_info) && + !defined(global_parts_info.distributeddatamgr_relational_store)) { + ability_runtime_relational = false + } + + if (defined(global_parts_info) && + !defined(global_parts_info.notification_common_event_service)) { + ability_runtime_ces = false + } + + if (defined(global_parts_info) && + !defined(global_parts_info.global_resource_management)) { + ability_runtime_resource = false + } + + if (defined(global_parts_info) && + !defined(global_parts_info.startup_appspawn)) { + ability_runtime_appspawn = false + } + + if (!defined(global_parts_info) || + defined(global_parts_info.security_dlp_permission_service)) { + os_dlp_part_enabled = true + } else { + os_dlp_part_enabled = false + } + + if (!defined(global_parts_info) || + defined(global_parts_info.barrierfree_accessibility)) { + accessibility_enable = true + } else { + accessibility_enable = false + } + + if (!defined(global_parts_info) || + defined(global_parts_info.hiviewdfx_hichecker)) { + hichecker_enabled = true + } else { + hichecker_enabled = false + } + + if (defined(global_parts_info) && + !defined(global_parts_info.bundlemanager_app_domain_verify)) { + include_app_domain_verify = false + } + + if (!defined(global_parts_info) || + defined(global_parts_info.ability_form_fwk)) { + form_fwk_enable = true + } else { + form_fwk_enable = false + } + + if (defined(global_parts_info) && + defined(global_parts_info.accesscontrol_sandbox_manager)) { + ability_runtime_feature_sandboxmanager = true + } + + if (defined(global_parts_info) && + defined(global_parts_info.hiviewdfx_hicollie)) { + app_mgr_service_hicollie_enable = true + } else { + app_mgr_service_hicollie_enable = false + } + + if (defined(global_parts_info) && + !defined(global_parts_info.multimedia_media_library)) { + ability_runtime_media_library_enable = false + } +} \ No newline at end of file diff --git a/services/ans/BUILD.gn b/services/ans/BUILD.gn index d0071feac..39dc53f6a 100644 --- a/services/ans/BUILD.gn +++ b/services/ans/BUILD.gn @@ -56,6 +56,7 @@ ohos_source_set("ans_service_sources") { "${services_path}/ans/include/notification_extension", "${services_path}/ans/include/utils", "${services_path}/ans/include/slot_manager", + "${services_path}/ans/src", ] defines = [] @@ -84,7 +85,6 @@ ohos_source_set("ans_service_sources") { "src/ans_manager_stub.cpp", "src/ans_manager_stub_invalid.cpp", "src/bundle_manager_helper.cpp", - "src/clone/dh_notification_clone_bundle_service.cpp", "src/clone/notification_clone_bundle_info.cpp", "src/clone/notification_clone_bundle_service.cpp", "src/clone/notification_clone_disturb_service.cpp", @@ -298,8 +298,6 @@ ohos_shared_library("libans") { "../ans:ans.para", "../ans:ans.para.dac", "../ans:external.json", - "//third_party/icu/icu4c:shared_icuuc", - "//third_party/libxml2:libxml2", ] if (distributed_notification_supported) { @@ -335,6 +333,8 @@ ohos_shared_library("libans") { "relational_store:native_rdb", "resource_management:global_resmgr", "time_service:time_client", + "icu4c:shared_icuuc", + "libxml2:libxml2", ] external_deps += component_external_deps diff --git a/services/ans/src/advanced_notification_publish/live_publish_process.cpp b/services/ans/src/advanced_notification_publish/live_publish_process.cpp index 35dda3e3f..35487d304 100644 --- a/services/ans/src/advanced_notification_publish/live_publish_process.cpp +++ b/services/ans/src/advanced_notification_publish/live_publish_process.cpp @@ -24,7 +24,7 @@ #include "notification_live_view_content.h" #include "os_account_manager_helper.h" -#include "../advanced_notification_inline.cpp" +#include "advanced_notification_inline.cpp" namespace OHOS { namespace Notification { diff --git a/services/ans/src/disturb_manager/add_do_not_disturb_profiles.cpp b/services/ans/src/disturb_manager/add_do_not_disturb_profiles.cpp index daf9d1054..feef26117 100644 --- a/services/ans/src/disturb_manager/add_do_not_disturb_profiles.cpp +++ b/services/ans/src/disturb_manager/add_do_not_disturb_profiles.cpp @@ -23,7 +23,7 @@ #include "notification_preferences.h" #include "os_account_manager_helper.h" -#include "../advanced_notification_inline.cpp" +#include "advanced_notification_inline.cpp" namespace OHOS { namespace Notification { ErrCode DisturbManager::HandleAddDoNotDisturbProfiles(MessageParcel &data, MessageParcel &reply) diff --git a/services/ans/src/disturb_manager/get_do_not_disturb_date.cpp b/services/ans/src/disturb_manager/get_do_not_disturb_date.cpp index f803bb07f..286584514 100644 --- a/services/ans/src/disturb_manager/get_do_not_disturb_date.cpp +++ b/services/ans/src/disturb_manager/get_do_not_disturb_date.cpp @@ -23,7 +23,7 @@ #include "notification_preferences.h" #include "os_account_manager_helper.h" -#include "../advanced_notification_inline.cpp" +#include "advanced_notification_inline.cpp" namespace OHOS { namespace Notification { ErrCode DisturbManager::HandleGetDoNotDisturbDate(MessageParcel &data, MessageParcel &reply) diff --git a/services/ans/src/disturb_manager/get_do_not_disturb_profile.cpp b/services/ans/src/disturb_manager/get_do_not_disturb_profile.cpp index 365271f6a..68c9d3438 100644 --- a/services/ans/src/disturb_manager/get_do_not_disturb_profile.cpp +++ b/services/ans/src/disturb_manager/get_do_not_disturb_profile.cpp @@ -23,7 +23,7 @@ #include "notification_preferences.h" #include "os_account_manager_helper.h" -#include "../advanced_notification_inline.cpp" +#include "advanced_notification_inline.cpp" namespace OHOS { namespace Notification { ErrCode DisturbManager::HandleGetDoNotDisturbProfile(MessageParcel &data, MessageParcel &reply) diff --git a/services/ans/src/disturb_manager/set_do_not_disturb_date.cpp b/services/ans/src/disturb_manager/set_do_not_disturb_date.cpp index 52b42d0b4..50f300666 100644 --- a/services/ans/src/disturb_manager/set_do_not_disturb_date.cpp +++ b/services/ans/src/disturb_manager/set_do_not_disturb_date.cpp @@ -23,7 +23,7 @@ #include "notification_preferences.h" #include "os_account_manager_helper.h" -#include "../advanced_notification_inline.cpp" +#include "advanced_notification_inline.cpp" namespace OHOS { namespace Notification { diff --git a/services/ans/src/slot_manager/AddSlots.cpp b/services/ans/src/slot_manager/AddSlots.cpp index 4809b484b..8ce65c814 100644 --- a/services/ans/src/slot_manager/AddSlots.cpp +++ b/services/ans/src/slot_manager/AddSlots.cpp @@ -33,7 +33,7 @@ #include "smart_reminder_center.h" #endif -#include "../advanced_notification_inline.cpp" +#include "advanced_notification_inline.cpp" #include "notification_extension_wrapper.h" #include "notification_analytics_util.h" diff --git a/services/ans/src/slot_manager/setNotificationEnableSlot.cpp b/services/ans/src/slot_manager/setNotificationEnableSlot.cpp index 6be51fc49..b85cdbe07 100644 --- a/services/ans/src/slot_manager/setNotificationEnableSlot.cpp +++ b/services/ans/src/slot_manager/setNotificationEnableSlot.cpp @@ -35,7 +35,7 @@ #include "smart_reminder_center.h" #endif -#include "../advanced_notification_inline.cpp" +#include "advanced_notification_inline.cpp" #include "notification_extension_wrapper.h" #include "notification_analytics_util.h" #include "event_report.h" diff --git a/services/ans/test/unittest/BUILD.gn b/services/ans/test/unittest/BUILD.gn index 98b6024e1..1578da9f2 100644 --- a/services/ans/test/unittest/BUILD.gn +++ b/services/ans/test/unittest/BUILD.gn @@ -54,8 +54,6 @@ ohos_unittest("ans_unit_test") { deps = [ "${frameworks_module_ans_path}:ans_innerkits", "${services_path}/ans:libans", - "//third_party/googletest:gmock_main", - "//third_party/googletest:gtest_main", ] if (distributed_notification_supported) { @@ -94,6 +92,8 @@ ohos_unittest("ans_unit_test") { "safwk:system_ability_fwk", "samgr:samgr_proxy", "time_service:time_client", + "googletest:gmock_main", + "googletest:gtest_main", ] if (device_usage) { @@ -146,8 +146,6 @@ ohos_unittest("notification_preferences_database_test") { deps = [ "${frameworks_module_ans_path}:ans_innerkits", "${services_path}/ans:libans", - "//third_party/googletest:gmock_main", - "//third_party/googletest:gtest_main", ] if (distributed_notification_supported) { @@ -181,6 +179,8 @@ ohos_unittest("notification_preferences_database_test") { "safwk:system_ability_fwk", "samgr:samgr_proxy", "time_service:time_client", + "googletest:gmock_main", + "googletest:gtest_main", ] if (device_usage) { @@ -235,8 +235,6 @@ ohos_unittest("notification_subscriber_manager_test") { deps = [ "${frameworks_module_ans_path}:ans_innerkits", "${services_path}/ans:libans", - "//third_party/googletest:gmock_main", - "//third_party/googletest:gtest_main", ] if (distributed_notification_supported) { @@ -270,6 +268,8 @@ ohos_unittest("notification_subscriber_manager_test") { "safwk:system_ability_fwk", "samgr:samgr_proxy", "time_service:time_client", + "googletest:gmock_main", + "googletest:gtest_main", ] if (device_usage) { @@ -335,7 +335,6 @@ ohos_unittest("notification_service_test") { deps = [ "${frameworks_module_ans_path}:ans_innerkits", "${services_path}/ans:libans", - "//third_party/googletest:gtest_main", ] if (distributed_notification_supported) { @@ -370,6 +369,7 @@ ohos_unittest("notification_service_test") { "safwk:system_ability_fwk", "samgr:samgr_proxy", "time_service:time_client", + "googletest:gtest_main", ] if (device_usage) { @@ -432,7 +432,6 @@ ohos_unittest("notification_publish_service_test") { deps = [ "${frameworks_module_ans_path}:ans_innerkits", "${services_path}/ans:libans", - "//third_party/googletest:gtest_main", ] if (distributed_notification_supported) { @@ -469,6 +468,7 @@ ohos_unittest("notification_publish_service_test") { "safwk:system_ability_fwk", "samgr:samgr_proxy", "time_service:time_client", + "googletest:gtest_main", ] if (device_usage) { @@ -529,7 +529,6 @@ ohos_unittest("notification_service_publish_test") { deps = [ "${frameworks_module_ans_path}:ans_innerkits", "${services_path}/ans:libans", - "//third_party/googletest:gtest_main", ] if (distributed_notification_supported) { @@ -564,6 +563,7 @@ ohos_unittest("notification_service_publish_test") { "safwk:system_ability_fwk", "samgr:samgr_proxy", "time_service:time_client", + "googletest:gtest_main", ] if (device_usage) { @@ -617,7 +617,6 @@ ohos_unittest("notification_preferences_test") { deps = [ "${frameworks_module_ans_path}:ans_innerkits", "${services_path}/ans:libans", - "//third_party/googletest:gtest_main", ] if (distributed_notification_supported) { @@ -653,6 +652,7 @@ ohos_unittest("notification_preferences_test") { "safwk:system_ability_fwk", "samgr:samgr_proxy", "time_service:time_client", + "googletest:gtest_main", ] if (device_usage) { @@ -746,7 +746,6 @@ ohos_unittest("bundle_manager_helper_branch_test") { deps = [ "${frameworks_module_ans_path}:ans_innerkits", "${services_path}/ans:libans", - "//third_party/googletest:gtest_main", ] external_deps = [ @@ -772,6 +771,7 @@ ohos_unittest("bundle_manager_helper_branch_test") { "safwk:system_ability_fwk", "samgr:samgr_proxy", "time_service:time_client", + "googletest:gtest_main", ] if (player_framework) { @@ -792,7 +792,6 @@ ohos_unittest("notification_dialog_test") { ] sources = [ - "mock/mock_ability_manager_client.cpp", "notification_dialog_test/mock_os_account_manager_annex.cpp", "notification_dialog_test/notification_dialog_test.cpp", ] @@ -800,13 +799,11 @@ ohos_unittest("notification_dialog_test") { deps = [ "${frameworks_module_ans_path}:ans_innerkits", "${services_path}/ans:libans", - "//third_party/googletest:gtest_main", ] external_deps = [ "ability_base:want", "ability_base:zuri", - "ability_runtime:ability_manager", "ability_runtime:abilitykit_native", "ability_runtime:app_manager", "ability_runtime:wantagent_innerkits", @@ -828,6 +825,7 @@ ohos_unittest("notification_dialog_test") { "safwk:system_ability_fwk", "samgr:samgr_proxy", "time_service:time_client", + "googletest:gtest_main", ] if (player_framework) { @@ -864,7 +862,6 @@ ohos_unittest("notification_subscriber_manager_branch_test") { deps = [ "${frameworks_module_ans_path}:ans_innerkits", "${services_path}/ans:libans", - "//third_party/googletest:gtest_main", ] if (distributed_notification_supported) { @@ -897,6 +894,7 @@ ohos_unittest("notification_subscriber_manager_branch_test") { "safwk:system_ability_fwk", "samgr:samgr_proxy", "time_service:time_client", + "googletest:gtest_main", ] if (player_framework) { @@ -1005,8 +1003,6 @@ ohos_unittest("notification_preferences_database_branch_test") { deps = [ "${frameworks_module_ans_path}:ans_innerkits", - "//third_party/googletest:gtest_main", - "//third_party/libxml2:libxml2", ] external_deps = [ @@ -1033,6 +1029,8 @@ ohos_unittest("notification_preferences_database_branch_test") { "safwk:system_ability_fwk", "samgr:samgr_proxy", "time_service:time_client", + "googletest:gtest_main", + "libxml2:libxml2", ] if (player_framework) { @@ -1056,7 +1054,6 @@ ohos_unittest("push_callback_stub_test") { deps = [ "${frameworks_module_ans_path}:ans_innerkits", "${services_path}/ans:libans", - "//third_party/googletest:gtest_main", ] external_deps = [ @@ -1082,6 +1079,7 @@ ohos_unittest("push_callback_stub_test") { "safwk:system_ability_fwk", "samgr:samgr_proxy", "time_service:time_client", + "googletest:gtest_main", ] if (player_framework) { @@ -1111,7 +1109,6 @@ ohos_unittest("notification_rdb_data_mgr_test") { deps = [ "${frameworks_module_ans_path}:ans_innerkits", "${services_path}/ans:libans", - "//third_party/googletest:gtest_main", ] external_deps = [ @@ -1137,6 +1134,7 @@ ohos_unittest("notification_rdb_data_mgr_test") { "safwk:system_ability_fwk", "samgr:samgr_proxy", "time_service:time_client", + "googletest:gtest_main", ] if (player_framework) { @@ -1164,8 +1162,6 @@ ohos_unittest("notification_config_parse_test") { deps = [ "${frameworks_module_ans_path}:ans_innerkits", "${services_path}/ans:libans", - "//third_party/googletest:gtest_main", - "//third_party/libxml2:libxml2", ] external_deps = [ @@ -1191,6 +1187,8 @@ ohos_unittest("notification_config_parse_test") { "safwk:system_ability_fwk", "samgr:samgr_proxy", "time_service:time_client", + "googletest:gtest_main", + "libxml2:libxml2", ] if (player_framework) { @@ -1323,10 +1321,8 @@ ohos_unittest("advanced_datashare_observer_unit_test") { ] sources = [ - "advanced_datashare_helper_test.cpp", "advanced_datashare_observer_test.cpp", "bundle_manager_helper_branch_test/mock_service_registry.cpp", - "mock/mock_datashare.cpp", ] deps = [ @@ -1417,7 +1413,6 @@ ohos_unittest("advanced_notification_service_unit_test") { sources = [ "${test_path}/mock/mock_tokenid_kit.cpp", "advanced_notification_service_test/advanced_notification_service_unit_test.cpp", - "distributed_device_status_test.cpp", "mock/mock_accesstoken_kit.cpp", "mock/mock_bundle_mgr.cpp", "mock/mock_datashare.cpp", @@ -1446,8 +1441,6 @@ ohos_unittest("advanced_notification_service_unit_test") { external_deps = [ "ability_base:zuri", "access_token:libaccesstoken_sdk", - "bundle_framework:appexecfwk_base", - "bundle_framework:appexecfwk_core", "c_utils:utils", "data_share:datashare_common", "data_share:datashare_consumer", @@ -1461,45 +1454,6 @@ ohos_unittest("advanced_notification_service_unit_test") { part_name = "${component_name}" } -ohos_unittest("common_utils_test") { - sanitize = { - integer_overflow = true - ubsan = true - boundary_sanitize = true - cfi = true - cfi_cross_dso = true - debug = false - } - - module_out_path = module_output_path - - include_dirs = [ - ".", - "mock/include", - "/${services_path}/ans/include", - ] - - sources = [ - "common_utils/notification_analytics_util_test.cpp", - "mock/mock_common_event_manager.cpp", - ] - - defines = [] - - deps = [ - "${frameworks_module_ans_path}:ans_innerkits", - "${services_path}/ans:libans", - ] - - external_deps = [ - "ability_base:zuri", - "c_utils:utils", - ] - - subsystem_name = "${subsystem_name}" - part_name = "${component_name}" -} - group("unittest") { testonly = true deps = [ @@ -1509,7 +1463,6 @@ group("unittest") { ":advanced_notification_service_unit_test", ":ans_unit_test", ":bundle_manager_helper_branch_test", - ":common_utils_test", ":disturb_manager_unit_test", ":notification_config_parse_test", ":notification_dialog_test", diff --git a/services/distributed/test/unittest/BUILD.gn b/services/distributed/test/unittest/BUILD.gn index 2a8670fa1..b9182c51c 100644 --- a/services/distributed/test/unittest/BUILD.gn +++ b/services/distributed/test/unittest/BUILD.gn @@ -70,7 +70,6 @@ ohos_unittest("ans_distributed_unit_test") { deps = [ "${frameworks_module_ans_path}:ans_innerkits", - "//third_party/googletest:gtest_main", ] external_deps = [ @@ -88,6 +87,7 @@ ohos_unittest("ans_distributed_unit_test") { "image_framework:image_native", "ipc:ipc_core", "kv_store:distributeddata_inner", + "googletest:gtest_main", ] subsystem_name = "${subsystem_name}" @@ -116,7 +116,6 @@ ohos_unittest("distributed_preferences_database_test") { deps = [ "${frameworks_module_ans_path}:ans_innerkits", "${services_path}/distributed:libans_distributed", - "//third_party/googletest:gtest_main", ] external_deps = [ @@ -133,6 +132,7 @@ ohos_unittest("distributed_preferences_database_test") { "image_framework:image_native", "ipc:ipc_core", "kv_store:distributeddata_inner", + "googletest:gtest_main", ] subsystem_name = "${subsystem_name}" @@ -162,7 +162,6 @@ ohos_unittest("distributed_screen_status_manager_branch_test") { deps = [ "${frameworks_module_ans_path}:ans_innerkits", "${services_path}/distributed:libans_distributed", - "//third_party/googletest:gtest_main", ] external_deps = [ @@ -179,6 +178,7 @@ ohos_unittest("distributed_screen_status_manager_branch_test") { "image_framework:image_native", "ipc:ipc_core", "kv_store:distributeddata_inner", + "googletest:gtest_main", ] subsystem_name = "${subsystem_name}" @@ -208,7 +208,6 @@ ohos_unittest("distributed_database_branch_test") { deps = [ "${frameworks_module_ans_path}:ans_innerkits", "${services_path}/distributed:libans_distributed", - "//third_party/googletest:gtest_main", ] external_deps = [ @@ -225,6 +224,7 @@ ohos_unittest("distributed_database_branch_test") { "image_framework:image_native", "ipc:ipc_core", "kv_store:distributeddata_inner", + "googletest:gtest_main", ] subsystem_name = "${subsystem_name}" @@ -248,7 +248,6 @@ ohos_unittest("distributed_preferences_branch_test") { deps = [ "${frameworks_module_ans_path}:ans_innerkits", "${services_path}/distributed:libans_distributed", - "//third_party/googletest:gtest_main", ] external_deps = [ @@ -265,6 +264,7 @@ ohos_unittest("distributed_preferences_branch_test") { "image_framework:image_native", "ipc:ipc_core", "kv_store:distributeddata_inner", + "googletest:gtest_main", ] subsystem_name = "${subsystem_name}" @@ -285,7 +285,6 @@ ohos_unittest("distributed_device_callback_test") { deps = [ "${frameworks_module_ans_path}:ans_innerkits", "${services_path}/distributed:libans_distributed", - "//third_party/googletest:gtest_main", ] external_deps = [ @@ -302,6 +301,7 @@ ohos_unittest("distributed_device_callback_test") { "image_framework:image_native", "ipc:ipc_core", "kv_store:distributeddata_inner", + "googletest:gtest_main", ] subsystem_name = "${subsystem_name}" @@ -322,7 +322,6 @@ ohos_unittest("distributed_database_callback_test") { deps = [ "${frameworks_module_ans_path}:ans_innerkits", "${services_path}/distributed:libans_distributed", - "//third_party/googletest:gtest_main", ] external_deps = [ @@ -338,6 +337,7 @@ ohos_unittest("distributed_database_callback_test") { "image_framework:image_native", "ipc:ipc_core", "kv_store:distributeddata_inner", + "googletest:gtest_main", ] subsystem_name = "${subsystem_name}" @@ -358,7 +358,6 @@ ohos_unittest("distributed_flow_control_test") { deps = [ "${frameworks_module_ans_path}:ans_innerkits", "${services_path}/distributed:libans_distributed", - "//third_party/googletest:gtest_main", ] external_deps = [ @@ -374,6 +373,7 @@ ohos_unittest("distributed_flow_control_test") { "image_framework:image_native", "ipc:ipc_core", "kv_store:distributeddata_inner", + "googletest:gtest_main", ] subsystem_name = "${subsystem_name}" @@ -397,7 +397,6 @@ ohos_unittest("distributed_notification_manager_branch_test") { deps = [ "${frameworks_module_ans_path}:ans_innerkits", "${services_path}/distributed:libans_distributed", - "//third_party/googletest:gtest_main", ] external_deps = [ @@ -415,6 +414,7 @@ ohos_unittest("distributed_notification_manager_branch_test") { "image_framework:image_native", "ipc:ipc_core", "kv_store:distributeddata_inner", + "googletest:gtest_main", ] subsystem_name = "${subsystem_name}" diff --git a/services/test/moduletest/BUILD.gn b/services/test/moduletest/BUILD.gn index 54cf07a3e..53738ae40 100644 --- a/services/test/moduletest/BUILD.gn +++ b/services/test/moduletest/BUILD.gn @@ -14,7 +14,6 @@ import("//base/notification/distributed_notification_service/notification.gni") import("//build/ohos.gni") import("//build/test.gni") -import("//foundation/ability/ability_runtime/ability_runtime.gni") module_output_path = "${component_name}/distributed_notification_service/moduletest" diff --git a/test/bechmarktest/notification_publish_test/BUILD.gn b/test/bechmarktest/notification_publish_test/BUILD.gn index 7bdf0fc18..42102c44e 100644 --- a/test/bechmarktest/notification_publish_test/BUILD.gn +++ b/test/bechmarktest/notification_publish_test/BUILD.gn @@ -28,8 +28,6 @@ ohos_benchmarktest("Benchmark_Publish_Test") { deps = [ "${frameworks_module_ans_path}:ans_innerkits", - "//third_party/benchmark:benchmark", - "//third_party/googletest:gtest_main", ] external_deps = [ @@ -39,6 +37,8 @@ ohos_benchmarktest("Benchmark_Publish_Test") { "c_utils:utils", "image_framework:image_native", "relational_store:native_rdb", + "googletest:gtest_main", + "benchmark:benchmark", ] subsystem_name = "${subsystem_name}" part_name = "${component_name}" diff --git a/test/bechmarktest/notification_services_test/BUILD.gn b/test/bechmarktest/notification_services_test/BUILD.gn index d6d5d4305..f69536d5e 100644 --- a/test/bechmarktest/notification_services_test/BUILD.gn +++ b/test/bechmarktest/notification_services_test/BUILD.gn @@ -22,9 +22,6 @@ ohos_benchmarktest("Benchmark_Notification_Servece_Test") { include_dirs = [ "include", "mock/include", - "${access_token_path}/interfaces/innerkits/token_setproc/include", - "${access_token_path}/interfaces/innerkits/nativetoken/include", - "${access_token_path}/interfaces/innerkits/accesstoken/include", "${services_path}/ans/include", ] @@ -37,8 +34,6 @@ ohos_benchmarktest("Benchmark_Notification_Servece_Test") { deps = [ "${frameworks_module_ans_path}:ans_innerkits", "${services_path}/ans:libans", - "//third_party/benchmark:benchmark", - "//third_party/googletest:gtest_main", ] external_deps = [ @@ -55,6 +50,8 @@ ohos_benchmarktest("Benchmark_Notification_Servece_Test") { "image_framework:image_native", "kv_store:distributeddata_inner", "relational_store:native_rdb", + "benchmark:benchmark", + "googletest:gtest_main", ] subsystem_name = "${subsystem_name}" part_name = "${component_name}" diff --git a/test/fuzztest/advancednotificationservice_fuzzer/BUILD.gn b/test/fuzztest/advancednotificationservice_fuzzer/BUILD.gn index 93162dca8..2675a7580 100644 --- a/test/fuzztest/advancednotificationservice_fuzzer/BUILD.gn +++ b/test/fuzztest/advancednotificationservice_fuzzer/BUILD.gn @@ -38,8 +38,6 @@ ohos_fuzztest("AdvancedNotificationServiceFuzzTest") { "${component_path}/test/fuzztest/fuzz_common_base:fuzz_common_base", "${frameworks_module_ans_path}:ans_innerkits", "${services_path}/ans:ans_service_sources", - "//third_party/icu/icu4c:shared_icuuc", - "//third_party/libxml2:libxml2", ] if (is_double_framework) { @@ -86,6 +84,8 @@ ohos_fuzztest("AdvancedNotificationServiceFuzzTest") { "relational_store:native_rdb", "resource_management:global_resmgr", "time_service:time_client", + "icu4c:shared_icuuc", + "libxml2:libxml2", ] external_deps += component_external_deps diff --git a/test/fuzztest/ansmanagerstub_fuzzer/BUILD.gn b/test/fuzztest/ansmanagerstub_fuzzer/BUILD.gn index 1651358c2..031cf9576 100644 --- a/test/fuzztest/ansmanagerstub_fuzzer/BUILD.gn +++ b/test/fuzztest/ansmanagerstub_fuzzer/BUILD.gn @@ -38,8 +38,6 @@ ohos_fuzztest("AnsManagerStubFuzzTest") { "${component_path}/test/fuzztest/fuzz_common_base:fuzz_common_base", "${frameworks_module_ans_path}:ans_innerkits", "${services_path}/ans:ans_service_sources", - "//third_party/icu/icu4c:shared_icuuc", - "//third_party/libxml2:libxml2", ] if (distributed_notification_supported) { @@ -82,6 +80,8 @@ ohos_fuzztest("AnsManagerStubFuzzTest") { "relational_store:native_rdb", "resource_management:global_resmgr", "time_service:time_client", + "icu4c:shared_icuuc", + "libxml2:libxml2", ] external_deps += component_external_deps diff --git a/test/fuzztest/ansmanagerstubannex_fuzzer/BUILD.gn b/test/fuzztest/ansmanagerstubannex_fuzzer/BUILD.gn index 3e37b0feb..57e9b5e8f 100644 --- a/test/fuzztest/ansmanagerstubannex_fuzzer/BUILD.gn +++ b/test/fuzztest/ansmanagerstubannex_fuzzer/BUILD.gn @@ -39,8 +39,6 @@ ohos_fuzztest("AnsManagerStubAnnexFuzzTest") { "${component_path}/test/fuzztest/fuzz_common_base:fuzz_common_base", "${frameworks_module_ans_path}:ans_innerkits", "${services_path}/ans:ans_service_sources", - "//third_party/icu/icu4c:shared_icuuc", - "//third_party/libxml2:libxml2", ] if (distributed_notification_supported) { @@ -83,6 +81,8 @@ ohos_fuzztest("AnsManagerStubAnnexFuzzTest") { "relational_store:native_rdb", "resource_management:global_resmgr", "time_service:time_client", + "icu4c:shared_icuuc", + "libxml2:libxml2", ] external_deps += component_external_deps diff --git a/test/fuzztest/fuzz_common_base/BUILD.gn b/test/fuzztest/fuzz_common_base/BUILD.gn index 6bba7888b..efa9e87c3 100644 --- a/test/fuzztest/fuzz_common_base/BUILD.gn +++ b/test/fuzztest/fuzz_common_base/BUILD.gn @@ -33,4 +33,8 @@ static_library("fuzz_common_base") { "access_token:libnativetoken", "access_token:libtoken_setproc", ] + + public_external_deps = [ + "base:utils", + ] } diff --git a/tools/test/unittest/dump/BUILD.gn b/tools/test/unittest/dump/BUILD.gn index c9315d57b..21e1764f5 100644 --- a/tools/test/unittest/dump/BUILD.gn +++ b/tools/test/unittest/dump/BUILD.gn @@ -19,7 +19,6 @@ module_output_path = config("tools_dump_config_mock") { include_dirs = [ - "//third_party/googletest/googlemock/include", "${tools_path}/test/mock", "${component_path}/services/ans/include", ] @@ -62,8 +61,6 @@ ohos_unittest("notification_shell_command_dump_test") { deps = [ "${frameworks_module_ans_path}:ans_innerkits", "${services_path}/ans:ans_service_sources", - "//third_party/googletest:gmock_main", - "//third_party/googletest:gtest_main", ] external_deps = [ @@ -78,6 +75,8 @@ ohos_unittest("notification_shell_command_dump_test") { "hilog:libhilog", "ipc:ipc_core", "relational_store:native_rdb", + "googletest:gmock_main", + "googletest:gtest_main", ] } -- Gitee