• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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  "c_utils:utils",
62  "call_manager:tel_call_manager_api",
63  "common_event_service:cesfwk_innerkits",
64  "eventhandler:libeventhandler",
65  "hilog:libhilog",
66  "init:libbegetutil",
67  "input:libmmi-client",
68  "ipc:ipc_single",
69  "netmanager_base:net_policy_manager_if",
70  "power_manager:powermgr_client",
71  "samgr:samgr_proxy",
72  "sensor:sensor_interface_native",
73  "time_service:time_client",
74  "wifi:wifi_sdk",
75  "work_scheduler:workschedclient",
76]
77
78ohos_shared_library("standby_plugin") {
79  sources = StandbyPluginSrc
80
81  public_configs = [ ":standby_plugin_config" ]
82
83  public_deps = [
84    "${standby_service_frameworks_path}:standby_fwk",
85    "${standby_service_path}:standby_service",
86    "${standby_utils_common_path}:standby_utils_common",
87    "${standby_utils_policy_path}:standby_utils_policy",
88  ]
89
90  external_deps = StandbyPluginExternalDeps
91
92  defines = []
93  if (enable_standby_configpolicy) {
94    external_deps += [ "config_policy:configpolicy_util" ]
95    defines += [ "STANDBY_CONFIG_POLICY_ENABLE" ]
96  }
97
98  if (enable_background_task_mgr) {
99    external_deps += [ "background_task_mgr:bgtaskmgr_innerkits" ]
100    defines += [ "ENABLE_BACKGROUND_TASK_MGR" ]
101  }
102
103  subsystem_name = "resourceschedule"
104  part_name = "${standby_service_part_name}"
105  version_script = "libstandby_plugin.versionscript"
106}
107
108ohos_static_library("standby_plugin_static") {
109  sources = StandbyPluginSrc
110
111  public_configs = [ ":standby_plugin_config" ]
112
113  public_deps = [
114    "${standby_service_frameworks_path}:standby_fwk",
115    "${standby_service_path}:standby_service",
116    "${standby_utils_common_path}:standby_utils_common",
117    "${standby_utils_policy_path}:standby_utils_policy",
118  ]
119
120  external_deps = StandbyPluginExternalDeps
121
122  defines = []
123  if (enable_standby_configpolicy) {
124    external_deps += [ "config_policy:configpolicy_util" ]
125    defines += [ "STANDBY_CONFIG_POLICY_ENABLE" ]
126  }
127
128  if (enable_background_task_mgr) {
129    external_deps += [ "background_task_mgr:bgtaskmgr_innerkits" ]
130    defines += [ "ENABLE_BACKGROUND_TASK_MGR" ]
131  }
132
133  subsystem_name = "resourceschedule"
134  part_name = "${standby_service_part_name}"
135}
136
137config("standby_service_state_plugin_config") {
138  include_dirs = [
139    "${standby_plugins_path}/ext/include",
140    "${standby_service_standby_state_path}/include",
141    "${standby_utils_common_path}/include",
142    "${standby_utils_policy_path}/include",
143  ]
144}
145