# Copyright (c) 2024 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("//build/ohos.gni") import("//foundation/resourceschedule/device_standby/standby_service.gni") config("standby_plugin_config") { include_dirs = [ "${standby_plugins_path}/ext/include", "${standby_service_constraints_path}/include", "${standby_service_message_listener_path}/include", "${standby_service_standby_state_path}/include", "${standby_service_strategy_path}/include", "${standby_utils_common_path}/include", "${standby_utils_policy_path}/include", ] } StandbyPluginSrc = [ "${standby_plugins_path}/ext/src/base_state.cpp", "${standby_plugins_path}/ext/src/istate_manager_adapter.cpp", "${standby_service_constraints_path}/src/charge_state_monitor.cpp", "${standby_service_constraints_path}/src/constraint_manager_adapter.cpp", "${standby_service_message_listener_path}/src/listener_manager_adapter.cpp", "${standby_service_standby_state_path}/src/dark_state.cpp", "${standby_service_standby_state_path}/src/export_plugin.cpp", "${standby_service_standby_state_path}/src/maintenance_state.cpp", "${standby_service_standby_state_path}/src/nap_state.cpp", "${standby_service_standby_state_path}/src/sleep_state.cpp", "${standby_service_standby_state_path}/src/state_manager_adapter.cpp", "${standby_service_standby_state_path}/src/working_state.cpp", "${standby_service_strategy_path}/src/base_network_strategy.cpp", "${standby_service_strategy_path}/src/network_strategy.cpp", "${standby_service_strategy_path}/src/running_lock_strategy.cpp", "${standby_service_strategy_path}/src/timer_strategy.cpp", "${standby_service_strategy_path}/src/strategy_manager_adapter.cpp", ] StandbyPluginExternalDeps = [ "ability_base:want", "ability_runtime:app_manager", "ability_runtime:wantagent_innerkits", "access_token:libaccesstoken_sdk", "c_utils:utils", "common_event_service:cesfwk_innerkits", "eventhandler:libeventhandler", "hilog:libhilog", "init:libbegetutil", "ipc:ipc_single", "safwk:system_ability_fwk", "samgr:samgr_proxy", "time_service:time_client", ] StandbyPluginDefine = [] if (enable_standby_configpolicy) { StandbyPluginExternalDeps += [ "config_policy:configpolicy_util" ] StandbyPluginDefine += [ "STANDBY_CONFIG_POLICY_ENABLE" ] } if (enable_background_task_mgr) { StandbyPluginExternalDeps += [ "background_task_mgr:bgtaskmgr_innerkits" ] StandbyPluginSrc += [ "${standby_service_message_listener_path}/src/background_task_listener.cpp", ] StandbyPluginDefine += [ "ENABLE_BACKGROUND_TASK_MGR" ] } if (standby_power_manager_enable) { StandbyPluginExternalDeps += [ "power_manager:powermgr_client" ] StandbyPluginDefine += [ "STANDBY_POWER_MANAGER_ENABLE" ] } if (standby_battery_manager_enable) { StandbyPluginExternalDeps += [ "battery_manager:batterysrv_client" ] StandbyPluginDefine += [ "STANDBY_BATTERY_MANAGER_ENABLE" ] } if (standby_multimodalinput_input_enable) { StandbyPluginExternalDeps += [ "input:libmmi-client" ] StandbyPluginDefine += [ "STANDBY_MULTIMODALINPUT_INPUT_ENABLE" ] StandbyPluginSrc += [ "${standby_service_message_listener_path}/src/input_manager_listener.cpp", ] } if (standby_sensors_sensor_enable) { StandbyPluginExternalDeps += [ "sensor:sensor_interface_native" ] StandbyPluginDefine += [ "STANDBY_SENSORS_SENSOR_ENABLE" ] StandbyPluginSrc += [ "${standby_service_constraints_path}/src/motion_sensor_monitor.cpp" ] } if (standby_communication_netmanager_base_enable) { StandbyPluginExternalDeps += [ "netmanager_base:net_policy_manager_if" ] StandbyPluginDefine += [ "STANDBY_COMMUNICATION_NETMANAGER_BASE_ENABLE" ] } if (standby_rss_work_scheduler_enable) { StandbyPluginExternalDeps += [ "work_scheduler:workschedclient" ] StandbyPluginDefine += [ "STANDBY_RSS_WORK_SCHEDULER_ENABLE" ] } ohos_shared_library("standby_plugin") { branch_protector_ret = "pac_ret" sanitize = { cfi = true cfi_cross_dso = true debug = false } sources = StandbyPluginSrc public_configs = [ ":standby_plugin_config" ] deps = [ "${standby_service_frameworks_path}:standby_fwk", "${standby_service_path}:standby_service", "${standby_utils_common_path}:standby_utils_common", "${standby_utils_policy_path}:standby_utils_policy", ] external_deps = StandbyPluginExternalDeps defines = StandbyPluginDefine subsystem_name = "resourceschedule" part_name = "${standby_service_part_name}" version_script = "libstandby_plugin.versionscript" } ohos_static_library("standby_plugin_static") { branch_protector_ret = "pac_ret" sanitize = { cfi = true cfi_cross_dso = true debug = false } sources = StandbyPluginSrc public_configs = [ ":standby_plugin_config" ] deps = [ "${standby_service_frameworks_path}:standby_fwk", "${standby_service_path}:standby_service", "${standby_utils_common_path}:standby_utils_common", "${standby_utils_policy_path}:standby_utils_policy", ] external_deps = StandbyPluginExternalDeps defines = StandbyPluginDefine subsystem_name = "resourceschedule" part_name = "${standby_service_part_name}" } group("standby_plugin_group") { deps = [] if (device_standby_plugin_enable) { deps += [ ":standby_plugin" ] } }