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("//foundation/resourceschedule/work_scheduler/workscheduler.gni") 15 16config("worksched_private_config") { 17 include_dirs = [ 18 "${worksched_service_path}/zidl/include", 19 "${worksched_frameworks_path}/extension/include", 20 ] 21} 22 23config("worksched_public_config") { 24 include_dirs = [ "native/include" ] 25} 26 27ohos_shared_library("workschedservice") { 28 shlib_type = "sa" 29 branch_protector_ret = "pac_ret" 30 31 sanitize = { 32 cfi = true 33 cfi_cross_dso = true 34 debug = false 35 } 36 sources = [ 37 "native/src/conditions/battery_level_listener.cpp", 38 "native/src/conditions/battery_status_listener.cpp", 39 "native/src/conditions/charger_listener.cpp", 40 "native/src/conditions/condition_checker.cpp", 41 "native/src/conditions/group_listener.cpp", 42 "native/src/conditions/network_listener.cpp", 43 "native/src/conditions/screen_listener.cpp", 44 "native/src/conditions/storage_listener.cpp", 45 "native/src/conditions/timer_listener.cpp", 46 "native/src/event_publisher.cpp", 47 "native/src/policy/app_data_clear_listener.cpp", 48 "native/src/policy/cpu_policy.cpp", 49 "native/src/policy/memory_policy.cpp", 50 "native/src/policy/thermal_policy.cpp", 51 "native/src/scheduler_bg_task_subscriber.cpp", 52 "native/src/watchdog.cpp", 53 "native/src/work_bundle_group_change_callback.cpp", 54 "native/src/work_conn_manager.cpp", 55 "native/src/work_datashare_helper.cpp", 56 "native/src/work_event_handler.cpp", 57 "native/src/work_policy_manager.cpp", 58 "native/src/work_queue.cpp", 59 "native/src/work_queue_event_handler.cpp", 60 "native/src/work_queue_manager.cpp", 61 "native/src/work_sched_config.cpp", 62 "native/src/work_sched_data_manager.cpp", 63 "native/src/work_scheduler_connection.cpp", 64 "native/src/work_scheduler_service.cpp", 65 "native/src/work_standby_state_change_callback.cpp", 66 "native/src/work_status.cpp", 67 ] 68 69 configs = [ ":worksched_private_config" ] 70 71 public_configs = [ ":worksched_public_config" ] 72 73 deps = [ 74 "${worksched_frameworks_path}:work_sched_service_stub", 75 "${worksched_frameworks_path}:workschedclient", 76 "${worksched_utils_path}:workschedutils", 77 "${worksched_zidl_path}:workschedservice_zidl_proxy", 78 ] 79 80 external_deps = [ 81 "ability_base:want", 82 "ability_base:zuri", 83 "ability_runtime:ability_connect_callback_stub", 84 "ability_runtime:ability_manager", 85 "ability_runtime:wantagent_innerkits", 86 "access_token:libaccesstoken_sdk", 87 "access_token:libtokenid_sdk", 88 "bundle_framework:appexecfwk_base", 89 "bundle_framework:appexecfwk_core", 90 "c_utils:utils", 91 "common_event_service:cesfwk_innerkits", 92 "config_policy:configpolicy_util", 93 "data_share:datashare_consumer", 94 "eventhandler:libeventhandler", 95 "ffrt:libffrt", 96 "hilog:libhilog", 97 "hisysevent:libhisysevent", 98 "hitrace:hitrace_meter", 99 "hiview:libucollection_client", 100 "init:libbegetutil", 101 "ipc:ipc_single", 102 "resource_schedule_service:ressched_client", 103 "safwk:system_ability_fwk", 104 "samgr:samgr_proxy", 105 "time_service:time_client", 106 ] 107 108 defines = [] 109 if (bundle_active_enable) { 110 external_deps += [ "device_usage_statistics:usagestatsinner" ] 111 defines += [ "DEVICE_USAGE_STATISTICS_ENABLE" ] 112 } 113 if (device_standby_enable) { 114 external_deps += [ "device_standby:standby_innerkits" ] 115 defines += [ "DEVICE_STANDBY_ENABLE" ] 116 } 117 if (resourceschedule_bgtaskmgr_enable) { 118 external_deps += [ "background_task_mgr:bgtaskmgr_innerkits" ] 119 defines += [ "RESOURCESCHEDULE_BGTASKMGR_ENABLE" ] 120 } 121 if (powermgr_battery_manager_enable) { 122 external_deps += [ "battery_manager:batterysrv_client" ] 123 defines += [ "POWERMGR_BATTERY_MANAGER_ENABLE" ] 124 } 125 if (powermgr_thermal_manager_enable) { 126 external_deps += [ "thermal_manager:thermalsrv_client" ] 127 defines += [ "POWERMGR_THERMAL_MANAGER_ENABLE" ] 128 } 129 if (powermgr_power_manager_enable) { 130 external_deps += [ "power_manager:powermgr_client" ] 131 defines += [ "POWERMGR_POWER_MANAGER_ENABLE" ] 132 sources += [ "native/src/policy/power_mode_policy.cpp" ] 133 } 134 if (workscheduler_with_communication_netmanager_base_enable) { 135 defines += [ "COMMUNICATION_NETMANAGER_BASE_ENABLE" ] 136 external_deps += [ "netmanager_base:net_conn_manager_if" ] 137 } 138 if (workscheduler_hicollie_enable) { 139 external_deps += [ "hicollie:libhicollie" ] 140 defines += [ "HICOLLIE_ENABLE" ] 141 } 142 subsystem_name = "resourceschedule" 143 part_name = "${worksched_native_part_name}" 144} 145 146ohos_static_library("workschedservice_static") { 147 sanitize = { 148 cfi = true 149 cfi_cross_dso = true 150 debug = false 151 } 152 sources = [ 153 "native/src/conditions/battery_level_listener.cpp", 154 "native/src/conditions/battery_status_listener.cpp", 155 "native/src/conditions/charger_listener.cpp", 156 "native/src/conditions/condition_checker.cpp", 157 "native/src/conditions/group_listener.cpp", 158 "native/src/conditions/network_listener.cpp", 159 "native/src/conditions/screen_listener.cpp", 160 "native/src/conditions/storage_listener.cpp", 161 "native/src/conditions/timer_listener.cpp", 162 "native/src/event_publisher.cpp", 163 "native/src/policy/app_data_clear_listener.cpp", 164 "native/src/policy/cpu_policy.cpp", 165 "native/src/policy/memory_policy.cpp", 166 "native/src/policy/thermal_policy.cpp", 167 "native/src/scheduler_bg_task_subscriber.cpp", 168 "native/src/watchdog.cpp", 169 "native/src/work_bundle_group_change_callback.cpp", 170 "native/src/work_conn_manager.cpp", 171 "native/src/work_datashare_helper.cpp", 172 "native/src/work_event_handler.cpp", 173 "native/src/work_policy_manager.cpp", 174 "native/src/work_queue.cpp", 175 "native/src/work_queue_event_handler.cpp", 176 "native/src/work_queue_manager.cpp", 177 "native/src/work_sched_config.cpp", 178 "native/src/work_sched_data_manager.cpp", 179 "native/src/work_scheduler_connection.cpp", 180 "native/src/work_scheduler_service.cpp", 181 "native/src/work_standby_state_change_callback.cpp", 182 "native/src/work_status.cpp", 183 ] 184 185 configs = [ ":worksched_private_config" ] 186 187 public_configs = [ ":worksched_public_config" ] 188 189 deps = [ 190 "${worksched_frameworks_path}:work_sched_service_stub", 191 "${worksched_frameworks_path}:workschedclient", 192 "${worksched_utils_path}:workschedutils", 193 "${worksched_zidl_path}:workschedservice_zidl_proxy", 194 ] 195 196 external_deps = [ 197 "ability_base:want", 198 "ability_base:zuri", 199 "ability_runtime:ability_manager", 200 "ability_runtime:wantagent_innerkits", 201 "access_token:libaccesstoken_sdk", 202 "access_token:libtokenid_sdk", 203 "bundle_framework:appexecfwk_base", 204 "bundle_framework:appexecfwk_core", 205 "c_utils:utils", 206 "common_event_service:cesfwk_innerkits", 207 "config_policy:configpolicy_util", 208 "data_share:datashare_consumer", 209 "eventhandler:libeventhandler", 210 "ffrt:libffrt", 211 "hilog:libhilog", 212 "hisysevent:libhisysevent", 213 "hitrace:hitrace_meter", 214 "hiview:libucollection_client", 215 "init:libbegetutil", 216 "ipc:ipc_single", 217 "resource_schedule_service:ressched_client", 218 "safwk:system_ability_fwk", 219 "samgr:samgr_proxy", 220 "time_service:time_client", 221 ] 222 223 defines = [ "WORK_SCHEDULER_TEST" ] 224 if (bundle_active_enable) { 225 external_deps += [ "device_usage_statistics:usagestatsinner" ] 226 defines += [ "DEVICE_USAGE_STATISTICS_ENABLE" ] 227 } 228 if (device_standby_enable) { 229 external_deps += [ "device_standby:standby_innerkits" ] 230 defines += [ "DEVICE_STANDBY_ENABLE" ] 231 } 232 if (resourceschedule_bgtaskmgr_enable) { 233 external_deps += [ "background_task_mgr:bgtaskmgr_innerkits" ] 234 defines += [ "RESOURCESCHEDULE_BGTASKMGR_ENABLE" ] 235 } 236 if (powermgr_battery_manager_enable) { 237 external_deps += [ "battery_manager:batterysrv_client" ] 238 defines += [ "POWERMGR_BATTERY_MANAGER_ENABLE" ] 239 } 240 if (powermgr_thermal_manager_enable) { 241 external_deps += [ "thermal_manager:thermalsrv_client" ] 242 defines += [ "POWERMGR_THERMAL_MANAGER_ENABLE" ] 243 } 244 if (powermgr_power_manager_enable) { 245 external_deps += [ "power_manager:powermgr_client" ] 246 defines += [ "POWERMGR_POWER_MANAGER_ENABLE" ] 247 sources += [ "native/src/policy/power_mode_policy.cpp" ] 248 } 249 if (workscheduler_with_communication_netmanager_base_enable) { 250 defines += [ "COMMUNICATION_NETMANAGER_BASE_ENABLE" ] 251 external_deps += [ "netmanager_base:net_conn_manager_if" ] 252 } 253 if (workscheduler_hicollie_enable) { 254 external_deps += [ "hicollie:libhicollie" ] 255 defines += [ "HICOLLIE_ENABLE" ] 256 } 257 258 subsystem_name = "resourceschedule" 259 part_name = "${worksched_native_part_name}" 260} 261