• 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_service_public_config") {
18  include_dirs = [
19    "common/include",
20    "core/include",
21    "notification/include",
22    "${standby_plugins_path}/ext/include",
23  ]
24}
25
26ohos_shared_library("standby_service") {
27  branch_protector_ret = "pac_ret"
28  sanitize = {
29    cfi = true
30    cfi_cross_dso = true
31    debug = false
32  }
33  if (!use_clang_coverage) {
34    shlib_type = "sa"
35  }
36
37  sources = [
38    "common/src/device_standby_switch.cpp",
39    "common/src/time_provider.cpp",
40    "common/src/timed_task.cpp",
41    "core/src/ability_manager_helper.cpp",
42    "core/src/allow_record.cpp",
43    "core/src/app_mgr_helper.cpp",
44    "core/src/app_state_observer.cpp",
45    "core/src/bundle_manager_helper.cpp",
46    "core/src/common_event_observer.cpp",
47    "core/src/standby_service.cpp",
48    "core/src/standby_service_impl.cpp",
49    "notification/src/standby_state_subscriber.cpp",
50  ]
51
52  public_configs = [ ":standby_service_public_config" ]
53
54  deps = [
55    "${standby_innerkits_path}:standby_innerkits",
56    "${standby_service_frameworks_path}:standby_fwk",
57    "${standby_utils_common_path}:standby_utils_common",
58    "${standby_utils_policy_path}:standby_utils_policy",
59  ]
60
61  external_deps = [
62    "ability_base:want",
63    "ability_runtime:app_manager",
64    "ability_runtime:wantagent_innerkits",
65    "access_token:libaccesstoken_sdk",
66    "access_token:libtokenid_sdk",
67    "bundle_framework:appexecfwk_base",
68    "c_utils:utils",
69    "common_event_service:cesfwk_innerkits",
70    "eventhandler:libeventhandler",
71    "hilog:libhilog",
72    "init:libbegetutil",
73    "ipc:ipc_single",
74    "resource_schedule_service:ressched_client",
75    "resource_schedule_service:resschedsvc",
76    "safwk:system_ability_fwk",
77    "samgr:samgr_proxy",
78    "time_service:time_client",
79  ]
80
81  defines = []
82  if (enable_background_task_mgr) {
83    external_deps += [ "background_task_mgr:bgtaskmgr_innerkits" ]
84    sources += [ "common/src/background_task_helper.cpp" ]
85    defines += [ "ENABLE_BACKGROUND_TASK_MGR" ]
86  }
87
88  if (standby_power_manager_enable) {
89    external_deps += [ "power_manager:powermgr_client" ]
90    defines += [ "STANDBY_POWER_MANAGER_ENABLE" ]
91  }
92
93  subsystem_name = "resourceschedule"
94  part_name = "${standby_service_part_name}"
95
96  version_script = "libstandby_service.versionscript"
97}
98
99ohos_static_library("standby_service_static") {
100  branch_protector_ret = "pac_ret"
101  sanitize = {
102    cfi = true
103    cfi_cross_dso = true
104    debug = false
105  }
106  cflags_cc = [ "-DSTANDBY_SERVICE_UNIT_TEST" ]
107  sources = [
108    "common/src/device_standby_switch.cpp",
109    "common/src/time_provider.cpp",
110    "common/src/timed_task.cpp",
111    "core/src/ability_manager_helper.cpp",
112    "core/src/allow_record.cpp",
113    "core/src/app_mgr_helper.cpp",
114    "core/src/app_state_observer.cpp",
115    "core/src/bundle_manager_helper.cpp",
116    "core/src/common_event_observer.cpp",
117    "core/src/standby_service.cpp",
118    "core/src/standby_service_impl.cpp",
119    "notification/src/standby_state_subscriber.cpp",
120  ]
121
122  public_configs = [ ":standby_service_public_config" ]
123
124  deps = [
125    "${standby_innerkits_path}:standby_innerkits",
126    "${standby_service_frameworks_path}:standby_fwk",
127    "${standby_utils_common_path}:standby_utils_common",
128    "${standby_utils_policy_path}:standby_utils_policy",
129  ]
130
131  external_deps = [
132    "ability_base:want",
133    "ability_runtime:app_manager",
134    "ability_runtime:wantagent_innerkits",
135    "access_token:libaccesstoken_sdk",
136    "access_token:libtokenid_sdk",
137    "bundle_framework:appexecfwk_base",
138    "c_utils:utils",
139    "common_event_service:cesfwk_innerkits",
140    "eventhandler:libeventhandler",
141    "hilog:libhilog",
142    "init:libbegetutil",
143    "ipc:ipc_single",
144    "resource_schedule_service:ressched_client",
145    "resource_schedule_service:resschedsvc",
146    "safwk:system_ability_fwk",
147    "samgr:samgr_proxy",
148    "time_service:time_client",
149  ]
150
151  defines = []
152  if (enable_background_task_mgr) {
153    external_deps += [ "background_task_mgr:bgtaskmgr_innerkits" ]
154    sources += [ "common/src/background_task_helper.cpp" ]
155    defines += [ "ENABLE_BACKGROUND_TASK_MGR" ]
156  }
157
158  if (standby_power_manager_enable) {
159    external_deps += [ "power_manager:powermgr_client" ]
160    defines += [ "STANDBY_POWER_MANAGER_ENABLE" ]
161  }
162
163  subsystem_name = "resourceschedule"
164  part_name = "${standby_service_part_name}"
165}
166