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") 16import( 17 "//foundation/ability/ability_runtime/services/abilitymgr/abilitymgr.gni") 18 19ohos_shared_headers("abilityms_target") { 20 include_dirs = [ "include/" ] 21 deps = [ 22 ":abilityms", 23 ":ams_service_config", 24 ":mission_list", 25 ] 26 subsystem_name = "ability" 27 part_name = "ability_runtime" 28} 29 30config("abilityms_exception_config") { 31 cflags_cc = [ "-fexceptions" ] 32} 33 34config("abilityms_config") { 35 include_dirs = [ 36 "include/", 37 "include/ability_start_with_wait_observer_manager", 38 "include/data_ability", 39 "include/dialog_session/", 40 "include/extension_record", 41 "include/insight_intent", 42 "include/mission/", 43 "include/rdb/", 44 "include/resident_process/", 45 "include/keep_alive/", 46 "include/screen_lock/", 47 "include/ui_extension", 48 "include/ui_extension_record", 49 "include/utils/", 50 "${ability_runtime_innerkits_path}/ability_manager/include", 51 "${ability_runtime_innerkits_path}/ability_manager/include/aa_tools", 52 "${ability_runtime_services_path}/appdfr/include", 53 "${ability_runtime_innerkits_path}/app_manager/include", 54 "${ability_runtime_innerkits_path}/connectionobs_manager/include", 55 "${ability_runtime_innerkits_path}/deps_wrapper/include", 56 "${ability_runtime_services_path}/common/include", 57 "//prebuilts/jdk/jdk8/linux-x86/include", 58 "//prebuilts/jdk/jdk8/linux-x86/include/linux", 59 "${ability_runtime_path}/interfaces/kits/native/ability/native", 60 "${ability_runtime_innerkits_path}/dataobs_manager/include", 61 "${ability_runtime_path}/tools/aa/include", 62 "${ability_runtime_innerkits_path}/wantagent/include", 63 "${ability_runtime_innerkits_path}/session_handler/include", 64 "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime", 65 "${ability_runtime_path}/interfaces/kits/native/appkit/ability_bundle_manager_helper", 66 "${ability_runtime_utils_path}/global/constant", 67 "${ability_runtime_path}/utils/global/time/include", 68 "${ability_runtime_utils_path}/server/constant", 69 ] 70 71 defines = [] 72 73 if (ability_command_for_test) { 74 defines += [ "ABILITY_COMMAND_FOR_TEST" ] 75 } 76 77 if (ability_fault_and_exit_test) { 78 defines += [ "ABILITY_FAULT_AND_EXIT_TEST" ] 79 } 80 81 if (ability_runtime_graphics) { 82 defines += [ 83 "SUPPORT_GRAPHICS", 84 "SUPPORT_SCREEN", 85 ] 86 } 87 88 if (background_task_mgr_continuous_task_enable) { 89 defines += [ "BGTASKMGR_CONTINUOUS_TASK_ENABLE" ] 90 } 91 92 if (resource_schedule_service_enable) { 93 defines += [ "RESOURCE_SCHEDULE_SERVICE_ENABLE" ] 94 } 95 96 if (memmgr_override_enable) { 97 defines += [ "MEMMGR_OVERRIDE_ENABLE" ] 98 } 99 100 if (is_asan || asan_detector) { 101 defines += [ "SUPPORT_ASAN" ] 102 } 103 104 cflags = [] 105 if (target_cpu == "arm") { 106 cflags += [ "-DBINDER_IPC_32BIT" ] 107 } 108 cflags += [ 109 "-DKEY_AUTO_FILL_ABILITY=\"${ability_runtime_auto_fill_ability}\"", 110 "-DKEY_SMART_AUTO_FILL_ABILITY=\"${ability_runtime_smart_auto_fill_ability}\"", 111 ] 112} 113 114ohos_shared_library("abilityms") { 115 sanitize = { 116 cfi = true 117 cfi_cross_dso = true 118 debug = false 119 } 120 branch_protector_ret = "pac_ret" 121 shlib_type = "sa" 122 sources = abilityms_files 123 cflags_cc = [] 124 configs = [ 125 ":abilityms_config", 126 ":abilityms_exception_config", 127 ] 128 include_dirs = [ 129 "${ability_runtime_services_path}/appdfr/include", 130 "${ability_runtime_path}/interfaces/kits/native/ability/native/ui_service_extension_ability/connection", 131 "${ability_runtime_path}/utils/global/time/include", 132 "${ability_runtime_services_path}/abilitymgr/include/mission", 133 ] 134 deps = [ 135 ":wantagent_manager", 136 "${ability_runtime_innerkits_path}/ability_manager:ability_connect_callback_stub", 137 "${ability_runtime_innerkits_path}/ability_manager:ability_manager", 138 "${ability_runtime_innerkits_path}/ability_manager:ability_start_options", 139 "${ability_runtime_innerkits_path}/ability_manager:ability_start_setting", 140 "${ability_runtime_innerkits_path}/ability_manager:mission_info", 141 "${ability_runtime_innerkits_path}/ability_manager:process_options", 142 "${ability_runtime_innerkits_path}/ability_manager:start_window_option", 143 "${ability_runtime_innerkits_path}/app_manager:app_manager", 144 "${ability_runtime_innerkits_path}/connectionobs_manager:connection_obs_manager", 145 "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper", 146 "${ability_runtime_innerkits_path}/session_handler:session_handler", 147 "${ability_runtime_native_path}/ability/native:ability_business_error", 148 "${ability_runtime_native_path}/ability/native:abilitykit_native", 149 "${ability_runtime_native_path}/ability/native:auto_startup_callback", 150 "${ability_runtime_native_path}/appkit:appkit_manager_helper", 151 "${ability_runtime_path}/utils/global/freeze:freeze_util", 152 "${ability_runtime_path}/utils/server/startup:startup_util", 153 "${ability_runtime_services_path}/common:app_util", 154 "${ability_runtime_services_path}/common:event_report", 155 "${ability_runtime_services_path}/common:perm_verification", 156 "${ability_runtime_services_path}/common:rate_limiter", 157 "${ability_runtime_services_path}/common:record_cost_time_util", 158 "${ability_runtime_services_path}/common:res_sched_util", 159 "${ability_runtime_services_path}/common:task_handler_wrap", 160 ] 161 162 external_deps = [ 163 "ability_base:base", 164 "ability_base:configuration", 165 "ability_base:extractortool", 166 "ability_base:session_info", 167 "ability_base:view_data", 168 "ability_base:want", 169 "ability_base:zuri", 170 "access_token:libaccesstoken_sdk", 171 "access_token:libtokenid_sdk", 172 "bundle_framework:appexecfwk_base", 173 "bundle_framework:appexecfwk_core", 174 "bundle_framework:libappexecfwk_common", 175 "c_utils:utils", 176 "common_event_service:cesfwk_core", 177 "common_event_service:cesfwk_innerkits", 178 "config_policy:configpolicy_util", 179 "dsoftbus:softbus_client", 180 "eventhandler:libeventhandler", 181 "faultloggerd:libbacktrace_local", 182 "ffrt:libffrt", 183 "hicollie:libhicollie", 184 "hilog:libhilog", 185 "hisysevent:libhisysevent", 186 "hitrace:hitrace_meter", 187 "icu:shared_icuuc", 188 "init:libbeget_proxy", 189 "init:libbegetutil", 190 "ipc:ipc_core", 191 "json:nlohmann_json_static", 192 "kv_store:distributeddata_inner", 193 "os_account:os_account_innerkits", 194 "qos_manager:concurrent_task_client", 195 "relational_store:native_appdatafwk", 196 "relational_store:native_dataability", 197 "relational_store:native_rdb", 198 "safwk:system_ability_fwk", 199 "samgr:samgr_proxy", 200 "window_manager:libmodal_system_ui_extension_client", 201 "window_manager:libwsutils", 202 "window_manager:scene_session", 203 "window_manager:session_manager_lite", 204 "window_manager:sms", 205 ] 206 public_external_deps = [ "background_task_mgr:bgtaskmgr_innerkits" ] 207 208 if (background_task_mgr_continuous_task_enable) { 209 external_deps += [ "background_task_mgr:bgtaskmgr_innerkits" ] 210 } 211 212 if (resource_schedule_service_enable) { 213 external_deps += [ "resource_schedule_service:ressched_client" ] 214 } 215 216 if (memmgr_override_enable) { 217 external_deps += [ "memmgr:memmgrclient" ] 218 } 219 220 if (os_dlp_part_enabled) { 221 cflags_cc += [ "-DWITH_DLP" ] 222 external_deps += [ 223 "dlp_permission_service:libdlp_permission_sdk", 224 "dlp_permission_service:libdlpparse", 225 ] 226 } 227 228 defines = [] 229 230 if (ability_runtime_auto_fill) { 231 defines += [ "SUPPORT_AUTO_FILL" ] 232 } 233 234 if (ability_runtime_child_process) { 235 defines += [ "SUPPORT_CHILD_PROCESS" ] 236 } 237 238 if (ability_runtime_graphics) { 239 defines += [ "SUPPORT_GRAPHICS" ] 240 external_deps += [ 241 "ability_base:session_info", 242 "i18n:intl_util", 243 "icu:shared_icuuc", 244 "image_framework:image_native", 245 "input:libmmi-client", 246 "resource_management:global_resmgr", 247 "window_manager:libdm", 248 "window_manager:libmodal_system_ui_extension_client", 249 "window_manager:libwm", 250 "window_manager:libwsutils", 251 "window_manager:scene_session", 252 "window_manager:sms", 253 ] 254 } 255 256 if (ability_runtime_graphics && ability_runtime_screenlock_enable) { 257 defines += [ 258 "ABILITY_RUNTIME_SCREENLOCK_ENABLE" 259 ] 260 external_deps += [ 261 "screenlock_mgr:screenlock_client", 262 ] 263 } 264 265 if (ability_runtime_upms) { 266 defines += [ "SUPPORT_UPMS" ] 267 deps += [ 268 "${ability_runtime_innerkits_path}/uri_permission:uri_permission_mgr", 269 ] 270 } 271 272 if (ability_runtime_feature_sandboxmanager) { 273 defines += [ "SUPPORT_APP_SELECTOR" ] 274 } 275 276 if (include_app_domain_verify) { 277 external_deps += [ 278 "app_domain_verify:app_domain_verify_common", 279 "app_domain_verify:app_domain_verify_mgr_client", 280 ] 281 defines += [ "APP_DOMAIN_VERIFY_ENABLED" ] 282 } 283 284 if (ability_runtime_power) { 285 defines += [ "SUPPORT_POWER" ] 286 external_deps += [ "power_manager:powermgr_client" ] 287 } 288 289 if (ability_runtime_graphics && 290 ability_runtime_start_window_options_with_pixelmap) { 291 defines += [ "START_WINDOW_OPTIONS_WITH_PIXELMAP" ] 292 external_deps += [ "image_framework:image_native" ] 293 } 294 295 if (ability_runtime_no_screen) { 296 defines += [ "DISABLE_LAUNCHER" ] 297 } 298 299 version_script = "libabilityms.map" 300 subsystem_name = "ability" 301 innerapi_tags = [ "platformsdk_indirect" ] 302 part_name = "ability_runtime" 303} 304 305ohos_shared_library("wantagent_manager") { 306 sanitize = { 307 cfi = true 308 cfi_cross_dso = true 309 debug = false 310 } 311 branch_protector_ret = "pac_ret" 312 include_dirs = [ 313 "${ability_runtime_services_path}/abilitymgr/data_ability/include", 314 "${ability_runtime_services_path}/abilitymgr/include/utils", 315 "${ability_runtime_services_path}/abilitymgr/include", 316 "${ability_runtime_innerkits_path}/ability_manager/include", 317 "${ability_runtime_services_path}/common/include", 318 ] 319 320 sources = [ 321 "${ability_runtime_services_path}/abilitymgr/src/sender_info.cpp", 322 "${ability_runtime_services_path}/abilitymgr/src/want_receiver_proxy.cpp", 323 "${ability_runtime_services_path}/abilitymgr/src/want_receiver_stub.cpp", 324 "${ability_runtime_services_path}/abilitymgr/src/want_sender_info.cpp", 325 "${ability_runtime_services_path}/abilitymgr/src/want_sender_proxy.cpp", 326 "${ability_runtime_services_path}/abilitymgr/src/want_sender_stub.cpp", 327 "${ability_runtime_services_path}/abilitymgr/src/wants_info.cpp", 328 ] 329 deps = [ 330 "${ability_runtime_innerkits_path}/ability_manager:ability_start_options", 331 "${ability_runtime_innerkits_path}/error_utils:ability_runtime_error_util", 332 ] 333 334 external_deps = [ 335 "ability_base:want", 336 "c_utils:utils", 337 "hilog:libhilog", 338 "hitrace:hitrace_meter", 339 "ipc:ipc_core", 340 "samgr:samgr_proxy", 341 ] 342 343 public_external_deps = [ 344 "bundle_framework:appexecfwk_base", 345 "bundle_framework:appexecfwk_core", 346 ] 347 348 innerapi_tags = [ 349 "platformsdk", 350 "sasdk", 351 ] 352 subsystem_name = "ability" 353 part_name = "ability_runtime" 354} 355 356ohos_prebuilt_etc("ams_service_config.json") { 357 source = "resource/ams_service_config.json" 358 subsystem_name = "ability" 359 part_name = "ability_runtime" 360} 361 362ohos_prebuilt_etc("uiextension_picker_config.json") { 363 source = "resource/uiextension_picker_config.json" 364 subsystem_name = "ability" 365 part_name = "ability_runtime" 366} 367 368ohos_prebuilt_etc("deeplink_reserve_config.json") { 369 source = "resource/deeplink_reserve_config.json" 370 subsystem_name = "ability" 371 part_name = "ability_runtime" 372} 373 374ohos_prebuilt_etc("ams_extension_config.json") { 375 source = "resource/ams_extension_config.json" 376 subsystem_name = "ability" 377 part_name = "ability_runtime" 378} 379 380ohos_prebuilt_etc("start_ability_without_caller_token.json") { 381 source = "resource/start_ability_without_caller_token.json" 382 subsystem_name = "ability" 383 part_name = "ability_runtime" 384} 385 386ohos_shared_library("mission_list") { 387 sanitize = { 388 integer_overflow = true 389 ubsan = true 390 boundary_sanitize = true 391 cfi = true 392 cfi_cross_dso = true 393 cfi_vcall_icall_only = true 394 debug = false 395 } 396 branch_protector_ret = "pac_ret" 397 398 include_dirs = [ 399 "${ability_runtime_innerkits_path}/ability_manager/include", 400 "${ability_runtime_innerkits_path}/ability_manager/include/status_bar_delegate", 401 "${ability_runtime_innerkits_path}/connectionobs_manager/include", 402 "${ability_runtime_innerkits_path}/deps_wrapper/include", 403 "${ability_runtime_innerkits_path}/session_handler/include", 404 "${ability_runtime_path}/interfaces/kits/native/ability/native", 405 "${ability_runtime_path}/interfaces/kits/native/appkit/ability_bundle_manager_helper", 406 "${ability_runtime_services_path}/abilitymgr/data_ability/include", 407 "${ability_runtime_services_path}/abilitymgr/include/utils", 408 "${ability_runtime_services_path}/abilitymgr/include", 409 "${ability_runtime_services_path}/abilitymgr/include/mission", 410 "${ability_runtime_services_path}/common/include", 411 "${ability_runtime_services_path}/appdfr/include", 412 "${ability_runtime_utils_path}/global/constant", 413 "${ability_runtime_utils_path}/server/constant", 414 ] 415 416 defines = [] 417 418 if (ability_command_for_test) { 419 defines += [ "ABILITY_COMMAND_FOR_TEST" ] 420 } 421 422 if (ability_runtime_graphics) { 423 defines += [ 424 "SUPPORT_GRAPHICS", 425 "SUPPORT_SCREEN", 426 ] 427 } 428 429 cflags = [] 430 if (target_cpu == "arm") { 431 cflags += [ "-DBINDER_IPC_32BIT" ] 432 } 433 434 sources = [ 435 "src/mission/mission.cpp", 436 "src/mission/mission_data_storage.cpp", 437 "src/mission/mission_info_mgr.cpp", 438 "src/mission/mission_list.cpp", 439 "src/mission/mission_list_manager.cpp", 440 "src/task_data_persistence_mgr.cpp", 441 ] 442 443 deps = [ 444 ":abilityms", 445 "${ability_runtime_innerkits_path}/ability_manager:ability_manager", 446 "${ability_runtime_innerkits_path}/ability_manager:ability_start_options", 447 "${ability_runtime_innerkits_path}/ability_manager:ability_start_setting", 448 "${ability_runtime_innerkits_path}/ability_manager:mission_info", 449 "${ability_runtime_innerkits_path}/ability_manager:process_options", 450 "${ability_runtime_innerkits_path}/app_manager:app_manager", 451 "${ability_runtime_native_path}/ability/native:auto_startup_callback", 452 "${ability_runtime_native_path}/appkit:appkit_manager_helper", 453 "${ability_runtime_path}/utils/global/freeze:freeze_util", 454 "${ability_runtime_path}/utils/server/startup:startup_util", 455 "${ability_runtime_services_path}/common:app_util", 456 "${ability_runtime_services_path}/common:event_report", 457 "${ability_runtime_services_path}/common:perm_verification", 458 "${ability_runtime_services_path}/common:res_sched_util", 459 "${ability_runtime_services_path}/common:task_handler_wrap", 460 ] 461 462 external_deps = [ 463 "ability_base:base", 464 "ability_base:configuration", 465 "ability_base:session_info", 466 "ability_base:view_data", 467 "ability_base:want", 468 "ability_base:zuri", 469 "access_token:libaccesstoken_sdk", 470 "access_token:libtokenid_sdk", 471 "background_task_mgr:bgtaskmgr_innerkits", 472 "bundle_framework:appexecfwk_base", 473 "bundle_framework:appexecfwk_core", 474 "bundle_framework:libappexecfwk_common", 475 "c_utils:utils", 476 "common_event_service:cesfwk_innerkits", 477 "config_policy:configpolicy_util", 478 "dsoftbus:softbus_client", 479 "eventhandler:libeventhandler", 480 "ffrt:libffrt", 481 "graphic_2d:color_manager", 482 "hicollie:libhicollie", 483 "hilog:libhilog", 484 "hisysevent:libhisysevent", 485 "hitrace:hitrace_meter", 486 "icu:shared_icuuc", 487 "init:libbeget_proxy", 488 "init:libbegetutil", 489 "ipc:ipc_core", 490 "json:nlohmann_json_static", 491 "kv_store:distributeddata_inner", 492 "os_account:os_account_innerkits", 493 "relational_store:native_appdatafwk", 494 "relational_store:native_dataability", 495 "relational_store:native_rdb", 496 "safwk:system_ability_fwk", 497 "samgr:samgr_proxy", 498 ] 499 500 if (ability_runtime_child_process) { 501 defines += [ "SUPPORT_CHILD_PROCESS" ] 502 } 503 504 if (background_task_mgr_continuous_task_enable) { 505 external_deps += [ "background_task_mgr:bgtaskmgr_innerkits" ] 506 } 507 508 if (os_dlp_part_enabled) { 509 defines += [ "WITH_DLP" ] 510 external_deps += [ "dlp_permission_service:libdlp_permission_sdk" ] 511 } 512 513 if (ability_runtime_graphics) { 514 external_deps += [ 515 "ability_base:session_info", 516 "i18n:intl_util", 517 "image_framework:image_native", 518 "resource_management:global_resmgr", 519 "window_manager:libdm", 520 "window_manager:libwm", 521 ] 522 } 523 524 if (ability_runtime_upms) { 525 defines += [ "SUPPORT_UPMS" ] 526 deps += [ 527 "${ability_runtime_innerkits_path}/uri_permission:uri_permission_mgr", 528 ] 529 } 530 531 cflags_cc = [] 532 if (os_dlp_part_enabled) { 533 cflags_cc += [ "-DWITH_DLP" ] 534 } 535 536 subsystem_name = "ability" 537 innerapi_tags = [ "platformsdk_indirect" ] 538 part_name = "ability_runtime" 539} 540 541group("ams_service_config") { 542 deps = [ 543 ":ams_service_config.json", 544 ":deeplink_reserve_config.json", 545 ":start_ability_without_caller_token.json", 546 ":uiextension_picker_config.json", 547 ] 548} 549