• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-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/ability/ability_runtime/ability_runtime.gni")
16
17config("appmgr_config") {
18  include_dirs = [
19    "include",
20    "include/utils",
21    "${ability_runtime_innerkits_path}/ability_manager/include",
22    "${ability_runtime_services_path}/common/include",
23    "${ability_runtime_path}/tools/aa/include",
24    "${ability_runtime_path}/utils/global/time/include",
25    "${ability_runtime_path}/interfaces/kits/native/appkit/ability_bundle_manager_helper",
26    "${ability_runtime_utils_path}/global/constant",
27  ]
28}
29
30group("appms_target") {
31  deps = [ ":libappms" ]
32}
33
34ohos_shared_library("libappms") {
35  sanitize = {
36    cfi = true
37    cfi_cross_dso = true
38    debug = false
39  }
40  branch_protector_ret = "pac_ret"
41  shlib_type = "sa"
42  include_dirs = [ "${ability_runtime_services_path}/appdfr/include" ]
43  sources = [
44    "${ability_runtime_path}/tools/aa/src/shell_command_result.cpp",
45    "${ability_runtime_path}/tools/aa/src/test_observer_proxy.cpp",
46    "src/ability_running_record.cpp",
47    "src/advanced_security_mode_manager.cpp",
48    "src/ams_mgr_scheduler.cpp",
49    "src/app_config_data_manager.cpp",
50    "src/app_death_recipient.cpp",
51    "src/app_debug_manager.cpp",
52    "src/app_lifecycle_deal.cpp",
53    "src/app_mgr_event.cpp",
54    "src/app_mgr_service.cpp",
55    "src/app_mgr_service_event_handler.cpp",
56    "src/app_mgr_service_inner.cpp",
57    "src/app_preloader.cpp",
58    "src/app_running_manager.cpp",
59    "src/app_running_record.cpp",
60    "src/app_running_status_module.cpp",
61    "src/app_spawn_client.cpp",
62    "src/app_state_observer_manager.cpp",
63    "src/cache_process_manager.cpp",
64    "src/exit_resident_process_manager.cpp",
65    "src/killing_process_manager.cpp",
66    "src/modal_system_app_freeze_uiextension.cpp",
67    "src/module_running_record.cpp",
68    "src/multi_user_config_mgr.cpp",
69    "src/quick_fix_callback_with_record.cpp",
70    "src/remote_client_manager.cpp",
71    "src/render_record.cpp",
72    "src/render_state_observer_manager.cpp",
73    "src/user_record_manager.cpp",
74    "src/window_focus_changed_listener.cpp",
75    "src/window_pid_visibility_changed_listener.cpp",
76    "src/window_visibility_changed_listener.cpp",
77  ]
78
79  defines = [ "AMS_LOG_TAG = \"AppMgrService\"" ]
80  defines += [ "AMS_LOG_DOMAIN = 0xD001303" ]
81  defines += [ "OHOS_ACCOUNT_ENABLED" ]
82  defines += [ "INCLUDE_ZURI" ]
83
84  if (product_name != "ohcore") {
85    defines += [ "APP_MGR_SERVICE_APPMS" ]
86  }
87
88  if (ability_command_for_test) {
89    defines += [ "ABILITY_COMMAND_FOR_TEST" ]
90  }
91
92  if (ability_fault_and_exit_test) {
93    defines += [ "ABILITY_FAULT_AND_EXIT_TEST" ]
94  }
95
96  if (ability_runtime_check_internet_permission) {
97    defines += [ "ABILITY_PLATFORM_CHECK_PERMISSION" ]
98  }
99
100  configs = [ ":appmgr_config" ]
101  cflags = []
102  if (target_cpu == "arm") {
103    cflags += [ "-DBINDER_IPC_32BIT" ]
104  }
105  deps = [
106    "${ability_runtime_innerkits_path}/ability_manager:ability_manager",
107    "${ability_runtime_innerkits_path}/app_manager:app_manager",
108    "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper",
109    "${ability_runtime_native_path}/appkit:appkit_manager_helper",
110    "${ability_runtime_path}/utils/global/freeze:freeze_util",
111    "${ability_runtime_path}/utils/server/startup:startup_util",
112    "${ability_runtime_services_path}/abilitymgr:ams_configuration_parameter",
113    "${ability_runtime_services_path}/common:app_util",
114    "${ability_runtime_services_path}/common:event_report",
115    "${ability_runtime_services_path}/common:perm_verification",
116    "${ability_runtime_services_path}/common:res_sched_util",
117    "${ability_runtime_services_path}/common:task_handler_wrap",
118  ]
119
120  external_deps = [
121    "ability_base:base",
122    "ability_base:configuration",
123    "ability_base:want",
124    "ability_base:zuri",
125    "access_token:libaccesstoken_sdk",
126    "appspawn:appspawn_client",
127    "bundle_framework:appexecfwk_base",
128    "bundle_framework:appexecfwk_core",
129    "c_utils:utils",
130    "common_event_service:cesfwk_innerkits",
131    "eventhandler:libeventhandler",
132    "ffrt:libffrt",
133    "hicollie:libhicollie",
134    "hilog:libhilog",
135    "hisysevent:libhisysevent",
136    "hitrace:hitrace_meter",
137    "init:libbeget_proxy",
138    "init:libbegetutil",
139    "ipc:ipc_core",
140    "json:nlohmann_json_static",
141    "kv_store:distributeddata_inner",
142    "memmgr:memmgrclient",
143    "memory_utils:libmeminfo",
144    "os_account:libaccountkits",
145    "os_account:os_account_innerkits",
146    "resource_schedule_service:ressched_client",
147    "safwk:system_ability_fwk",
148    "samgr:samgr_proxy",
149  ]
150  public_external_deps = [ "kv_store:distributeddata_mgr" ]
151
152  if (product_name != "ohcore") {
153    external_deps += [ "netmanager_base:net_conn_manager_if" ]
154  }
155
156  if (ability_runtime_feature_sandboxmanager) {
157    external_deps += [ "sandbox_manager:libsandbox_manager_sdk" ]
158    defines += [ "ABILITY_RUNTIME_FEATURE_SANDBOXMANAGER" ]
159  }
160
161  if (ability_runtime_child_process) {
162    defines += [ "SUPPORT_CHILD_PROCESS" ]
163    sources += [ "src/child_process_record.cpp" ]
164  }
165
166  if (ability_runtime_graphics) {
167    defines += [
168      "SUPPORT_GRAPHICS",
169      "SUPPORT_SCREEN",
170    ]
171
172    deps += []
173    external_deps += [
174      "i18n:intl_util",
175      "window_manager:libwm",
176      "window_manager:libwsutils",
177    ]
178  }
179  if (ability_runtime_upms) {
180    defines += [ "SUPPORT_UPMS" ]
181    deps += [
182      "${ability_runtime_innerkits_path}/uri_permission:uri_permission_mgr",
183    ]
184  }
185  cflags_cc = []
186  if (os_dlp_part_enabled) {
187    cflags_cc += [ "-DWITH_DLP" ]
188  }
189  if (background_task_mgr_continuous_task_enable) {
190    defines += [ "BGTASKMGR_CONTINUOUS_TASK_ENABLE" ]
191  }
192
193  if (is_asan || asan_detector) {
194    defines += [ "SUPPORT_ASAN" ]
195  }
196
197  if (ability_runtime_app_no_response_dialog) {
198    defines += [ "APP_NO_RESPONSE_DIALOG" ]
199  }
200  if (app_mgr_service_hicollie_enable) {
201    defines += [ "APP_MGR_SERVICE_HICOLLIE_ENABLE" ]
202  }
203  cflags += [ "-DAPP_NO_RESPONSE_BUNDLENAME=\"${ability_runtime_app_no_response_bundlename}\"" ]
204
205  version_script = "libappms.map"
206  subsystem_name = "ability"
207  part_name = "ability_runtime"
208}
209