# Copyright (c) 2022 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//foundation/resourceschedule/work_scheduler/workscheduler.gni") config("worksched_private_config") { include_dirs = [ "${worksched_service_path}/zidl/include", "${worksched_frameworks_path}/extension/include", ] } config("worksched_public_config") { include_dirs = [ "native/include" ] } ohos_shared_library("workschedservice") { shlib_type = "sa" branch_protector_ret = "pac_ret" sanitize = { cfi = true cfi_cross_dso = true debug = false } sources = [ "native/src/conditions/battery_level_listener.cpp", "native/src/conditions/battery_status_listener.cpp", "native/src/conditions/charger_listener.cpp", "native/src/conditions/condition_checker.cpp", "native/src/conditions/group_listener.cpp", "native/src/conditions/network_listener.cpp", "native/src/conditions/screen_listener.cpp", "native/src/conditions/storage_listener.cpp", "native/src/conditions/timer_listener.cpp", "native/src/event_publisher.cpp", "native/src/policy/app_data_clear_listener.cpp", "native/src/policy/cpu_policy.cpp", "native/src/policy/memory_policy.cpp", "native/src/policy/thermal_policy.cpp", "native/src/scheduler_bg_task_subscriber.cpp", "native/src/watchdog.cpp", "native/src/work_bundle_group_change_callback.cpp", "native/src/work_conn_manager.cpp", "native/src/work_datashare_helper.cpp", "native/src/work_event_handler.cpp", "native/src/work_policy_manager.cpp", "native/src/work_queue.cpp", "native/src/work_queue_event_handler.cpp", "native/src/work_queue_manager.cpp", "native/src/work_sched_config.cpp", "native/src/work_sched_data_manager.cpp", "native/src/work_scheduler_connection.cpp", "native/src/work_scheduler_service.cpp", "native/src/work_standby_state_change_callback.cpp", "native/src/work_status.cpp", "zidl/src/work_sched_service_stub.cpp", "zidl/src/work_scheduler_proxy.cpp", ] configs = [ ":worksched_private_config" ] public_configs = [ ":worksched_public_config" ] deps = [ "${worksched_frameworks_path}:workschedclient", "${worksched_utils_path}:workschedutils", ] external_deps = [ "ability_base:want", "ability_base:zuri", "ability_runtime:ability_manager", "ability_runtime:wantagent_innerkits", "access_token:libaccesstoken_sdk", "access_token:libtokenid_sdk", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "c_utils:utils", "common_event_service:cesfwk_innerkits", "config_policy:configpolicy_util", "data_share:datashare_consumer", "eventhandler:libeventhandler", "ffrt:libffrt", "hilog:libhilog", "hisysevent:libhisysevent", "hitrace:hitrace_meter", "hiview:libucollection_client", "init:libbegetutil", "ipc:ipc_single", "resource_schedule_service:ressched_client", "safwk:system_ability_fwk", "samgr:samgr_proxy", "time_service:time_client", ] defines = [] if (bundle_active_enable) { external_deps += [ "device_usage_statistics:usagestatsinner" ] defines += [ "DEVICE_USAGE_STATISTICS_ENABLE" ] } if (device_standby_enable) { external_deps += [ "device_standby:standby_innerkits" ] defines += [ "DEVICE_STANDBY_ENABLE" ] } if (resourceschedule_bgtaskmgr_enable) { external_deps += [ "background_task_mgr:bgtaskmgr_innerkits" ] defines += [ "RESOURCESCHEDULE_BGTASKMGR_ENABLE" ] } if (powermgr_battery_manager_enable) { external_deps += [ "battery_manager:batterysrv_client" ] defines += [ "POWERMGR_BATTERY_MANAGER_ENABLE" ] } if (powermgr_thermal_manager_enable) { external_deps += [ "thermal_manager:thermalsrv_client" ] defines += [ "POWERMGR_THERMAL_MANAGER_ENABLE" ] } if (powermgr_power_manager_enable) { external_deps += [ "power_manager:powermgr_client" ] defines += [ "POWERMGR_POWER_MANAGER_ENABLE" ] sources += [ "native/src/policy/power_mode_policy.cpp" ] } if (workscheduler_with_communication_netmanager_base_enable) { defines += [ "COMMUNICATION_NETMANAGER_BASE_ENABLE" ] external_deps += [ "netmanager_base:net_conn_manager_if" ] } if (workscheduler_hicollie_enable) { external_deps += [ "hicollie:libhicollie" ] defines += [ "HICOLLIE_ENABLE" ] } subsystem_name = "resourceschedule" part_name = "${worksched_native_part_name}" } ohos_static_library("workschedservice_static") { sanitize = { cfi = true cfi_cross_dso = true debug = false } sources = [ "native/src/conditions/battery_level_listener.cpp", "native/src/conditions/battery_status_listener.cpp", "native/src/conditions/charger_listener.cpp", "native/src/conditions/condition_checker.cpp", "native/src/conditions/group_listener.cpp", "native/src/conditions/network_listener.cpp", "native/src/conditions/screen_listener.cpp", "native/src/conditions/storage_listener.cpp", "native/src/conditions/timer_listener.cpp", "native/src/event_publisher.cpp", "native/src/policy/app_data_clear_listener.cpp", "native/src/policy/cpu_policy.cpp", "native/src/policy/memory_policy.cpp", "native/src/policy/thermal_policy.cpp", "native/src/scheduler_bg_task_subscriber.cpp", "native/src/watchdog.cpp", "native/src/work_bundle_group_change_callback.cpp", "native/src/work_conn_manager.cpp", "native/src/work_datashare_helper.cpp", "native/src/work_event_handler.cpp", "native/src/work_policy_manager.cpp", "native/src/work_queue.cpp", "native/src/work_queue_event_handler.cpp", "native/src/work_queue_manager.cpp", "native/src/work_sched_config.cpp", "native/src/work_sched_data_manager.cpp", "native/src/work_scheduler_connection.cpp", "native/src/work_scheduler_service.cpp", "native/src/work_standby_state_change_callback.cpp", "native/src/work_status.cpp", "zidl/src/work_sched_service_stub.cpp", "zidl/src/work_scheduler_proxy.cpp", ] configs = [ ":worksched_private_config" ] public_configs = [ ":worksched_public_config" ] deps = [ "${worksched_frameworks_path}:workschedclient", "${worksched_utils_path}:workschedutils", ] external_deps = [ "ability_base:want", "ability_base:zuri", "ability_runtime:ability_manager", "ability_runtime:wantagent_innerkits", "access_token:libaccesstoken_sdk", "access_token:libtokenid_sdk", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "c_utils:utils", "common_event_service:cesfwk_innerkits", "config_policy:configpolicy_util", "data_share:datashare_consumer", "eventhandler:libeventhandler", "ffrt:libffrt", "hilog:libhilog", "hisysevent:libhisysevent", "hitrace:hitrace_meter", "hiview:libucollection_client", "init:libbegetutil", "ipc:ipc_single", "resource_schedule_service:ressched_client", "safwk:system_ability_fwk", "samgr:samgr_proxy", "time_service:time_client", ] defines = [ "WORK_SCHEDULER_TEST" ] if (bundle_active_enable) { external_deps += [ "device_usage_statistics:usagestatsinner" ] defines += [ "DEVICE_USAGE_STATISTICS_ENABLE" ] } if (device_standby_enable) { external_deps += [ "device_standby:standby_innerkits" ] defines += [ "DEVICE_STANDBY_ENABLE" ] } if (resourceschedule_bgtaskmgr_enable) { external_deps += [ "background_task_mgr:bgtaskmgr_innerkits" ] defines += [ "RESOURCESCHEDULE_BGTASKMGR_ENABLE" ] } if (powermgr_battery_manager_enable) { external_deps += [ "battery_manager:batterysrv_client" ] defines += [ "POWERMGR_BATTERY_MANAGER_ENABLE" ] } if (powermgr_thermal_manager_enable) { external_deps += [ "thermal_manager:thermalsrv_client" ] defines += [ "POWERMGR_THERMAL_MANAGER_ENABLE" ] } if (powermgr_power_manager_enable) { external_deps += [ "power_manager:powermgr_client" ] defines += [ "POWERMGR_POWER_MANAGER_ENABLE" ] sources += [ "native/src/policy/power_mode_policy.cpp" ] } if (workscheduler_with_communication_netmanager_base_enable) { defines += [ "COMMUNICATION_NETMANAGER_BASE_ENABLE" ] external_deps += [ "netmanager_base:net_conn_manager_if" ] } if (workscheduler_hicollie_enable) { external_deps += [ "hicollie:libhicollie" ] defines += [ "HICOLLIE_ENABLE" ] } subsystem_name = "resourceschedule" part_name = "${worksched_native_part_name}" }