1eace7efcSopenharmony_ci# Copyright (c) 2021-2024 Huawei Device Co., Ltd. 2eace7efcSopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License"); 3eace7efcSopenharmony_ci# you may not use this file except in compliance with the License. 4eace7efcSopenharmony_ci# You may obtain a copy of the License at 5eace7efcSopenharmony_ci# 6eace7efcSopenharmony_ci# http://www.apache.org/licenses/LICENSE-2.0 7eace7efcSopenharmony_ci# 8eace7efcSopenharmony_ci# Unless required by applicable law or agreed to in writing, software 9eace7efcSopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS, 10eace7efcSopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11eace7efcSopenharmony_ci# See the License for the specific language governing permissions and 12eace7efcSopenharmony_ci# limitations under the License. 13eace7efcSopenharmony_ci 14eace7efcSopenharmony_ciimport("//build/ohos.gni") 15eace7efcSopenharmony_ciimport("//foundation/ability/ability_runtime/ability_runtime.gni") 16eace7efcSopenharmony_ci 17eace7efcSopenharmony_ciconfig("appmgr_config") { 18eace7efcSopenharmony_ci include_dirs = [ 19eace7efcSopenharmony_ci "include", 20eace7efcSopenharmony_ci "include/utils", 21eace7efcSopenharmony_ci "${ability_runtime_innerkits_path}/ability_manager/include", 22eace7efcSopenharmony_ci "${ability_runtime_services_path}/common/include", 23eace7efcSopenharmony_ci "${ability_runtime_path}/tools/aa/include", 24eace7efcSopenharmony_ci "${ability_runtime_path}/utils/global/time/include", 25eace7efcSopenharmony_ci "${ability_runtime_path}/interfaces/kits/native/appkit/ability_bundle_manager_helper", 26eace7efcSopenharmony_ci "${ability_runtime_utils_path}/global/constant", 27eace7efcSopenharmony_ci ] 28eace7efcSopenharmony_ci} 29eace7efcSopenharmony_ci 30eace7efcSopenharmony_cigroup("appms_target") { 31eace7efcSopenharmony_ci deps = [ ":libappms" ] 32eace7efcSopenharmony_ci} 33eace7efcSopenharmony_ci 34eace7efcSopenharmony_ciohos_shared_library("libappms") { 35eace7efcSopenharmony_ci sanitize = { 36eace7efcSopenharmony_ci cfi = true 37eace7efcSopenharmony_ci cfi_cross_dso = true 38eace7efcSopenharmony_ci debug = false 39eace7efcSopenharmony_ci } 40eace7efcSopenharmony_ci branch_protector_ret = "pac_ret" 41eace7efcSopenharmony_ci shlib_type = "sa" 42eace7efcSopenharmony_ci include_dirs = [ "${ability_runtime_services_path}/appdfr/include" ] 43eace7efcSopenharmony_ci sources = [ 44eace7efcSopenharmony_ci "${ability_runtime_path}/tools/aa/src/shell_command_result.cpp", 45eace7efcSopenharmony_ci "${ability_runtime_path}/tools/aa/src/test_observer_proxy.cpp", 46eace7efcSopenharmony_ci "src/ability_running_record.cpp", 47eace7efcSopenharmony_ci "src/advanced_security_mode_manager.cpp", 48eace7efcSopenharmony_ci "src/ams_mgr_scheduler.cpp", 49eace7efcSopenharmony_ci "src/app_config_data_manager.cpp", 50eace7efcSopenharmony_ci "src/app_death_recipient.cpp", 51eace7efcSopenharmony_ci "src/app_debug_manager.cpp", 52eace7efcSopenharmony_ci "src/app_lifecycle_deal.cpp", 53eace7efcSopenharmony_ci "src/app_mgr_event.cpp", 54eace7efcSopenharmony_ci "src/app_mgr_service.cpp", 55eace7efcSopenharmony_ci "src/app_mgr_service_event_handler.cpp", 56eace7efcSopenharmony_ci "src/app_mgr_service_inner.cpp", 57eace7efcSopenharmony_ci "src/app_preloader.cpp", 58eace7efcSopenharmony_ci "src/app_running_manager.cpp", 59eace7efcSopenharmony_ci "src/app_running_record.cpp", 60eace7efcSopenharmony_ci "src/app_running_status_module.cpp", 61eace7efcSopenharmony_ci "src/app_spawn_client.cpp", 62eace7efcSopenharmony_ci "src/app_state_observer_manager.cpp", 63eace7efcSopenharmony_ci "src/cache_process_manager.cpp", 64eace7efcSopenharmony_ci "src/child_process_record.cpp", 65eace7efcSopenharmony_ci "src/exit_resident_process_manager.cpp", 66eace7efcSopenharmony_ci "src/modal_system_app_freeze_uiextension.cpp", 67eace7efcSopenharmony_ci "src/module_running_record.cpp", 68eace7efcSopenharmony_ci "src/quick_fix_callback_with_record.cpp", 69eace7efcSopenharmony_ci "src/remote_client_manager.cpp", 70eace7efcSopenharmony_ci "src/render_state_observer_manager.cpp", 71eace7efcSopenharmony_ci "src/user_record_manager.cpp", 72eace7efcSopenharmony_ci "src/window_focus_changed_listener.cpp", 73eace7efcSopenharmony_ci "src/window_pid_visibility_changed_listener.cpp", 74eace7efcSopenharmony_ci "src/window_visibility_changed_listener.cpp", 75eace7efcSopenharmony_ci ] 76eace7efcSopenharmony_ci 77eace7efcSopenharmony_ci defines = [ "AMS_LOG_TAG = \"AppMgrService\"" ] 78eace7efcSopenharmony_ci defines += [ "AMS_LOG_DOMAIN = 0xD001303" ] 79eace7efcSopenharmony_ci defines += [ "OHOS_ACCOUNT_ENABLED" ] 80eace7efcSopenharmony_ci defines += [ "INCLUDE_ZURI" ] 81eace7efcSopenharmony_ci 82eace7efcSopenharmony_ci if (product_name != "ohcore") { 83eace7efcSopenharmony_ci defines += [ "APP_MGR_SERVICE_APPMS" ] 84eace7efcSopenharmony_ci } 85eace7efcSopenharmony_ci 86eace7efcSopenharmony_ci if (ability_command_for_test) { 87eace7efcSopenharmony_ci defines += [ "ABILITY_COMMAND_FOR_TEST" ] 88eace7efcSopenharmony_ci } 89eace7efcSopenharmony_ci 90eace7efcSopenharmony_ci if (ability_fault_and_exit_test) { 91eace7efcSopenharmony_ci defines += [ "ABILITY_FAULT_AND_EXIT_TEST" ] 92eace7efcSopenharmony_ci } 93eace7efcSopenharmony_ci 94eace7efcSopenharmony_ci configs = [ ":appmgr_config" ] 95eace7efcSopenharmony_ci cflags = [] 96eace7efcSopenharmony_ci if (target_cpu == "arm") { 97eace7efcSopenharmony_ci cflags += [ "-DBINDER_IPC_32BIT" ] 98eace7efcSopenharmony_ci } 99eace7efcSopenharmony_ci deps = [ 100eace7efcSopenharmony_ci "${ability_runtime_innerkits_path}/ability_manager:ability_manager", 101eace7efcSopenharmony_ci "${ability_runtime_innerkits_path}/app_manager:app_manager", 102eace7efcSopenharmony_ci "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper", 103eace7efcSopenharmony_ci "${ability_runtime_innerkits_path}/uri_permission:uri_permission_mgr", 104eace7efcSopenharmony_ci "${ability_runtime_native_path}/appkit:appkit_manager_helper", 105eace7efcSopenharmony_ci "${ability_runtime_path}/utils/global/freeze:freeze_util", 106eace7efcSopenharmony_ci "${ability_runtime_path}/utils/server/startup:startup_util", 107eace7efcSopenharmony_ci "${ability_runtime_services_path}/common:app_util", 108eace7efcSopenharmony_ci "${ability_runtime_services_path}/common:event_report", 109eace7efcSopenharmony_ci "${ability_runtime_services_path}/common:perm_verification", 110eace7efcSopenharmony_ci "${ability_runtime_services_path}/common:res_sched_util", 111eace7efcSopenharmony_ci "${ability_runtime_services_path}/common:task_handler_wrap", 112eace7efcSopenharmony_ci ] 113eace7efcSopenharmony_ci 114eace7efcSopenharmony_ci external_deps = [ 115eace7efcSopenharmony_ci "ability_base:base", 116eace7efcSopenharmony_ci "ability_base:configuration", 117eace7efcSopenharmony_ci "ability_base:want", 118eace7efcSopenharmony_ci "ability_base:zuri", 119eace7efcSopenharmony_ci "access_token:libaccesstoken_sdk", 120eace7efcSopenharmony_ci "appspawn:appspawn_client", 121eace7efcSopenharmony_ci "bundle_framework:appexecfwk_base", 122eace7efcSopenharmony_ci "bundle_framework:appexecfwk_core", 123eace7efcSopenharmony_ci "c_utils:utils", 124eace7efcSopenharmony_ci "common_event_service:cesfwk_innerkits", 125eace7efcSopenharmony_ci "ffrt:libffrt", 126eace7efcSopenharmony_ci "hicollie:libhicollie", 127eace7efcSopenharmony_ci "hilog:libhilog", 128eace7efcSopenharmony_ci "hisysevent:libhisysevent", 129eace7efcSopenharmony_ci "hitrace:hitrace_meter", 130eace7efcSopenharmony_ci "init:libbeget_proxy", 131eace7efcSopenharmony_ci "init:libbegetutil", 132eace7efcSopenharmony_ci "ipc:ipc_core", 133eace7efcSopenharmony_ci "json:nlohmann_json_static", 134eace7efcSopenharmony_ci "kv_store:distributeddata_inner", 135eace7efcSopenharmony_ci "memmgr:memmgrclient", 136eace7efcSopenharmony_ci "memory_utils:libmeminfo", 137eace7efcSopenharmony_ci "os_account:libaccountkits", 138eace7efcSopenharmony_ci "resource_schedule_service:ressched_client", 139eace7efcSopenharmony_ci "safwk:system_ability_fwk", 140eace7efcSopenharmony_ci "samgr:samgr_proxy", 141eace7efcSopenharmony_ci ] 142eace7efcSopenharmony_ci public_external_deps = [ "kv_store:distributeddata_mgr" ] 143eace7efcSopenharmony_ci 144eace7efcSopenharmony_ci if (product_name != "ohcore") { 145eace7efcSopenharmony_ci external_deps += [ "netmanager_base:net_conn_manager_if" ] 146eace7efcSopenharmony_ci } 147eace7efcSopenharmony_ci 148eace7efcSopenharmony_ci if (ability_runtime_feature_sandboxmanager) { 149eace7efcSopenharmony_ci external_deps += [ "sandbox_manager:libsandbox_manager_sdk" ] 150eace7efcSopenharmony_ci defines += [ "ABILITY_RUNTIME_FEATURE_SANDBOXMANAGER" ] 151eace7efcSopenharmony_ci } 152eace7efcSopenharmony_ci 153eace7efcSopenharmony_ci if (ability_runtime_graphics) { 154eace7efcSopenharmony_ci defines += [ 155eace7efcSopenharmony_ci "SUPPORT_GRAPHICS", 156eace7efcSopenharmony_ci "SUPPORT_SCREEN", 157eace7efcSopenharmony_ci ] 158eace7efcSopenharmony_ci 159eace7efcSopenharmony_ci deps += [] 160eace7efcSopenharmony_ci external_deps += [ 161eace7efcSopenharmony_ci "i18n:intl_util", 162eace7efcSopenharmony_ci "window_manager:libwm", 163eace7efcSopenharmony_ci "window_manager:libwsutils", 164eace7efcSopenharmony_ci ] 165eace7efcSopenharmony_ci } 166eace7efcSopenharmony_ci cflags_cc = [] 167eace7efcSopenharmony_ci if (os_dlp_part_enabled) { 168eace7efcSopenharmony_ci cflags_cc += [ "-DWITH_DLP" ] 169eace7efcSopenharmony_ci } 170eace7efcSopenharmony_ci if (background_task_mgr_continuous_task_enable) { 171eace7efcSopenharmony_ci defines += [ "BGTASKMGR_CONTINUOUS_TASK_ENABLE" ] 172eace7efcSopenharmony_ci } 173eace7efcSopenharmony_ci 174eace7efcSopenharmony_ci if (is_asan || asan_detector) { 175eace7efcSopenharmony_ci defines += [ "SUPPORT_ASAN" ] 176eace7efcSopenharmony_ci } 177eace7efcSopenharmony_ci 178eace7efcSopenharmony_ci if (ability_runtime_app_no_response_dialog) { 179eace7efcSopenharmony_ci defines += [ "APP_NO_RESPONSE_DIALOG" ] 180eace7efcSopenharmony_ci } 181eace7efcSopenharmony_ci cflags += [ "-DAPP_NO_RESPONSE_BUNDLENAME=\"${ability_runtime_app_no_response_bundlename}\"" ] 182eace7efcSopenharmony_ci 183eace7efcSopenharmony_ci version_script = "libappms.map" 184eace7efcSopenharmony_ci subsystem_name = "ability" 185eace7efcSopenharmony_ci part_name = "ability_runtime" 186eace7efcSopenharmony_ci} 187