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 30 sources = [ 31 "native/src/conditions/battery_level_listener.cpp", 32 "native/src/conditions/battery_status_listener.cpp", 33 "native/src/conditions/charger_listener.cpp", 34 "native/src/conditions/group_listener.cpp", 35 "native/src/conditions/network_listener.cpp", 36 "native/src/conditions/storage_listener.cpp", 37 "native/src/conditions/timer_listener.cpp", 38 "native/src/event_publisher.cpp", 39 "native/src/policy/app_data_clear_listener.cpp", 40 "native/src/policy/memory_policy.cpp", 41 "native/src/policy/thermal_policy.cpp", 42 "native/src/scheduler_bg_task_subscriber.cpp", 43 "native/src/watchdog.cpp", 44 "native/src/work_bundle_group_change_callback.cpp", 45 "native/src/work_conn_manager.cpp", 46 "native/src/work_event_handler.cpp", 47 "native/src/work_policy_manager.cpp", 48 "native/src/work_queue.cpp", 49 "native/src/work_queue_event_handler.cpp", 50 "native/src/work_queue_manager.cpp", 51 "native/src/work_scheduler_connection.cpp", 52 "native/src/work_scheduler_service.cpp", 53 "native/src/work_standby_state_change_callback.cpp", 54 "native/src/work_status.cpp", 55 "zidl/src/work_sched_service_stub.cpp", 56 "zidl/src/work_scheduler_proxy.cpp", 57 ] 58 59 configs = [ ":worksched_private_config" ] 60 61 public_configs = [ ":worksched_public_config" ] 62 63 deps = [ 64 "${worksched_frameworks_path}:workschedclient", 65 "${worksched_utils_path}:workschedutils", 66 ] 67 68 external_deps = [ 69 "ability_base:want", 70 "ability_runtime:ability_manager", 71 "ability_runtime:wantagent_innerkits", 72 "bundle_framework:appexecfwk_base", 73 "bundle_framework:appexecfwk_core", 74 "c_utils:utils", 75 "common_event_service:cesfwk_innerkits", 76 "eventhandler:libeventhandler", 77 "hilog:libhilog", 78 "hisysevent:libhisysevent", 79 "ipc:ipc_single", 80 "safwk:system_ability_fwk", 81 "samgr:samgr_proxy", 82 "time_service:time_client", 83 ] 84 85 defines = [] 86 if (bundle_active_enable) { 87 external_deps += [ "device_usage_statistics:usagestatsinner" ] 88 defines += [ "DEVICE_USAGE_STATISTICS_ENABLE" ] 89 } 90 if (device_standby_enable) { 91 external_deps += [ "device_standby:standby_innerkits" ] 92 defines += [ "DEVICE_STANDBY_ENABLE" ] 93 } 94 if (resourceschedule_bgtaskmgr_enable) { 95 external_deps += [ "background_task_mgr:bgtaskmgr_innerkits" ] 96 defines += [ "RESOURCESCHEDULE_BGTASKMGR_ENABLE" ] 97 } 98 if (powermgr_battery_manager_enable) { 99 external_deps += [ "battery_manager:batterysrv_client" ] 100 defines += [ "POWERMGR_BATTERY_MANAGER_ENABLE" ] 101 } 102 if (powermgr_thermal_manager_enable) { 103 external_deps += [ "thermal_manager:thermalsrv_client" ] 104 defines += [ "POWERMGR_THERMAL_MANAGER_ENABLE" ] 105 } 106 if (workscheduler_with_communication_netmanager_base_enable) { 107 defines += [ "COMMUNICATION_NETMANAGER_BASE_ENABLE" ] 108 external_deps += [ "netmanager_base:net_conn_manager_if" ] 109 } 110 subsystem_name = "resourceschedule" 111 part_name = "${worksched_native_part_name}" 112} 113