• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022-2024 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//build/ohos.gni")
15import("//foundation/communication/netmanager_base/netmanager_base_config.gni")
16
17ohos_prebuilt_etc("netstats_notification_base") {
18  source = "notification/resources/base/element/string.json"
19  relative_install_dir = "netmanager_base/resources/base/element"
20  part_name = "netmanager_base"
21  subsystem_name = "communication"
22}
23ohos_prebuilt_etc("netstats_notification_bo_CN") {
24  source = "notification/resources/bo_CN/element/string.json"
25  relative_install_dir = "netmanager_base/resources/bo_CN/element"
26  part_name = "netmanager_base"
27  subsystem_name = "communication"
28}
29ohos_prebuilt_etc("netstats_notification_ug") {
30  source = "notification/resources/ug/element/string.json"
31  relative_install_dir = "netmanager_base/resources/ug/element"
32  part_name = "netmanager_base"
33  subsystem_name = "communication"
34}
35ohos_prebuilt_etc("netstats_notification_zh_CN") {
36  source = "notification/resources/zh_CN/element/string.json"
37  relative_install_dir = "netmanager_base/resources/zh_CN/element"
38  part_name = "netmanager_base"
39  subsystem_name = "communication"
40}
41ohos_prebuilt_etc("netstats_notification_zh_HK") {
42  source = "notification/resources/zh_HK/element/string.json"
43  relative_install_dir = "netmanager_base/resources/zh_HK/element"
44  part_name = "netmanager_base"
45  subsystem_name = "communication"
46}
47ohos_prebuilt_etc("netstats_notification_zh_TW") {
48  source = "notification/resources/zh_TW/element/string.json"
49  relative_install_dir = "netmanager_base/resources/zh_TW/element"
50  part_name = "netmanager_base"
51  subsystem_name = "communication"
52}
53ohos_prebuilt_etc("netstats_notification_zz_ZX") {
54  source = "notification/resources/zz_ZX/element/string.json"
55  relative_install_dir = "netmanager_base/resources/zz_ZX/element"
56  part_name = "netmanager_base"
57  subsystem_name = "communication"
58}
59ohos_prebuilt_etc("netstats_notification_ar") {
60  source = "notification/resources/ar/element/string.json"
61  relative_install_dir = "netmanager_base/resources/ar/element"
62  part_name = "netmanager_base"
63  subsystem_name = "communication"
64}
65ohos_prebuilt_etc("netstats_notification_es") {
66  source = "notification/resources/es/element/string.json"
67  relative_install_dir = "netmanager_base/resources/es/element"
68  part_name = "netmanager_base"
69  subsystem_name = "communication"
70}
71ohos_prebuilt_etc("netstats_notification_fr") {
72  source = "notification/resources/fr/element/string.json"
73  relative_install_dir = "netmanager_base/resources/fr/element"
74  part_name = "netmanager_base"
75  subsystem_name = "communication"
76}
77ohos_prebuilt_etc("netstats_notification_ja") {
78  source = "notification/resources/ja/element/string.json"
79  relative_install_dir = "netmanager_base/resources/ja/element"
80  part_name = "netmanager_base"
81  subsystem_name = "communication"
82}
83ohos_prebuilt_etc("netstats_notification_ko") {
84  source = "notification/resources/ko/element/string.json"
85  relative_install_dir = "netmanager_base/resources/ko/element"
86  part_name = "netmanager_base"
87  subsystem_name = "communication"
88}
89ohos_prebuilt_etc("netstats_notification_ru") {
90  source = "notification/resources/ru/element/string.json"
91  relative_install_dir = "netmanager_base/resources/ru/element"
92  part_name = "netmanager_base"
93  subsystem_name = "communication"
94}
95ohos_prebuilt_etc("netstats_notification_vi") {
96  source = "notification/resources/vi/element/string.json"
97  relative_install_dir = "netmanager_base/resources/vi/element"
98  part_name = "netmanager_base"
99  subsystem_name = "communication"
100}
101
102ohos_prebuilt_etc("netstats_notification_icon") {
103  source = "notification/resources/network_ic.png"
104  relative_install_dir = "netmanager_base/resources"
105  part_name = "netmanager_base"
106  subsystem_name = "communication"
107}
108
109ohos_prebuilt_etc("netstats_notification_locale") {
110  source = "notification/resources/locale_to_resourcePath.json"
111  relative_install_dir = "netmanager_base/resources"
112  part_name = "netmanager_base"
113  subsystem_name = "communication"
114}
115
116config("net_service_common_config") {
117  # header file path
118  include_dirs = [
119    "include",
120    "$INNERKITS_ROOT/netconnclient/include/proxy",
121  ]
122
123  cflags = common_cflags
124
125  cflags_cc = common_cflags
126}
127
128ohos_shared_library("net_service_common") {
129  sanitize = {
130    cfi = true
131    cfi_cross_dso = true
132    boundary_sanitize = true
133    ubsan = true
134    debug = false
135  }
136
137  branch_protector_ret = "pac_ret"
138
139  sources = [
140    "$NETMANAGER_BASE_ROOT/frameworks/js/napi/netstats/src/app_state_aware.cpp",
141    "src/broadcast_manager.cpp",
142    "src/net_manager_center.cpp",
143    "src/net_settings.cpp",
144    "src/route_utils.cpp",
145  ]
146
147  include_dirs = [
148    "include",
149    "$NETMANAGER_BASE_ROOT/utils/common_utils/include",
150    "$INNERKITS_ROOT/include",
151    "$INNERKITS_ROOT/netconnclient/include",
152    "$INNERKITS_ROOT/netmanagernative/include",
153    "$INNERKITS_ROOT/netstatsclient/include",
154    "$NETCONNMANAGER_COMMON_DIR/include",
155    "$NETSYSCONTROLLER_ROOT_DIR/include",
156    "$NETSYSNATIVE_SOURCE_DIR/include/netsys",
157  ]
158
159  public_configs = [ ":net_service_common_config" ]
160
161  deps = [
162    ":netstats_notification_base",
163    ":netstats_notification_bo_CN",
164    ":netstats_notification_icon",
165    ":netstats_notification_locale",
166    ":netstats_notification_ug",
167    ":netstats_notification_zh_CN",
168    ":netstats_notification_zh_HK",
169    ":netstats_notification_zh_TW",
170    ":netstats_notification_zz_ZX",
171    ":netstats_notification_ar",
172    ":netstats_notification_es",
173    ":netstats_notification_fr",
174    ":netstats_notification_ja",
175    ":netstats_notification_ko",
176    ":netstats_notification_ru",
177    ":netstats_notification_vi",
178    "$INNERKITS_ROOT/netconnclient:net_conn_parcel",
179    "$NETSYSCONTROLLER_ROOT_DIR:netsys_controller",
180  ]
181
182  external_deps = [
183    "ability_base:want",
184    "ability_runtime:app_manager",
185    "bounds_checking_function:libsec_shared",
186    "c_utils:utils",
187    "common_event_service:cesfwk_innerkits",
188    "ffrt:libffrt",
189    "ipc:ipc_core",
190    "jsoncpp:jsoncpp",
191    "samgr:samgr_proxy",
192  ]
193
194  defines = [
195    "NETMGR_LOG_TAG = \"NetConnManager\"",
196    "LOG_DOMAIN = 0xD0015B0",
197  ]
198
199  if (enable_netmgr_debug) {
200    defines += [ "NETMGR_DEBUG" ]
201  }
202
203  external_deps += [ "hilog:libhilog" ]
204
205  part_name = "netmanager_base"
206  subsystem_name = "communication"
207}
208