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 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}/abilitymgr/src/last_exit_detail_info.cpp", 56 "${ability_runtime_services_path}/appdfr/src/appfreeze_manager.cpp", 57 "src/appmgr/ability_controller_proxy.cpp", 58 "src/appmgr/ability_controller_stub.cpp", 59 "src/appmgr/ability_debug_response_proxy.cpp", 60 "src/appmgr/ability_debug_response_stub.cpp", 61 "src/appmgr/ability_foreground_state_observer_proxy.cpp", 62 "src/appmgr/ability_foreground_state_observer_stub.cpp", 63 "src/appmgr/ability_info_callback_proxy.cpp", 64 "src/appmgr/ability_info_callback_stub.cpp", 65 "src/appmgr/ability_state_data.cpp", 66 "src/appmgr/ams_mgr_proxy.cpp", 67 "src/appmgr/ams_mgr_stub.cpp", 68 "src/appmgr/app_debug_info.cpp", 69 "src/appmgr/app_debug_listener_proxy.cpp", 70 "src/appmgr/app_debug_listener_stub.cpp", 71 "src/appmgr/app_foreground_state_observer_proxy.cpp", 72 "src/appmgr/app_foreground_state_observer_stub.cpp", 73 "src/appmgr/app_jsheap_mem_info.cpp", 74 "src/appmgr/app_launch_data.cpp", 75 "src/appmgr/app_malloc_info.cpp", 76 "src/appmgr/app_mgr_client.cpp", 77 "src/appmgr/app_mgr_proxy.cpp", 78 "src/appmgr/app_mgr_stub.cpp", 79 "src/appmgr/app_process_data.cpp", 80 "src/appmgr/app_record_id.cpp", 81 "src/appmgr/app_running_status_proxy.cpp", 82 "src/appmgr/app_running_status_stub.cpp", 83 "src/appmgr/app_scheduler_host.cpp", 84 "src/appmgr/app_scheduler_proxy.cpp", 85 "src/appmgr/app_service_manager.cpp", 86 "src/appmgr/app_state_callback_host.cpp", 87 "src/appmgr/app_state_callback_proxy.cpp", 88 "src/appmgr/app_state_data.cpp", 89 "src/appmgr/application_state_observer_proxy.cpp", 90 "src/appmgr/application_state_observer_stub.cpp", 91 "src/appmgr/child_process_info.cpp", 92 "src/appmgr/child_scheduler_proxy.cpp", 93 "src/appmgr/child_scheduler_stub.cpp", 94 "src/appmgr/configuration_observer_proxy.cpp", 95 "src/appmgr/configuration_observer_stub.cpp", 96 "src/appmgr/fault_data.cpp", 97 "src/appmgr/kia_interceptor_proxy.cpp", 98 "src/appmgr/kia_interceptor_stub.cpp", 99 "src/appmgr/killed_process_info.cpp", 100 "src/appmgr/memory_level_info.cpp", 101 "src/appmgr/native_child_notify_proxy.cpp", 102 "src/appmgr/native_child_notify_stub.cpp", 103 "src/appmgr/page_state_data.cpp", 104 "src/appmgr/priority_object.cpp", 105 "src/appmgr/process_data.cpp", 106 "src/appmgr/process_info.cpp", 107 "src/appmgr/process_memory_state.cpp", 108 "src/appmgr/profile.cpp", 109 "src/appmgr/quick_fix_callback_proxy.cpp", 110 "src/appmgr/quick_fix_callback_stub.cpp", 111 "src/appmgr/render_process_info.cpp", 112 "src/appmgr/render_scheduler_host.cpp", 113 "src/appmgr/render_scheduler_proxy.cpp", 114 "src/appmgr/render_state_data.cpp", 115 "src/appmgr/render_state_observer_proxy.cpp", 116 "src/appmgr/render_state_observer_stub.cpp", 117 "src/appmgr/running_multi_info.cpp", 118 "src/appmgr/running_process_info.cpp", 119 "src/appmgr/start_specified_ability_response_proxy.cpp", 120 "src/appmgr/start_specified_ability_response_stub.cpp", 121 "src/appmgr/system_memory_attr.cpp", 122 ] 123 124 public_configs = [ 125 ":appmgr_core_config", 126 ":appmgr_sdk_config", 127 ] 128 129 defines = [ "AMS_LOG_TAG = \"AppexecfwkCore\"" ] 130 defines += [ "AMS_LOG_DOMAIN = 0xD001306" ] 131 cflags = [] 132 if (target_cpu == "arm") { 133 cflags += [ "-DBINDER_IPC_32BIT" ] 134 } 135 deps = [ 136 "${ability_runtime_path}/utils/global/freeze:freeze_util", 137 "${ability_runtime_path}/utils/server/startup:startup_util", 138 ] 139 140 external_deps = [ 141 "c_utils:utils", 142 "faultloggerd:libbacktrace_local", 143 "faultloggerd:libdfx_dumpcatcher", 144 "faultloggerd:libfaultloggerd", 145 "ffrt:libffrt", 146 "hilog:libhilog", 147 "hisysevent:libhisysevent", 148 "hitrace:hitrace_meter", 149 "init:libbegetutil", 150 "ipc:ipc_core", 151 "json:nlohmann_json_static", 152 "samgr:samgr_proxy", 153 ] 154 public_external_deps = [ 155 "ability_base:configuration", 156 "ability_base:session_info", 157 "ability_base:want", 158 "bundle_framework:appexecfwk_base", 159 "image_framework:image_native", 160 "relational_store:native_rdb", 161 ] 162 if (ability_runtime_child_process) { 163 defines += [ "SUPPORT_CHILD_PROCESS" ] 164 sources += [ 165 "src/appmgr/child_process_args.cpp", 166 "src/appmgr/child_process_options.cpp", 167 "src/appmgr/child_process_request.cpp", 168 ] 169 } 170 171 if (background_task_mgr_continuous_task_enable) { 172 defines += [ "BGTASKMGR_CONTINUOUS_TASK_ENABLE" ] 173 } 174 175 innerapi_tags = [ "platformsdk" ] 176 subsystem_name = "ability" 177 part_name = "ability_runtime" 178} 179 180ohos_shared_library("app_state_data") { 181 sanitize = { 182 integer_overflow = true 183 ubsan = true 184 boundary_sanitize = true 185 cfi = true 186 cfi_cross_dso = true 187 cfi_vcall_icall_only = true 188 debug = false 189 } 190 branch_protector_ret = "pac_ret" 191 192 include_dirs = [ 193 "include/appmgr", 194 "${ability_runtime_services_path}/common/include", 195 ] 196 197 sources = [ "src/appmgr/app_state_data.cpp" ] 198 199 defines = [ "AMS_LOG_TAG = \"AppexecfwkCore\"" ] 200 defines += [ "AMS_LOG_DOMAIN = 0xD001306" ] 201 cflags = [] 202 if (target_cpu == "arm") { 203 cflags += [ "-DBINDER_IPC_32BIT" ] 204 } 205 206 external_deps = [ 207 "bundle_framework:appexecfwk_base", 208 "c_utils:utils", 209 "hilog:libhilog", 210 "ipc:ipc_single", 211 ] 212 213 innerapi_tags = [ "platformsdk" ] 214 subsystem_name = "ability" 215 part_name = "ability_runtime" 216} 217