1# Copyright (c) 2023 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("//build/ohos.gni") 15import("//foundation/resourceschedule/device_standby/standby_service.gni") 16 17config("standby_plugin_config") { 18 include_dirs = [ 19 "${standby_plugins_path}/ext/include", 20 "${standby_service_constraints_path}/include", 21 "${standby_service_message_listener_path}/include", 22 "${standby_service_standby_state_path}/include", 23 "${standby_service_strategy_path}/include", 24 "${standby_utils_common_path}/include", 25 "${standby_utils_policy_path}/include", 26 ] 27} 28 29StandbyPluginSrc = [ 30 "${standby_plugins_path}/ext/src/base_state.cpp", 31 "${standby_plugins_path}/ext/src/istate_manager_adapter.cpp", 32 "${standby_service_constraints_path}/src/charge_state_monitor.cpp", 33 "${standby_service_constraints_path}/src/constraint_manager_adapter.cpp", 34 "${standby_service_constraints_path}/src/motion_sensor_monitor.cpp", 35 "${standby_service_message_listener_path}/src/background_task_listener.cpp", 36 "${standby_service_message_listener_path}/src/common_event_listener.cpp", 37 "${standby_service_message_listener_path}/src/input_manager_listener.cpp", 38 "${standby_service_message_listener_path}/src/listener_manager_adapter.cpp", 39 "${standby_service_standby_state_path}/src/dark_state.cpp", 40 "${standby_service_standby_state_path}/src/export_plugin.cpp", 41 "${standby_service_standby_state_path}/src/maintenance_state.cpp", 42 "${standby_service_standby_state_path}/src/nap_state.cpp", 43 "${standby_service_standby_state_path}/src/sleep_state.cpp", 44 "${standby_service_standby_state_path}/src/state_manager_adapter.cpp", 45 "${standby_service_standby_state_path}/src/working_state.cpp", 46 "${standby_service_strategy_path}/src/base_network_strategy.cpp", 47 "${standby_service_strategy_path}/src/network_strategy.cpp", 48 "${standby_service_strategy_path}/src/running_lock_strategy.cpp", 49 "${standby_service_strategy_path}/src/strategy_manager_adapter.cpp", 50] 51 52StandbyPluginExternalDeps = [ 53 "ability_base:base", 54 "ability_base:want", 55 "ability_base:zuri", 56 "ability_runtime:app_manager", 57 "ability_runtime:wantagent_innerkits", 58 "access_token:libaccesstoken_sdk", 59 "access_token:libtokenid_sdk", 60 "battery_manager:batterysrv_client", 61 "bundle_framework:appexecfwk_core", 62 "c_utils:utils", 63 "call_manager:tel_call_manager_api", 64 "common_event_service:cesfwk_innerkits", 65 "eventhandler:libeventhandler", 66 "hilog:libhilog", 67 "init:libbegetutil", 68 "input:libmmi-client", 69 "ipc:ipc_single", 70 "netmanager_base:net_policy_manager_if", 71 "power_manager:powermgr_client", 72 "samgr:samgr_proxy", 73 "sensor:sensor_interface_native", 74 "time_service:time_client", 75 "wifi:wifi_sdk", 76 "work_scheduler:workschedclient", 77] 78 79ohos_shared_library("standby_plugin") { 80 branch_protector_ret = "pac_ret" 81 sanitize = { 82 cfi = true 83 cfi_cross_dso = true 84 debug = false 85 } 86 sources = StandbyPluginSrc 87 88 public_configs = [ ":standby_plugin_config" ] 89 90 public_deps = [ 91 "${standby_service_frameworks_path}:standby_fwk", 92 "${standby_service_path}:standby_service", 93 "${standby_utils_common_path}:standby_utils_common", 94 "${standby_utils_policy_path}:standby_utils_policy", 95 ] 96 97 external_deps = StandbyPluginExternalDeps 98 99 defines = [] 100 if (enable_standby_configpolicy) { 101 external_deps += [ "config_policy:configpolicy_util" ] 102 defines += [ "STANDBY_CONFIG_POLICY_ENABLE" ] 103 } 104 105 if (enable_background_task_mgr) { 106 external_deps += [ "background_task_mgr:bgtaskmgr_innerkits" ] 107 defines += [ "ENABLE_BACKGROUND_TASK_MGR" ] 108 } 109 110 subsystem_name = "resourceschedule" 111 part_name = "${standby_service_part_name}" 112 version_script = "libstandby_plugin.versionscript" 113} 114 115ohos_static_library("standby_plugin_static") { 116 branch_protector_ret = "pac_ret" 117 sanitize = { 118 cfi = true 119 cfi_cross_dso = true 120 debug = false 121 } 122 sources = StandbyPluginSrc 123 124 public_configs = [ ":standby_plugin_config" ] 125 126 public_deps = [ 127 "${standby_service_frameworks_path}:standby_fwk", 128 "${standby_service_path}:standby_service", 129 "${standby_utils_common_path}:standby_utils_common", 130 "${standby_utils_policy_path}:standby_utils_policy", 131 ] 132 133 external_deps = StandbyPluginExternalDeps 134 135 defines = [] 136 if (enable_standby_configpolicy) { 137 external_deps += [ "config_policy:configpolicy_util" ] 138 defines += [ "STANDBY_CONFIG_POLICY_ENABLE" ] 139 } 140 141 if (enable_background_task_mgr) { 142 external_deps += [ "background_task_mgr:bgtaskmgr_innerkits" ] 143 defines += [ "ENABLE_BACKGROUND_TASK_MGR" ] 144 } 145 146 subsystem_name = "resourceschedule" 147 part_name = "${standby_service_part_name}" 148} 149 150config("standby_service_state_plugin_config") { 151 include_dirs = [ 152 "${standby_plugins_path}/ext/include", 153 "${standby_service_standby_state_path}/include", 154 "${standby_utils_common_path}/include", 155 "${standby_utils_policy_path}/include", 156 ] 157} 158