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/group_listener.cpp", 41 "native/src/conditions/network_listener.cpp", 42 "native/src/conditions/storage_listener.cpp", 43 "native/src/conditions/timer_listener.cpp", 44 "native/src/event_publisher.cpp", 45 "native/src/policy/app_data_clear_listener.cpp", 46 "native/src/policy/memory_policy.cpp", 47 "native/src/policy/thermal_policy.cpp", 48 "native/src/scheduler_bg_task_subscriber.cpp", 49 "native/src/watchdog.cpp", 50 "native/src/work_bundle_group_change_callback.cpp", 51 "native/src/work_conn_manager.cpp", 52 "native/src/work_event_handler.cpp", 53 "native/src/work_policy_manager.cpp", 54 "native/src/work_queue.cpp", 55 "native/src/work_queue_event_handler.cpp", 56 "native/src/work_queue_manager.cpp", 57 "native/src/work_scheduler_connection.cpp", 58 "native/src/work_scheduler_service.cpp", 59 "native/src/work_standby_state_change_callback.cpp", 60 "native/src/work_status.cpp", 61 "zidl/src/work_sched_service_stub.cpp", 62 "zidl/src/work_scheduler_proxy.cpp", 63 ] 64 65 configs = [ ":worksched_private_config" ] 66 67 public_configs = [ ":worksched_public_config" ] 68 69 deps = [ 70 "${worksched_frameworks_path}:workschedclient", 71 "${worksched_utils_path}:workschedutils", 72 ] 73 74 external_deps = [ 75 "ability_base:want", 76 "ability_runtime:ability_manager", 77 "ability_runtime:wantagent_innerkits", 78 "access_token:libaccesstoken_sdk", 79 "access_token:libtokenid_sdk", 80 "bundle_framework:appexecfwk_base", 81 "bundle_framework:appexecfwk_core", 82 "c_utils:utils", 83 "common_event_service:cesfwk_innerkits", 84 "eventhandler:libeventhandler", 85 "hilog:libhilog", 86 "hisysevent:libhisysevent", 87 "init:libbegetutil", 88 "ipc:ipc_single", 89 "safwk:system_ability_fwk", 90 "samgr:samgr_proxy", 91 "time_service:time_client", 92 ] 93 94 defines = [] 95 if (bundle_active_enable) { 96 external_deps += [ "device_usage_statistics:usagestatsinner" ] 97 defines += [ "DEVICE_USAGE_STATISTICS_ENABLE" ] 98 } 99 if (device_standby_enable) { 100 external_deps += [ "device_standby:standby_innerkits" ] 101 defines += [ "DEVICE_STANDBY_ENABLE" ] 102 } 103 if (resourceschedule_bgtaskmgr_enable) { 104 external_deps += [ "background_task_mgr:bgtaskmgr_innerkits" ] 105 defines += [ "RESOURCESCHEDULE_BGTASKMGR_ENABLE" ] 106 } 107 if (powermgr_battery_manager_enable) { 108 external_deps += [ "battery_manager:batterysrv_client" ] 109 defines += [ "POWERMGR_BATTERY_MANAGER_ENABLE" ] 110 } 111 if (powermgr_thermal_manager_enable) { 112 external_deps += [ "thermal_manager:thermalsrv_client" ] 113 defines += [ "POWERMGR_THERMAL_MANAGER_ENABLE" ] 114 } 115 if (workscheduler_with_communication_netmanager_base_enable) { 116 defines += [ "COMMUNICATION_NETMANAGER_BASE_ENABLE" ] 117 external_deps += [ "netmanager_base:net_conn_manager_if" ] 118 } 119 subsystem_name = "resourceschedule" 120 part_name = "${worksched_native_part_name}" 121} 122 123ohos_static_library("workschedservice_static") { 124 sources = [ 125 "native/src/conditions/battery_level_listener.cpp", 126 "native/src/conditions/battery_status_listener.cpp", 127 "native/src/conditions/charger_listener.cpp", 128 "native/src/conditions/group_listener.cpp", 129 "native/src/conditions/network_listener.cpp", 130 "native/src/conditions/storage_listener.cpp", 131 "native/src/conditions/timer_listener.cpp", 132 "native/src/event_publisher.cpp", 133 "native/src/policy/app_data_clear_listener.cpp", 134 "native/src/policy/memory_policy.cpp", 135 "native/src/policy/thermal_policy.cpp", 136 "native/src/scheduler_bg_task_subscriber.cpp", 137 "native/src/watchdog.cpp", 138 "native/src/work_bundle_group_change_callback.cpp", 139 "native/src/work_conn_manager.cpp", 140 "native/src/work_event_handler.cpp", 141 "native/src/work_policy_manager.cpp", 142 "native/src/work_queue.cpp", 143 "native/src/work_queue_event_handler.cpp", 144 "native/src/work_queue_manager.cpp", 145 "native/src/work_scheduler_connection.cpp", 146 "native/src/work_scheduler_service.cpp", 147 "native/src/work_standby_state_change_callback.cpp", 148 "native/src/work_status.cpp", 149 "zidl/src/work_sched_service_stub.cpp", 150 "zidl/src/work_scheduler_proxy.cpp", 151 ] 152 153 configs = [ ":worksched_private_config" ] 154 155 public_configs = [ ":worksched_public_config" ] 156 157 deps = [ 158 "${worksched_frameworks_path}:workschedclient", 159 "${worksched_utils_path}:workschedutils", 160 ] 161 162 external_deps = [ 163 "ability_base:want", 164 "ability_runtime:ability_manager", 165 "ability_runtime:wantagent_innerkits", 166 "access_token:libaccesstoken_sdk", 167 "access_token:libtokenid_sdk", 168 "bundle_framework:appexecfwk_base", 169 "bundle_framework:appexecfwk_core", 170 "c_utils:utils", 171 "common_event_service:cesfwk_innerkits", 172 "eventhandler:libeventhandler", 173 "hilog:libhilog", 174 "hisysevent:libhisysevent", 175 "init:libbegetutil", 176 "ipc:ipc_single", 177 "safwk:system_ability_fwk", 178 "samgr:samgr_proxy", 179 "time_service:time_client", 180 ] 181 182 defines = [] 183 if (bundle_active_enable) { 184 external_deps += [ "device_usage_statistics:usagestatsinner" ] 185 defines += [ "DEVICE_USAGE_STATISTICS_ENABLE" ] 186 } 187 if (device_standby_enable) { 188 external_deps += [ "device_standby:standby_innerkits" ] 189 defines += [ "DEVICE_STANDBY_ENABLE" ] 190 } 191 if (resourceschedule_bgtaskmgr_enable) { 192 external_deps += [ "background_task_mgr:bgtaskmgr_innerkits" ] 193 defines += [ "RESOURCESCHEDULE_BGTASKMGR_ENABLE" ] 194 } 195 if (powermgr_battery_manager_enable) { 196 external_deps += [ "battery_manager:batterysrv_client" ] 197 defines += [ "POWERMGR_BATTERY_MANAGER_ENABLE" ] 198 } 199 if (powermgr_thermal_manager_enable) { 200 external_deps += [ "thermal_manager:thermalsrv_client" ] 201 defines += [ "POWERMGR_THERMAL_MANAGER_ENABLE" ] 202 } 203 if (workscheduler_with_communication_netmanager_base_enable) { 204 defines += [ "COMMUNICATION_NETMANAGER_BASE_ENABLE" ] 205 external_deps += [ "netmanager_base:net_conn_manager_if" ] 206 } 207 subsystem_name = "resourceschedule" 208 part_name = "${worksched_native_part_name}" 209} 210