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