From 575d1c51f080157d5a9cb200a2f9726f533a3757 Mon Sep 17 00:00:00 2001 From: zhangqiang Date: Thu, 6 Apr 2023 21:14:29 +0800 Subject: [PATCH 1/3] =?UTF-8?q?IssueNo:=20cellular=5Fdata=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E4=BE=9D=E8=B5=96=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Description: cellular_data部件间依赖解耦,清理不合理依赖 Sig: SIG_Telephony Feature or Bugfix: Feature Binary Source: No Signed-off-by: zhangqiang Change-Id: I5bf09519d85347b16accb123e6cd59ccccbfaa7e --- BUILD.gn | 99 +++++++++---------- bundle.json | 3 +- cellular_data_ability_runtime.gni | 16 --- frameworks/js/BUILD.gn | 17 +--- frameworks/native/BUILD.gn | 10 +- test/BUILD.gn | 26 ++--- .../getcellulardatastate_fuzzer/BUILD.gn | 26 +++-- .../updateactivemachine_fuzzer/BUILD.gn | 28 +++--- .../updatedisconnectmachine_fuzzer/BUILD.gn | 27 +++-- .../updateinactivemachine_fuzzer/BUILD.gn | 27 +++-- test/unit_test/BUILD.gn | 12 +-- 11 files changed, 115 insertions(+), 176 deletions(-) delete mode 100644 cellular_data_ability_runtime.gni diff --git a/BUILD.gn b/BUILD.gn index 0d635561..e56b6596 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -10,74 +10,62 @@ # 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("//base/telephony/cellular_data/cellular_data_ability_runtime.gni") -import("//base/telephony/core_service/telephony.gni") import("//build/ohos.gni") -SOURCE_DIR = "//base/telephony/cellular_data" - ohos_shared_library("tel_cellular_data") { sources = [ - "$SOURCE_DIR/services/src/apn_manager/apn_holder.cpp", - "$SOURCE_DIR/services/src/apn_manager/apn_item.cpp", - "$SOURCE_DIR/services/src/apn_manager/apn_manager.cpp", - "$SOURCE_DIR/services/src/apn_manager/connection_retry_policy.cpp", - "$SOURCE_DIR/services/src/cellular_data_controller.cpp", - "$SOURCE_DIR/services/src/cellular_data_handler.cpp", - "$SOURCE_DIR/services/src/cellular_data_rdb_observer.cpp", - "$SOURCE_DIR/services/src/cellular_data_roaming_observer.cpp", - "$SOURCE_DIR/services/src/cellular_data_service.cpp", - "$SOURCE_DIR/services/src/cellular_data_service_stub.cpp", - "$SOURCE_DIR/services/src/cellular_data_setting_observer.cpp", - "$SOURCE_DIR/services/src/data_connection_manager.cpp", - "$SOURCE_DIR/services/src/data_connection_monitor.cpp", - "$SOURCE_DIR/services/src/data_switch_settings.cpp", - "$SOURCE_DIR/services/src/sim_account_callback_proxy.cpp", - "$SOURCE_DIR/services/src/state_machine/activating.cpp", - "$SOURCE_DIR/services/src/state_machine/active.cpp", - "$SOURCE_DIR/services/src/state_machine/cellular_data_state_machine.cpp", - "$SOURCE_DIR/services/src/state_machine/default.cpp", - "$SOURCE_DIR/services/src/state_machine/disconnecting.cpp", - "$SOURCE_DIR/services/src/state_machine/inactive.cpp", - "$SOURCE_DIR/services/src/state_notification.cpp", - "$SOURCE_DIR/services/src/traffic_management.cpp", - "$SOURCE_DIR/services/src/utils/cellular_data_dump_helper.cpp", - "$SOURCE_DIR/services/src/utils/cellular_data_hisysevent.cpp", - "$SOURCE_DIR/services/src/utils/cellular_data_net_agent.cpp", - "$SOURCE_DIR/services/src/utils/cellular_data_rdb_helper.cpp", - "$SOURCE_DIR/services/src/utils/cellular_data_settings_rdb_helper.cpp", - "$SOURCE_DIR/services/src/utils/cellular_data_utils.cpp", - "$SOURCE_DIR/services/src/utils/net_manager_call_back.cpp", - "$SOURCE_DIR/services/src/utils/net_manager_tactics_call_back.cpp", - "$SOURCE_DIR/services/src/utils/network_search_callback.cpp", + "services/src/apn_manager/apn_holder.cpp", + "services/src/apn_manager/apn_item.cpp", + "services/src/apn_manager/apn_manager.cpp", + "services/src/apn_manager/connection_retry_policy.cpp", + "services/src/cellular_data_controller.cpp", + "services/src/cellular_data_handler.cpp", + "services/src/cellular_data_rdb_observer.cpp", + "services/src/cellular_data_roaming_observer.cpp", + "services/src/cellular_data_service.cpp", + "services/src/cellular_data_service_stub.cpp", + "services/src/cellular_data_setting_observer.cpp", + "services/src/data_connection_manager.cpp", + "services/src/data_connection_monitor.cpp", + "services/src/data_switch_settings.cpp", + "services/src/sim_account_callback_proxy.cpp", + "services/src/state_machine/activating.cpp", + "services/src/state_machine/active.cpp", + "services/src/state_machine/cellular_data_state_machine.cpp", + "services/src/state_machine/default.cpp", + "services/src/state_machine/disconnecting.cpp", + "services/src/state_machine/inactive.cpp", + "services/src/state_notification.cpp", + "services/src/traffic_management.cpp", + "services/src/utils/cellular_data_dump_helper.cpp", + "services/src/utils/cellular_data_hisysevent.cpp", + "services/src/utils/cellular_data_net_agent.cpp", + "services/src/utils/cellular_data_rdb_helper.cpp", + "services/src/utils/cellular_data_settings_rdb_helper.cpp", + "services/src/utils/cellular_data_utils.cpp", + "services/src/utils/net_manager_call_back.cpp", + "services/src/utils/net_manager_tactics_call_back.cpp", + "services/src/utils/network_search_callback.cpp", ] include_dirs = [ - "$SOURCE_DIR/services/include", - "$SOURCE_DIR/services/include/common", - "$SOURCE_DIR/services/include/state_machine", - "$SOURCE_DIR/services/include/utils", - "$SOURCE_DIR/services/include/apn_manager", - "$SOURCE_DIR/interfaces/innerkits", - "//base/telephony/telephony_data/pdp_profile/include", - "${ability_runtime_inner_api_path}/dataobs_manager/include", - ] - - configs = [ "//base/telephony/core_service/utils:telephony_log_config" ] - - deps = [ - "${ability_runtime_inner_api_path}/dataobs_manager:dataobs_manager", - "${ability_runtime_path}/frameworks/native/ability/native:abilitykit_native", - "${ability_runtime_path}/frameworks/native/ability/native:data_ability_helper", - "//base/telephony/core_service/interfaces/innerkits:tel_core_service_api", - "//base/telephony/core_service/utils:libtel_common", + "services/include", + "services/include/common", + "services/include/state_machine", + "services/include/utils", + "services/include/apn_manager", + "interfaces/innerkits", ] external_deps = [ "ability_base:want", "ability_base:zuri", + "ability_runtime:abilitykit_native", + "ability_runtime:data_ability_helper", + "ability_runtime:dataobs_manager", "c_utils:utils", "common_event_service:cesfwk_innerkits", + "core_service:libtel_common", "core_service:tel_core_service_api", "data_share:datashare_common", "data_share:datashare_consumer", @@ -93,8 +81,9 @@ ohos_shared_library("tel_cellular_data") { "relational_store:native_rdb", "safwk:system_ability_fwk", "samgr:samgr_proxy", + "telephony_data:tel_telephony_data", ] - defines += [ + defines = [ "TELEPHONY_LOG_TAG = \"CellularData\"", "LOG_DOMAIN = 0xD001F03", ] diff --git a/bundle.json b/bundle.json index a8ba8038..3cf7708c 100644 --- a/bundle.json +++ b/bundle.json @@ -1,6 +1,6 @@ { "name": "@ohos/cellular_data", - "version": "3.1.0", + "version": "4.0", "description": "telephony cellular data service", "publishAs": "code-segment", "homePage": "https://gitee.com/openharmony", @@ -35,6 +35,7 @@ "c_utils", "common_event_service", "core_service", + "data_share", "eventhandler", "hisysevent_native", "hitrace_native", diff --git a/cellular_data_ability_runtime.gni b/cellular_data_ability_runtime.gni deleted file mode 100644 index 13bd243a..00000000 --- a/cellular_data_ability_runtime.gni +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -ability_runtime_path = "//foundation/ability/ability_runtime" -ability_runtime_inner_api_path = "${ability_runtime_path}/interfaces/inner_api" -ability_runtime_kits_path = "${ability_runtime_path}/frameworks/kits" diff --git a/frameworks/js/BUILD.gn b/frameworks/js/BUILD.gn index 6f7b4544..619e5a24 100644 --- a/frameworks/js/BUILD.gn +++ b/frameworks/js/BUILD.gn @@ -11,30 +11,23 @@ # See the License for the specific language governing permissions and # limitations under the License. import("//build/ohos.gni") -SUBSYSTEM_DIR = "//base/telephony" +SUBSYSTEM_DIR = "../../.." ohos_shared_library("data") { include_dirs = [ "//third_party/node/src", - "include", - "$SUBSYSTEM_DIR/core_service/frameworks/js/napi", - "$SUBSYSTEM_DIR/core_service/interfaces/innerkits/include", - "$SUBSYSTEM_DIR/core_service/utils/log/include", "$SUBSYSTEM_DIR/cellular_data/include/utils", - "$SUBSYSTEM_DIR/core_service/frameworks/js/cellular_data", "$SUBSYSTEM_DIR/cellular_data/frameworks/js/napi/include", ] - sources = [ - "$SUBSYSTEM_DIR/cellular_data/frameworks/js/napi/src/napi_cellular_data.cpp", - "$SUBSYSTEM_DIR/core_service/frameworks/js/napi/napi_util.cpp", - ] - - deps = [ "//foundation/arkui/napi:ace_napi" ] + sources = [ "$SUBSYSTEM_DIR/cellular_data/frameworks/js/napi/src/napi_cellular_data.cpp" ] external_deps = [ "c_utils:utils", "cellular_data:tel_cellular_data_api", + "core_service:libtel_common", + "core_service:tel_core_service_api", "init:libbegetutil", + "napi:ace_napi", ] defines = [ "TELEPHONY_LOG_TAG = \"CellularDataJsApi\"", diff --git a/frameworks/native/BUILD.gn b/frameworks/native/BUILD.gn index 4d831c85..8934749f 100644 --- a/frameworks/native/BUILD.gn +++ b/frameworks/native/BUILD.gn @@ -12,7 +12,7 @@ # limitations under the License. import("//build/ohos.gni") -SUBSYSTEM_DIR = "//base/telephony/cellular_data" +SUBSYSTEM_DIR = "../.." config("cellular_data_util_config") { # header file path include_dirs = [ "$SUBSYSTEM_DIR/interfaces/innerkits" ] @@ -40,16 +40,12 @@ ohos_shared_library("tel_cellular_data_api") { "$SUBSYSTEM_DIR/frameworks/native/sim_account_callback_stub.cpp", ] - configs = [ "//base/telephony/core_service/utils:telephony_log_config" ] - public_configs = [ ":cellular_data_util_config" ] - deps = [ - "//base/telephony/core_service/interfaces/innerkits:tel_core_service_api", - ] - external_deps = [ "c_utils:utils", + "core_service:libtel_common", + "core_service:tel_core_service_api", "hiviewdfx_hilog_native:libhilog", "init:libbegetutil", "ipc:ipc_core", diff --git a/test/BUILD.gn b/test/BUILD.gn index 2a492a4b..adfa7dbf 100644 --- a/test/BUILD.gn +++ b/test/BUILD.gn @@ -10,12 +10,8 @@ # 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("//base/telephony/core_service/telephony.gni") import("//build/test.gni") -SOURCE_DIR = "//base/telephony/cellular_data" -ability_runtime_path = "//foundation/ability/ability_runtime" -ability_runtime_inner_api_path = - "//foundation/ability/ability_runtime/interfaces/inner_api" +SOURCE_DIR = ".." ohos_unittest("tel_cellular_data_test") { subsystem_name = "telephony" @@ -37,25 +33,22 @@ ohos_unittest("tel_cellular_data_test") { "$SOURCE_DIR/services/include/apn_manager", "$SOURCE_DIR/interfaces/innerkits", "$SOURCE_DIR/frameworks/native", - "${ability_runtime_inner_api_path}/dataobs_manager/include", - "//base/telephony/telephony_data/pdp_profile/include", - ] - configs = [ "//base/telephony/core_service/utils:telephony_log_config" ] - deps = [ - "${ability_runtime_inner_api_path}/dataobs_manager:dataobs_manager", - "${ability_runtime_path}/frameworks/native/ability/native:abilitykit_native", - "${ability_runtime_path}/frameworks/native/ability/native:data_ability_helper", - "//base/telephony/cellular_data:tel_cellular_data", - "//base/telephony/core_service/utils:libtel_common", ] + + deps = [ "$SOURCE_DIR:tel_cellular_data" ] + external_deps = [ "ability_base:want", + "ability_runtime:abilitykit_native", + "ability_runtime:data_ability_helper", + "ability_runtime:dataobs_manager", "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "access_token:libtoken_setproc", "c_utils:utils", "cellular_data:tel_cellular_data_api", "common_event_service:cesfwk_innerkits", + "core_service:libtel_common", "core_service:tel_core_service_api", "data_share:datashare_common", "data_share:datashare_consumer", @@ -69,8 +62,9 @@ ohos_unittest("tel_cellular_data_test") { "relational_store:native_rdb", "safwk:system_ability_fwk", "samgr:samgr_proxy", + "telephony_data:tel_telephony_data", ] - defines += [ + defines = [ "TELEPHONY_LOG_TAG = \"CelllularDataTest\"", "LOG_DOMAIN = 0xD000F00", ] diff --git a/test/fuzztest/getcellulardatastate_fuzzer/BUILD.gn b/test/fuzztest/getcellulardatastate_fuzzer/BUILD.gn index bce9e069..b120d2c2 100644 --- a/test/fuzztest/getcellulardatastate_fuzzer/BUILD.gn +++ b/test/fuzztest/getcellulardatastate_fuzzer/BUILD.gn @@ -12,7 +12,6 @@ # limitations under the License. #####################hydra-fuzz################### -import("//base/telephony/core_service/telephony.gni") import("//build/config/features.gni") import("//build/ohos.gni") import("//build/test.gni") @@ -21,21 +20,17 @@ import("//build/test.gni") ohos_fuzztest("GetCellularDataStateFuzzTest") { module_output_path = "cellular_data/GetCellularDataStateFuzzTest" module_out_path = module_output_path - fuzz_config_file = - "//base/telephony/cellular_data/test/fuzztest/getcellulardatastate_fuzzer" + SOURCE_DIR = "../../.." include_dirs = [ - "//base/telephony/cellular_data/services/include", - "//base/telephony/cellular_data/services/include/apn_manager", - "//base/telephony/cellular_data/services/include/common", - "//base/telephony/cellular_data/services/include/state_machine", - "//base/telephony/cellular_data/services/include/utils", - "//base/telephony/cellular_data/test/fuzztest/common_fuzzer", - "//base/telephony/telephony_data/pdp_profile/include", + "$SOURCE_DIR/services/include", + "$SOURCE_DIR/services/include/apn_manager", + "$SOURCE_DIR/services/include/common", + "$SOURCE_DIR/services/include/state_machine", + "$SOURCE_DIR/services/include/utils", + "$SOURCE_DIR/test/fuzztest/common_fuzzer", ] - configs = [ "//base/telephony/core_service/utils:telephony_log_config" ] - - deps = [ "//base/telephony/cellular_data:tel_cellular_data" ] + deps = [ "$SOURCE_DIR:tel_cellular_data" ] external_deps = [ "ability_runtime:ability_manager", @@ -57,9 +52,10 @@ ohos_fuzztest("GetCellularDataStateFuzzTest") { "netmanager_base:net_policy_manager_if", "netmanager_base:net_stats_manager_if", "relational_store:native_rdb", + "telephony_data:tel_telephony_data", ] - defines += [ + defines = [ "TELEPHONY_LOG_TAG = \"CellularDataFuzzTest\"", "LOG_DOMAIN = 0xD000F00", ] @@ -72,7 +68,7 @@ ohos_fuzztest("GetCellularDataStateFuzzTest") { ] sources = [ - "//base/telephony/cellular_data/test/fuzztest/common_fuzzer/adddatatoken_fuzzer.cpp", + "$SOURCE_DIR/test/fuzztest/common_fuzzer/adddatatoken_fuzzer.cpp", "getcellulardatastate_fuzzer.cpp", ] diff --git a/test/fuzztest/updateactivemachine_fuzzer/BUILD.gn b/test/fuzztest/updateactivemachine_fuzzer/BUILD.gn index 4e6edb21..fdf7281f 100644 --- a/test/fuzztest/updateactivemachine_fuzzer/BUILD.gn +++ b/test/fuzztest/updateactivemachine_fuzzer/BUILD.gn @@ -12,7 +12,6 @@ # limitations under the License. #####################hydra-fuzz################### -import("//base/telephony/core_service/telephony.gni") import("//build/config/features.gni") import("//build/ohos.gni") import("//build/test.gni") @@ -21,21 +20,17 @@ import("//build/test.gni") ohos_fuzztest("UpdateActiveMachineFuzzTest") { module_output_path = "cellular_data/UpdateActiveMachineFuzzTest" module_out_path = module_output_path - fuzz_config_file = - "//base/telephony/cellular_data/test/fuzztest/updateactivemachine_fuzzer" + SOURCE_DIR = "../../.." include_dirs = [ - "//base/telephony/cellular_data/services/include", - "//base/telephony/cellular_data/services/include/apn_manager", - "//base/telephony/cellular_data/services/include/common", - "//base/telephony/cellular_data/services/include/state_machine", - "//base/telephony/cellular_data/services/include/utils", - "//base/telephony/cellular_data/test/fuzztest/common_fuzzer", - "//base/telephony/telephony_data/pdp_profile/include", + "$SOURCE_DIR/services/include", + "$SOURCE_DIR/services/include/apn_manager", + "$SOURCE_DIR/services/include/common", + "$SOURCE_DIR/services/include/state_machine", + "$SOURCE_DIR/services/include/utils", + "$SOURCE_DIR/test/fuzztest/common_fuzzer", ] - configs = [ "//base/telephony/core_service/utils:telephony_log_config" ] - - deps = [ "//base/telephony/cellular_data:tel_cellular_data" ] + deps = [ "$SOURCE_DIR:tel_cellular_data" ] external_deps = [ "ability_runtime:ability_manager", @@ -55,9 +50,10 @@ ohos_fuzztest("UpdateActiveMachineFuzzTest") { "netmanager_base:net_policy_manager_if", "netmanager_base:net_stats_manager_if", "relational_store:native_rdb", + "telephony_data:tel_telephony_data", ] - defines += [ + defines = [ "TELEPHONY_LOG_TAG = \"CellularDataFuzzTest\"", "LOG_DOMAIN = 0xD000F00", ] @@ -70,8 +66,8 @@ ohos_fuzztest("UpdateActiveMachineFuzzTest") { ] sources = [ - "//base/telephony/cellular_data/test/fuzztest/common_fuzzer/adddatatoken_fuzzer.cpp", - "//base/telephony/cellular_data/test/fuzztest/common_fuzzer/statemachine_fuzzer.cpp", + "$SOURCE_DIR/test/fuzztest/common_fuzzer/adddatatoken_fuzzer.cpp", + "$SOURCE_DIR/test/fuzztest/common_fuzzer/statemachine_fuzzer.cpp", "updateactivemachine_fuzzer.cpp", ] diff --git a/test/fuzztest/updatedisconnectmachine_fuzzer/BUILD.gn b/test/fuzztest/updatedisconnectmachine_fuzzer/BUILD.gn index 5af7d23c..c2a86d5f 100644 --- a/test/fuzztest/updatedisconnectmachine_fuzzer/BUILD.gn +++ b/test/fuzztest/updatedisconnectmachine_fuzzer/BUILD.gn @@ -12,7 +12,6 @@ # limitations under the License. #####################hydra-fuzz################### -import("//base/telephony/core_service/telephony.gni") import("//build/config/features.gni") import("//build/ohos.gni") import("//build/test.gni") @@ -21,20 +20,17 @@ import("//build/test.gni") ohos_fuzztest("UpdateDisconnectMachineFuzzTest") { module_output_path = "cellular_data/UpdateDisconnectMachineFuzzTest" module_out_path = module_output_path - fuzz_config_file = "//base/telephony/cellular_data/test/fuzztest/updatedisconnectmachine_fuzzer" + SOURCE_DIR = "../../.." include_dirs = [ - "//base/telephony/cellular_data/services/include", - "//base/telephony/cellular_data/services/include/apn_manager", - "//base/telephony/cellular_data/services/include/common", - "//base/telephony/cellular_data/services/include/state_machine", - "//base/telephony/cellular_data/services/include/utils", - "//base/telephony/cellular_data/test/fuzztest/common_fuzzer", - "//base/telephony/telephony_data/pdp_profile/include", + "$SOURCE_DIR/services/include", + "$SOURCE_DIR/services/include/apn_manager", + "$SOURCE_DIR/services/include/common", + "$SOURCE_DIR/services/include/state_machine", + "$SOURCE_DIR/services/include/utils", + "$SOURCE_DIR/test/fuzztest/common_fuzzer", ] - configs = [ "//base/telephony/core_service/utils:telephony_log_config" ] - - deps = [ "//base/telephony/cellular_data:tel_cellular_data" ] + deps = [ "$SOURCE_DIR:tel_cellular_data" ] external_deps = [ "ability_runtime:ability_manager", @@ -54,9 +50,10 @@ ohos_fuzztest("UpdateDisconnectMachineFuzzTest") { "netmanager_base:net_policy_manager_if", "netmanager_base:net_stats_manager_if", "relational_store:native_rdb", + "telephony_data:tel_telephony_data", ] - defines += [ + defines = [ "TELEPHONY_LOG_TAG = \"CellularDataFuzzTest\"", "LOG_DOMAIN = 0xD000F00", ] @@ -69,8 +66,8 @@ ohos_fuzztest("UpdateDisconnectMachineFuzzTest") { ] sources = [ - "//base/telephony/cellular_data/test/fuzztest/common_fuzzer/adddatatoken_fuzzer.cpp", - "//base/telephony/cellular_data/test/fuzztest/common_fuzzer/statemachine_fuzzer.cpp", + "$SOURCE_DIR/test/fuzztest/common_fuzzer/adddatatoken_fuzzer.cpp", + "$SOURCE_DIR/test/fuzztest/common_fuzzer/statemachine_fuzzer.cpp", "updatedisconnectmachine_fuzzer.cpp", ] diff --git a/test/fuzztest/updateinactivemachine_fuzzer/BUILD.gn b/test/fuzztest/updateinactivemachine_fuzzer/BUILD.gn index 022f232e..fe4efba2 100644 --- a/test/fuzztest/updateinactivemachine_fuzzer/BUILD.gn +++ b/test/fuzztest/updateinactivemachine_fuzzer/BUILD.gn @@ -12,7 +12,6 @@ # limitations under the License. #####################hydra-fuzz################### -import("//base/telephony/core_service/telephony.gni") import("//build/config/features.gni") import("//build/ohos.gni") import("//build/test.gni") @@ -21,20 +20,17 @@ import("//build/test.gni") ohos_fuzztest("UpdateInactiveMachineFuzzTest") { module_output_path = "cellular_data/UpdateInactiveMachineFuzzTest" module_out_path = module_output_path - fuzz_config_file = "//base/telephony/cellular_data/test/fuzztest/updateinactivemachine_fuzzer" + SOURCE_DIR = "../../.." include_dirs = [ - "//base/telephony/cellular_data/services/include", - "//base/telephony/cellular_data/services/include/apn_manager", - "//base/telephony/cellular_data/services/include/common", - "//base/telephony/cellular_data/services/include/state_machine", - "//base/telephony/cellular_data/services/include/utils", - "//base/telephony/cellular_data/test/fuzztest/common_fuzzer", - "//base/telephony/telephony_data/pdp_profile/include", + "$SOURCE_DIR/services/include", + "$SOURCE_DIR/services/include/apn_manager", + "$SOURCE_DIR/services/include/common", + "$SOURCE_DIR/services/include/state_machine", + "$SOURCE_DIR/services/include/utils", + "$SOURCE_DIR/test/fuzztest/common_fuzzer", ] - configs = [ "//base/telephony/core_service/utils:telephony_log_config" ] - - deps = [ "//base/telephony/cellular_data:tel_cellular_data" ] + deps = [ "$SOURCE_DIR:tel_cellular_data" ] external_deps = [ "ability_runtime:ability_manager", @@ -54,9 +50,10 @@ ohos_fuzztest("UpdateInactiveMachineFuzzTest") { "netmanager_base:net_policy_manager_if", "netmanager_base:net_stats_manager_if", "relational_store:native_rdb", + "telephony_data:tel_telephony_data", ] - defines += [ + defines = [ "TELEPHONY_LOG_TAG = \"CellularDataFuzzTest\"", "LOG_DOMAIN = 0xD000F00", ] @@ -69,8 +66,8 @@ ohos_fuzztest("UpdateInactiveMachineFuzzTest") { ] sources = [ - "//base/telephony/cellular_data/test/fuzztest/common_fuzzer/adddatatoken_fuzzer.cpp", - "//base/telephony/cellular_data/test/fuzztest/common_fuzzer/statemachine_fuzzer.cpp", + "$SOURCE_DIR/test/fuzztest/common_fuzzer/adddatatoken_fuzzer.cpp", + "$SOURCE_DIR/test/fuzztest/common_fuzzer/statemachine_fuzzer.cpp", "updateinactivemachine_fuzzer.cpp", ] diff --git a/test/unit_test/BUILD.gn b/test/unit_test/BUILD.gn index c9721750..fd80d646 100644 --- a/test/unit_test/BUILD.gn +++ b/test/unit_test/BUILD.gn @@ -10,11 +10,9 @@ # 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("//base/telephony/cellular_data/cellular_data_ability_runtime.gni") -import("//base/telephony/core_service/telephony.gni") import("//build/ohos.gni") -SOURCE_DIR = "//base/telephony/cellular_data" +SOURCE_DIR = "../.." ohos_executable("tel_cellular_data_ui_test") { sources = [ "cellular_data_code_test.cpp" ] @@ -24,22 +22,20 @@ ohos_executable("tel_cellular_data_ui_test") { "$SOURCE_DIR/services/include/common", ] - configs = [ "//base/telephony/core_service/utils:telephony_log_config" ] - - deps = [ "${ability_runtime_path}/frameworks/native/ability/native:abilitykit_native" ] - external_deps = [ + "ability_runtime:abilitykit_native", "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "access_token:libtoken_setproc", "c_utils:utils", "cellular_data:tel_cellular_data_api", + "core_service:libtel_common", "core_service:tel_core_service_api", "eventhandler:libeventhandler", "init:libbegetutil", ] - defines += [ + defines = [ "TELEPHONY_LOG_TAG = \"CelllularDataUiTest\"", "LOG_DOMAIN = 0xD000F00", ] -- Gitee From 7f6eeb4d160ecd0a5a49903f4902d5d490c22e26 Mon Sep 17 00:00:00 2001 From: huangyufei Date: Fri, 28 Apr 2023 15:12:56 +0800 Subject: [PATCH 2/3] =?UTF-8?q?BUILD.gn=E5=92=8Cbundle.json=E4=B8=AD?= =?UTF-8?q?=E4=BE=9D=E8=B5=96=E7=9A=84=E9=83=A8=E4=BB=B6=E6=B8=85=E5=8D=95?= =?UTF-8?q?=E4=BF=9D=E6=8C=81=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bundle.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bundle.json b/bundle.json index 3cf7708c..e86e311b 100644 --- a/bundle.json +++ b/bundle.json @@ -32,6 +32,8 @@ "components": [ "ability_base", "ability_runtime", + "access_token", + "bundle_framework", "c_utils", "common_event_service", "core_service", @@ -46,7 +48,8 @@ "netmanager_base", "relational_store", "safwk", - "samgr" + "samgr", + "telephony_data" ] }, "build": { -- Gitee From af7871d765c2255c192958da3c2185a2d26dbcbd Mon Sep 17 00:00:00 2001 From: zhangqiang Date: Fri, 5 May 2023 21:45:50 +0800 Subject: [PATCH 3/3] IssueNo: restore fuzz_config_file Description: restore fuzz_config_file Sig: SIG_Telephony Feature or Bugfix: Feature Binary Source: No Signed-off-by: zhangqiang Change-Id: Idbaf2acf74c549d5c4fb554513665b2754b35e3a --- test/fuzztest/getcellulardatastate_fuzzer/BUILD.gn | 1 + test/fuzztest/updateactivemachine_fuzzer/BUILD.gn | 1 + test/fuzztest/updatedisconnectmachine_fuzzer/BUILD.gn | 1 + test/fuzztest/updateinactivemachine_fuzzer/BUILD.gn | 1 + 4 files changed, 4 insertions(+) diff --git a/test/fuzztest/getcellulardatastate_fuzzer/BUILD.gn b/test/fuzztest/getcellulardatastate_fuzzer/BUILD.gn index b120d2c2..ce70379f 100644 --- a/test/fuzztest/getcellulardatastate_fuzzer/BUILD.gn +++ b/test/fuzztest/getcellulardatastate_fuzzer/BUILD.gn @@ -21,6 +21,7 @@ ohos_fuzztest("GetCellularDataStateFuzzTest") { module_output_path = "cellular_data/GetCellularDataStateFuzzTest" module_out_path = module_output_path SOURCE_DIR = "../../.." + fuzz_config_file = "$SOURCE_DIR/test/fuzztest/getcellulardatastate_fuzzer" include_dirs = [ "$SOURCE_DIR/services/include", "$SOURCE_DIR/services/include/apn_manager", diff --git a/test/fuzztest/updateactivemachine_fuzzer/BUILD.gn b/test/fuzztest/updateactivemachine_fuzzer/BUILD.gn index fdf7281f..a42d0ca0 100644 --- a/test/fuzztest/updateactivemachine_fuzzer/BUILD.gn +++ b/test/fuzztest/updateactivemachine_fuzzer/BUILD.gn @@ -21,6 +21,7 @@ ohos_fuzztest("UpdateActiveMachineFuzzTest") { module_output_path = "cellular_data/UpdateActiveMachineFuzzTest" module_out_path = module_output_path SOURCE_DIR = "../../.." + fuzz_config_file = "$SOURCE_DIR/test/fuzztest/updateactivemachine_fuzzer" include_dirs = [ "$SOURCE_DIR/services/include", "$SOURCE_DIR/services/include/apn_manager", diff --git a/test/fuzztest/updatedisconnectmachine_fuzzer/BUILD.gn b/test/fuzztest/updatedisconnectmachine_fuzzer/BUILD.gn index c2a86d5f..38b6cac2 100644 --- a/test/fuzztest/updatedisconnectmachine_fuzzer/BUILD.gn +++ b/test/fuzztest/updatedisconnectmachine_fuzzer/BUILD.gn @@ -21,6 +21,7 @@ ohos_fuzztest("UpdateDisconnectMachineFuzzTest") { module_output_path = "cellular_data/UpdateDisconnectMachineFuzzTest" module_out_path = module_output_path SOURCE_DIR = "../../.." + fuzz_config_file = "$SOURCE_DIR/test/fuzztest/updatedisconnectmachine_fuzzer" include_dirs = [ "$SOURCE_DIR/services/include", "$SOURCE_DIR/services/include/apn_manager", diff --git a/test/fuzztest/updateinactivemachine_fuzzer/BUILD.gn b/test/fuzztest/updateinactivemachine_fuzzer/BUILD.gn index fe4efba2..8a3fa068 100644 --- a/test/fuzztest/updateinactivemachine_fuzzer/BUILD.gn +++ b/test/fuzztest/updateinactivemachine_fuzzer/BUILD.gn @@ -21,6 +21,7 @@ ohos_fuzztest("UpdateInactiveMachineFuzzTest") { module_output_path = "cellular_data/UpdateInactiveMachineFuzzTest" module_out_path = module_output_path SOURCE_DIR = "../../.." + fuzz_config_file = "$SOURCE_DIR/test/fuzztest/updateinactivemachine_fuzzer" include_dirs = [ "$SOURCE_DIR/services/include", "$SOURCE_DIR/services/include/apn_manager", -- Gitee