1# Copyright (c) 2021-2023 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}
28
29config("appmgr_core_config") {
30  include_dirs = [ "include" ]
31  defines = []
32  if (ability_command_for_test) {
33    defines += [ "ABILITY_COMMAND_FOR_TEST" ]
34  }
35}
36
37ohos_shared_library("app_manager") {
38  branch_protector_ret = "pac_ret"
39
40  include_dirs = [
41    "${ability_runtime_path}/interfaces/kits/native/appkit/dfr",
42    "${ability_runtime_path}/utils/global/time/include",
43    "${ability_runtime_services_path}/appdfr/include",
44    "${ability_runtime_services_path}/appmgr/include",
45    "${ability_runtime_services_path}/common/include",
46  ]
47
48  sources = [
49    "${ability_runtime_services_path}/appdfr/src/appfreeze_manager.cpp",
50    "src/appmgr/ability_controller_proxy.cpp",
51    "src/appmgr/ability_controller_stub.cpp",
52    "src/appmgr/ability_debug_response_proxy.cpp",
53    "src/appmgr/ability_debug_response_stub.cpp",
54    "src/appmgr/ability_foreground_state_observer_proxy.cpp",
55    "src/appmgr/ability_foreground_state_observer_stub.cpp",
56    "src/appmgr/ability_info_callback_proxy.cpp",
57    "src/appmgr/ability_info_callback_stub.cpp",
58    "src/appmgr/ability_state_data.cpp",
59    "src/appmgr/ams_mgr_proxy.cpp",
60    "src/appmgr/ams_mgr_stub.cpp",
61    "src/appmgr/app_debug_info.cpp",
62    "src/appmgr/app_debug_listener_proxy.cpp",
63    "src/appmgr/app_debug_listener_stub.cpp",
64    "src/appmgr/app_foreground_state_observer_proxy.cpp",
65    "src/appmgr/app_foreground_state_observer_stub.cpp",
66    "src/appmgr/app_jsheap_mem_info.cpp",
67    "src/appmgr/app_launch_data.cpp",
68    "src/appmgr/app_malloc_info.cpp",
69    "src/appmgr/app_mgr_client.cpp",
70    "src/appmgr/app_mgr_proxy.cpp",
71    "src/appmgr/app_mgr_stub.cpp",
72    "src/appmgr/app_process_data.cpp",
73    "src/appmgr/app_record_id.cpp",
74    "src/appmgr/app_running_status_proxy.cpp",
75    "src/appmgr/app_running_status_stub.cpp",
76    "src/appmgr/app_scheduler_host.cpp",
77    "src/appmgr/app_scheduler_proxy.cpp",
78    "src/appmgr/app_service_manager.cpp",
79    "src/appmgr/app_state_callback_host.cpp",
80    "src/appmgr/app_state_callback_proxy.cpp",
81    "src/appmgr/app_state_data.cpp",
82    "src/appmgr/application_state_observer_proxy.cpp",
83    "src/appmgr/application_state_observer_stub.cpp",
84    "src/appmgr/child_process_args.cpp",
85    "src/appmgr/child_process_info.cpp",
86    "src/appmgr/child_process_options.cpp",
87    "src/appmgr/child_process_request.cpp",
88    "src/appmgr/child_scheduler_proxy.cpp",
89    "src/appmgr/child_scheduler_stub.cpp",
90    "src/appmgr/configuration_observer_proxy.cpp",
91    "src/appmgr/configuration_observer_stub.cpp",
92    "src/appmgr/fault_data.cpp",
93    "src/appmgr/memory_level_info.cpp",
94    "src/appmgr/native_child_notify_proxy.cpp",
95    "src/appmgr/native_child_notify_stub.cpp",
96    "src/appmgr/page_state_data.cpp",
97    "src/appmgr/priority_object.cpp",
98    "src/appmgr/process_data.cpp",
99    "src/appmgr/process_info.cpp",
100    "src/appmgr/profile.cpp",
101    "src/appmgr/quick_fix_callback_proxy.cpp",
102    "src/appmgr/quick_fix_callback_stub.cpp",
103    "src/appmgr/render_process_info.cpp",
104    "src/appmgr/render_scheduler_host.cpp",
105    "src/appmgr/render_scheduler_proxy.cpp",
106    "src/appmgr/render_state_data.cpp",
107    "src/appmgr/render_state_observer_proxy.cpp",
108    "src/appmgr/render_state_observer_stub.cpp",
109    "src/appmgr/running_multi_info.cpp",
110    "src/appmgr/running_process_info.cpp",
111    "src/appmgr/start_specified_ability_response_proxy.cpp",
112    "src/appmgr/start_specified_ability_response_stub.cpp",
113    "src/appmgr/system_memory_attr.cpp",
114  ]
115
116  public_configs = [
117    ":appmgr_core_config",
118    ":appmgr_sdk_config",
119  ]
120
121  defines = [ "AMS_LOG_TAG = \"AppexecfwkCore\"" ]
122  defines += [ "AMS_LOG_DOMAIN = 0xD001306" ]
123  cflags = []
124  if (target_cpu == "arm") {
125    cflags += [ "-DBINDER_IPC_32BIT" ]
126  }
127  deps = [
128    "${ability_runtime_path}/utils/global/freeze:freeze_util",
129    "${ability_runtime_path}/utils/server/startup:startup_util",
130  ]
131
132  external_deps = [
133    "c_utils:utils",
134    "faultloggerd:libdfx_dumpcatcher",
135    "faultloggerd:libfaultloggerd",
136    "ffrt:libffrt",
137    "hilog:libhilog",
138    "hisysevent:libhisysevent",
139    "hitrace:hitrace_meter",
140    "init:libbegetutil",
141    "ipc:ipc_core",
142    "json:nlohmann_json_static",
143    "samgr:samgr_proxy",
144  ]
145  public_external_deps = [
146    "ability_base:configuration",
147    "ability_base:want",
148    "bundle_framework:appexecfwk_base",
149    "image_framework:image_native",
150    "relational_store:native_rdb",
151  ]
152
153  if (background_task_mgr_continuous_task_enable) {
154    defines += [ "BGTASKMGR_CONTINUOUS_TASK_ENABLE" ]
155  }
156
157  innerapi_tags = [ "platformsdk" ]
158  subsystem_name = "ability"
159  part_name = "ability_runtime"
160}
161