1# Copyright (c) 2022 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/test.gni") 15import("//foundation/resourceschedule/background_task_mgr/bgtaskmgr.gni") 16 17config("bgtaskmgr_service_public_config") { 18 include_dirs = [ 19 "common/include", 20 "continuous_task/include", 21 "core/include", 22 "transient_task/include", 23 "test/include", 24 "efficiency_resources/include", 25 ] 26} 27 28BgTaskMgrServicecSrc = [ 29 "${bgtaskmgr_frameworks_path}/src/background_task_mgr_stub.cpp", 30 "${bgtaskmgr_frameworks_path}/src/background_task_subscriber_proxy.cpp", 31 "${bgtaskmgr_frameworks_path}/src/expired_callback_proxy.cpp", 32 "common/src/app_state_observer.cpp", 33 "common/src/bgtask_config.cpp", 34 "common/src/bundle_manager_helper.cpp", 35 "common/src/data_storage_helper.cpp", 36 "common/src/system_event_observer.cpp", 37 "common/src/time_provider.cpp", 38 "continuous_task/src/bg_continuous_task_mgr.cpp", 39 "continuous_task/src/config_change_observer.cpp", 40 "continuous_task/src/continuous_task_record.cpp", 41 "continuous_task/src/notification_tools.cpp", 42 "core/src/background_task_mgr_service.cpp", 43 "efficiency_resources/src/bg_efficiency_resources_mgr.cpp", 44 "efficiency_resources/src/resource_application_record.cpp", 45 "efficiency_resources/src/resources_subscriber_mgr.cpp", 46 "transient_task/src/bg_transient_task_mgr.cpp", 47 "transient_task/src/bgtask_common.cpp", 48 "transient_task/src/decision_maker.cpp", 49 "transient_task/src/delay_suspend_info_ex.cpp", 50 "transient_task/src/device_info_manager.cpp", 51 "transient_task/src/event_hub.cpp", 52 "transient_task/src/input_manager.cpp", 53 "transient_task/src/pkg_delay_suspend_info.cpp", 54 "transient_task/src/suspend_controller.cpp", 55 "transient_task/src/timer_manager.cpp", 56 "transient_task/src/watchdog.cpp", 57] 58 59ohos_shared_library("bgtaskmgr_service") { 60 branch_protector_ret = "pac_ret" 61 sanitize = { 62 cfi = true 63 cfi_cross_dso = true 64 debug = false 65 } 66 if (!use_clang_coverage) { 67 shlib_type = "sa" 68 } 69 70 cflags_cc = [ 71 "-fvisibility=hidden", 72 "-fdata-sections", 73 "-ffunction-sections", 74 "-fvisibility-inlines-hidden", 75 "-Os", 76 ] 77 sources = BgTaskMgrServicecSrc 78 79 public_configs = [ ":bgtaskmgr_service_public_config" ] 80 81 deps = [ "${bgtaskmgr_interfaces_path}/innerkits:bgtaskmgr_innerkits" ] 82 83 external_deps = [ 84 "ability_base:base", 85 "ability_base:configuration", 86 "ability_base:want", 87 "ability_base:zuri", 88 "ability_runtime:app_manager", 89 "ability_runtime:wantagent_innerkits", 90 "access_token:libaccesstoken_sdk", 91 "access_token:libtokenid_sdk", 92 "bundle_framework:appexecfwk_base", 93 "bundle_framework:appexecfwk_core", 94 "c_utils:utils", 95 "common_event_service:cesfwk_innerkits", 96 "config_policy:configpolicy_util", 97 "eventhandler:libeventhandler", 98 "hilog:libhilog", 99 "hisysevent:libhisysevent", 100 "hitrace:hitrace_meter", 101 "image_framework:image_native", 102 "init:libbegetutil", 103 "ipc:ipc_single", 104 "relational_store:native_rdb", 105 "resource_management:global_resmgr", 106 "safwk:system_ability_fwk", 107 "samgr:samgr_proxy", 108 ] 109 110 if (has_os_account_part) { 111 cflags_cc += [ "-DHAS_OS_ACCOUNT_PART" ] 112 external_deps += [ "os_account:os_account_innerkits" ] 113 } 114 115 if (distributed_notification_enable) { 116 cflags_cc += [ "-DDISTRIBUTED_NOTIFICATION_ENABLE" ] 117 external_deps += [ "distributed_notification_service:ans_innerkits" ] 118 sources += [ "continuous_task/src/task_notification_subscriber.cpp" ] 119 } 120 121 if (background_task_mgr_graphics) { 122 cflags_cc += [ "-DSUPPORT_GRAPHICS" ] 123 external_deps += [ 124 "i18n:intl_util", 125 "icu:shared_icuuc", 126 ] 127 } 128 129 subsystem_name = "resourceschedule" 130 part_name = "background_task_mgr" 131} 132 133ohos_static_library("bgtaskmgr_service_static") { 134 cflags_cc = [ "-DBGTASK_MGR_UNIT_TEST" ] 135 sources = BgTaskMgrServicecSrc 136 137 public_configs = [ ":bgtaskmgr_service_public_config" ] 138 139 deps = [ "${bgtaskmgr_interfaces_path}/innerkits:bgtaskmgr_innerkits" ] 140 141 external_deps = [ 142 "ability_base:base", 143 "ability_base:configuration", 144 "ability_base:want", 145 "ability_base:zuri", 146 "ability_runtime:app_manager", 147 "ability_runtime:wantagent_innerkits", 148 "access_token:libaccesstoken_sdk", 149 "access_token:libtokenid_sdk", 150 "bundle_framework:appexecfwk_base", 151 "bundle_framework:appexecfwk_core", 152 "c_utils:utils", 153 "common_event_service:cesfwk_innerkits", 154 "config_policy:configpolicy_util", 155 "eventhandler:libeventhandler", 156 "hilog:libhilog", 157 "hitrace:hitrace_meter", 158 "image_framework:image_native", 159 "init:libbegetutil", 160 "ipc:ipc_single", 161 "relational_store:native_rdb", 162 "resource_management:global_resmgr", 163 "safwk:system_ability_fwk", 164 "samgr:samgr_proxy", 165 ] 166 167 if (has_os_account_part) { 168 cflags_cc += [ "-DHAS_OS_ACCOUNT_PART" ] 169 external_deps += [ "os_account:os_account_innerkits" ] 170 } 171 172 if (distributed_notification_enable) { 173 cflags_cc += [ "-DDISTRIBUTED_NOTIFICATION_ENABLE" ] 174 external_deps += [ "distributed_notification_service:ans_innerkits" ] 175 sources += [ "continuous_task/src/task_notification_subscriber.cpp" ] 176 } 177 178 if (background_task_mgr_graphics) { 179 cflags_cc += [ "-DSUPPORT_GRAPHICS" ] 180 external_deps += [ 181 "i18n:intl_util", 182 "icu:shared_icuuc", 183 ] 184 } 185 186 subsystem_name = "resourceschedule" 187 part_name = "background_task_mgr" 188} 189