• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2025 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/ability/ability_runtime/ability_runtime.gni")
16
17config("appmgr_sdk_config") {
18  include_dirs = [
19    "include/appmgr",
20    "${ability_runtime_path}/interfaces/kits/native/ability/native",
21    "${ability_runtime_innerkits_path}/ability_manager/include",
22  ]
23  defines = []
24  if (ability_command_for_test) {
25    defines += [ "ABILITY_COMMAND_FOR_TEST" ]
26  }
27  if (ability_runtime_child_process) {
28    defines += [ "SUPPORT_CHILD_PROCESS" ]
29  }
30}
31
32config("appmgr_core_config") {
33  include_dirs = [ "include" ]
34  defines = []
35  if (ability_command_for_test) {
36    defines += [ "ABILITY_COMMAND_FOR_TEST" ]
37  }
38  if (ability_runtime_child_process) {
39    defines += [ "SUPPORT_CHILD_PROCESS" ]
40  }
41}
42
43ohos_shared_library("app_manager") {
44  branch_protector_ret = "pac_ret"
45
46  include_dirs = [
47    "${ability_runtime_path}/interfaces/kits/native/appkit/dfr",
48    "${ability_runtime_path}/utils/global/time/include",
49    "${ability_runtime_services_path}/appdfr/include",
50    "${ability_runtime_services_path}/appmgr/include",
51    "${ability_runtime_services_path}/common/include",
52  ]
53
54  sources = [
55    "${ability_runtime_services_path}/appdfr/src/appfreeze_cpu_freq_manager.cpp",
56    "${ability_runtime_services_path}/appdfr/src/appfreeze_manager.cpp",
57    "${ability_runtime_services_path}/appdfr/src/appfreeze_util.cpp",
58    "${ability_runtime_services_path}/appdfr/src/cpu_data_processor.cpp",
59    "src/appmgr/ability_controller_proxy.cpp",
60    "src/appmgr/ability_controller_stub.cpp",
61    "src/appmgr/ability_debug_response_proxy.cpp",
62    "src/appmgr/ability_debug_response_stub.cpp",
63    "src/appmgr/ability_foreground_state_observer_proxy.cpp",
64    "src/appmgr/ability_foreground_state_observer_stub.cpp",
65    "src/appmgr/ability_info_callback_proxy.cpp",
66    "src/appmgr/ability_info_callback_stub.cpp",
67    "src/appmgr/ability_state_data.cpp",
68    "src/appmgr/ams_mgr_proxy.cpp",
69    "src/appmgr/ams_mgr_stub.cpp",
70    "src/appmgr/app_debug_info.cpp",
71    "src/appmgr/app_debug_listener_proxy.cpp",
72    "src/appmgr/app_debug_listener_stub.cpp",
73    "src/appmgr/app_foreground_state_observer_proxy.cpp",
74    "src/appmgr/app_foreground_state_observer_stub.cpp",
75    "src/appmgr/app_jsheap_mem_info.cpp",
76    "src/appmgr/app_cjheap_mem_info.cpp",
77    "src/appmgr/app_launch_data.cpp",
78    "src/appmgr/app_malloc_info.cpp",
79    "src/appmgr/app_mgr_client.cpp",
80    "src/appmgr/app_mgr_proxy.cpp",
81    "src/appmgr/app_mgr_stub.cpp",
82    "src/appmgr/app_process_data.cpp",
83    "src/appmgr/app_record_id.cpp",
84    "src/appmgr/app_running_status_proxy.cpp",
85    "src/appmgr/app_running_status_stub.cpp",
86    "src/appmgr/app_scheduler_host.cpp",
87    "src/appmgr/app_scheduler_proxy.cpp",
88    "src/appmgr/app_service_manager.cpp",
89    "src/appmgr/app_state_callback_host.cpp",
90    "src/appmgr/app_state_callback_proxy.cpp",
91    "src/appmgr/app_state_data.cpp",
92    "src/appmgr/application_state_observer_proxy.cpp",
93    "src/appmgr/application_state_observer_stub.cpp",
94    "src/appmgr/background_app_info.cpp",
95    "src/appmgr/child_process_info.cpp",
96    "src/appmgr/child_scheduler_proxy.cpp",
97    "src/appmgr/child_scheduler_stub.cpp",
98    "src/appmgr/configuration_observer_proxy.cpp",
99    "src/appmgr/configuration_observer_stub.cpp",
100    "src/appmgr/configuration_policy.cpp",
101    "src/appmgr/fault_data.cpp",
102    "src/appmgr/kia_interceptor_proxy.cpp",
103    "src/appmgr/kia_interceptor_stub.cpp",
104    "src/appmgr/memory_level_info.cpp",
105    "src/appmgr/native_child_notify_proxy.cpp",
106    "src/appmgr/native_child_notify_stub.cpp",
107    "src/appmgr/page_state_data.cpp",
108    "src/appmgr/preload_process_data.cpp",
109    "src/appmgr/priority_object.cpp",
110    "src/appmgr/process_data.cpp",
111    "src/appmgr/process_info.cpp",
112    "src/appmgr/process_memory_state.cpp",
113    "src/appmgr/profile.cpp",
114    "src/appmgr/quick_fix_callback_proxy.cpp",
115    "src/appmgr/quick_fix_callback_stub.cpp",
116    "src/appmgr/render_process_info.cpp",
117    "src/appmgr/render_scheduler_host.cpp",
118    "src/appmgr/render_scheduler_proxy.cpp",
119    "src/appmgr/render_state_data.cpp",
120    "src/appmgr/render_state_observer_proxy.cpp",
121    "src/appmgr/render_state_observer_stub.cpp",
122    "src/appmgr/running_multi_info.cpp",
123    "src/appmgr/running_process_info.cpp",
124    "src/appmgr/start_specified_ability_response_proxy.cpp",
125    "src/appmgr/start_specified_ability_response_stub.cpp",
126    "src/appmgr/system_memory_attr.cpp",
127    "src/appmgr/process_bind_data.cpp",
128  ]
129
130  public_configs = [
131    ":appmgr_core_config",
132    ":appmgr_sdk_config",
133  ]
134
135  defines = [ "AMS_LOG_TAG = \"AppexecfwkCore\"" ]
136  defines += [ "AMS_LOG_DOMAIN = 0xD001306" ]
137  cflags = []
138  if (target_cpu == "arm") {
139    cflags += [ "-DBINDER_IPC_32BIT" ]
140  }
141  deps = [
142    "${ability_runtime_path}/utils/global/freeze:freeze_util",
143    "${ability_runtime_path}/utils/server/startup:startup_util",
144    "${ability_runtime_services_path}/common:app_util",
145    "${ability_runtime_services_path}/common:hitrace_chain_util",
146    "${ability_runtime_services_path}/common:res_sched_util",
147  ]
148
149  external_deps = [
150    "c_utils:utils",
151    "faultloggerd:libbacktrace_local",
152    "faultloggerd:libdfx_dumpcatcher",
153    "faultloggerd:libfaultloggerd",
154    "ffrt:libffrt",
155    "hilog:libhilog",
156    "hisysevent:libhisysevent",
157    "hitrace:hitrace_meter",
158    "hitrace:libhitracechain",
159    "init:libbegetutil",
160    "ipc:ipc_core",
161    "json:nlohmann_json_static",
162    "samgr:samgr_proxy",
163  ]
164  public_external_deps = [
165    "ability_base:configuration",
166    "ability_base:session_info",
167    "ability_base:want",
168    "bundle_framework:appexecfwk_base",
169    "image_framework:image_native",
170    "relational_store:native_rdb",
171  ]
172  if (ability_runtime_child_process) {
173    defines += [ "SUPPORT_CHILD_PROCESS" ]
174    sources += [
175      "src/appmgr/child_process_args.cpp",
176      "src/appmgr/child_process_options.cpp",
177      "src/appmgr/child_process_request.cpp",
178    ]
179  }
180
181  if (background_task_mgr_continuous_task_enable) {
182    defines += [ "BGTASKMGR_CONTINUOUS_TASK_ENABLE" ]
183  }
184
185  if (ability_runtime_hitrace_enable) {
186    external_deps += [ "hitrace:libhitracechain" ]
187    defines += [ "ABILITY_RUNTIME_HITRACE_ENABLE" ]
188  }
189
190  innerapi_tags = [ "platformsdk" ]
191  subsystem_name = "ability"
192  part_name = "ability_runtime"
193}
194
195ohos_shared_library("app_state_data") {
196  sanitize = {
197    integer_overflow = true
198    ubsan = true
199    boundary_sanitize = true
200    cfi = true
201    cfi_cross_dso = true
202    cfi_vcall_icall_only = true
203    debug = false
204  }
205  branch_protector_ret = "pac_ret"
206
207  include_dirs = [
208    "include/appmgr",
209    "${ability_runtime_services_path}/common/include",
210  ]
211
212  sources = [ "src/appmgr/app_state_data.cpp" ]
213
214  defines = [ "AMS_LOG_TAG = \"AppexecfwkCore\"" ]
215  defines += [ "AMS_LOG_DOMAIN = 0xD001306" ]
216  cflags = []
217  if (target_cpu == "arm") {
218    cflags += [ "-DBINDER_IPC_32BIT" ]
219  }
220
221  external_deps = [
222    "bundle_framework:appexecfwk_base",
223    "c_utils:utils",
224    "hilog:libhilog",
225    "ipc:ipc_single",
226  ]
227
228  innerapi_tags = [ "platformsdk" ]
229  subsystem_name = "ability"
230  part_name = "ability_runtime"
231}
232