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