1# Copyright (c) 2023-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("../device_status.gni")
15
16config("devicestatus_services_private_config") {
17  include_dirs = [
18    "delegate_task/include",
19    "native/include",
20    "${device_status_utils_path}/include",
21    "${device_status_interfaces_path}/innerkits/include",
22    "${device_status_interfaces_path}/innerkits/interaction/include",
23    "../libs/interface",
24    "interaction/drag/include",
25    "communication/base",
26    "communication/service/include",
27  ]
28
29  if (device_status_intention_framework) {
30    include_dirs += [
31      "${device_status_root_path}/intention/cooperate/server/include",
32      "${device_status_root_path}/intention/drag/server/include",
33      "${device_status_root_path}/intention/ipc/socket/include",
34    ]
35  }
36
37  defines = device_status_default_defines
38}
39
40config("devicestatus_services_public_config") {
41  include_dirs = [
42    "delegate_task/include",
43    "native/include",
44    "interaction/drag/include",
45  ]
46
47  if (device_status_intention_framework) {
48    include_dirs += [
49      "${device_status_root_path}/intention/cooperate/server/include",
50      "${device_status_root_path}/intention/drag/server/include",
51      "${device_status_root_path}/intention/ipc/socket/include",
52    ]
53  }
54}
55
56sources_set = [
57  "communication/service/src/devicestatus_srv_stub.cpp",
58  "delegate_task/src/delegate_tasks.cpp",
59  "native/src/devicestatus_dumper.cpp",
60  "native/src/devicestatus_hisysevent.cpp",
61  "native/src/devicestatus_manager.cpp",
62  "native/src/devicestatus_msdp_client_impl.cpp",
63  "native/src/devicestatus_service.cpp",
64  "native/src/stream_server.cpp",
65]
66
67external_deps_set = [
68  "ability_runtime:app_manager",
69  "access_token:libaccesstoken_sdk",
70  "access_token:libtokenid_sdk",
71  "cJSON:cjson",
72  "c_utils:utils",
73  "graphic_2d:librender_service_client",
74  "graphic_2d:window_animation",
75  "hilog:libhilog",
76  "hisysevent:libhisysevent",
77  "hitrace:hitrace_meter",
78  "input:libmmi-client",
79  "ipc:ipc_single",
80  "image_framework:image_native",
81  "safwk:system_ability_fwk",
82  "window_manager:libwm",
83  "window_manager:libdm",
84]
85
86ohos_shared_library("devicestatus_service") {
87  sanitize = {
88    integer_overflow = true
89    ubsan = true
90    boundary_sanitize = true
91    cfi = true
92    cfi_cross_dso = true
93    debug = false
94  }
95
96  branch_protector_ret = "pac_ret"
97
98  shlib_type = "sa"
99
100  sources = sources_set
101
102  configs = [ ":devicestatus_services_private_config" ]
103
104  public_configs = [ ":devicestatus_services_public_config" ]
105
106  deps = [
107    "${device_status_interfaces_path}/innerkits:devicestatus_client",
108    "${device_status_root_path}/utils/ipc:devicestatus_ipc",
109    "${device_status_utils_path}:devicestatus_util",
110    "interaction/drag:interaction_drag",
111  ]
112
113  if (device_status_intention_framework) {
114    deps += [
115      "${device_status_root_path}/intention/adapters/dsoftbus_adapter:intention_dsoftbus_adapter",
116      "${device_status_root_path}/intention/adapters/input_adapter:intention_input_adapter",
117      "${device_status_root_path}/intention/scheduler/plugin_manager:intention_plugin_manager",
118    ]
119  }
120
121  public_deps = [
122    "${device_status_root_path}/intention/common/epoll:intention_epoll",
123    "${device_status_root_path}/intention/prototype:intention_prototype",
124    "${device_status_root_path}/intention/scheduler/timer_manager:intention_timer_manager",
125    "${device_status_root_path}/intention/services/device_manager:intention_device_manager",
126  ]
127
128  if (device_status_intention_framework) {
129    public_deps += [
130      "${device_status_root_path}/intention/ipc/socket:intention_socket_session_manager",
131      "${device_status_root_path}/intention/ipc/tunnel:intention_tunnel_server",
132      "${device_status_root_path}/intention/services/intention_service:intention_service",
133    ]
134  }
135
136  defines = []
137  if (device_status_sensor_enable) {
138    defines += [ "DEVICE_STATUS_SENSOR_ENABLE" ]
139  }
140  external_deps = external_deps_set
141  if (device_status_intention_framework) {
142    external_deps += [ "device_manager:devicemanagersdk" ]
143  } else {
144    if (device_status_interaction_coordination) {
145      external_deps += [ "device_manager:devicemanagersdk" ]
146    }
147  }
148  if (device_status_memmgr_enable) {
149    defines += [ "MEMMGR_ENABLE" ]
150    external_deps += [ "memmgr:memmgrclient" ]
151  }
152
153  subsystem_name = "${device_status_subsystem_name}"
154  part_name = "${device_status_part_name}"
155}
156
157ohos_static_library("devicestatus_static_service") {
158  sanitize = {
159    integer_overflow = true
160    ubsan = true
161    boundary_sanitize = true
162    cfi = true
163    cfi_cross_dso = true
164    debug = false
165  }
166
167  sources = sources_set
168
169  configs = [ ":devicestatus_services_private_config" ]
170
171  public_configs = [ ":devicestatus_services_public_config" ]
172
173  deps = [
174    "${device_status_interfaces_path}/innerkits:devicestatus_client",
175    "${device_status_root_path}/utils/ipc:devicestatus_ipc",
176    "${device_status_utils_path}:devicestatus_util",
177    "interaction/drag:interaction_drag",
178  ]
179
180  if (device_status_intention_framework) {
181    deps += [
182      "${device_status_root_path}/intention/adapters/dsoftbus_adapter:intention_dsoftbus_adapter",
183      "${device_status_root_path}/intention/adapters/input_adapter:intention_input_adapter",
184      "${device_status_root_path}/intention/scheduler/plugin_manager:intention_plugin_manager",
185    ]
186  }
187
188  defines = []
189  if (device_status_sensor_enable) {
190    defines += [ "DEVICE_STATUS_SENSOR_ENABLE" ]
191  }
192
193  public_deps = [
194    "${device_status_root_path}/intention/common/epoll:intention_epoll",
195    "${device_status_root_path}/intention/prototype:intention_prototype",
196    "${device_status_root_path}/intention/scheduler/timer_manager:intention_timer_manager",
197    "${device_status_root_path}/intention/services/device_manager:intention_device_manager",
198  ]
199
200  if (device_status_intention_framework) {
201    public_deps += [
202      "${device_status_root_path}/intention/ipc/socket:intention_socket_session_manager",
203      "${device_status_root_path}/intention/ipc/tunnel:intention_tunnel_server",
204      "${device_status_root_path}/intention/services/intention_service:intention_service",
205    ]
206  }
207
208  external_deps = external_deps_set
209  if (device_status_intention_framework) {
210    external_deps += [ "device_manager:devicemanagersdk" ]
211  } else {
212    if (device_status_interaction_coordination) {
213      external_deps += [ "device_manager:devicemanagersdk" ]
214    }
215  }
216  if (device_status_memmgr_enable) {
217    defines += [ "MEMMGR_ENABLE" ]
218    external_deps += [ "memmgr:memmgrclient" ]
219  }
220
221  subsystem_name = "${device_status_subsystem_name}"
222  part_name = "${device_status_part_name}"
223}
224