• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022 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("//foundation/resourceschedule/work_scheduler/workscheduler.gni")
15
16config("worksched_private_config") {
17  include_dirs = [
18    "${worksched_service_path}/zidl/include",
19    "${worksched_frameworks_path}/extension/include",
20  ]
21}
22
23config("worksched_public_config") {
24  include_dirs = [
25    "native/include",
26    "//base/powermgr/battery_manager/interfaces/innerkits/native/include",
27    "//foundation/communication/netmanager_base/interfaces/innerkits/netconnclient/include",
28  ]
29}
30
31ohos_shared_library("workschedservice") {
32  sources = [
33    "native/src/conditions/battery_level_listener.cpp",
34    "native/src/conditions/battery_status_listener.cpp",
35    "native/src/conditions/charger_listener.cpp",
36    "native/src/conditions/group_listener.cpp",
37    "native/src/conditions/network_listener.cpp",
38    "native/src/conditions/storage_listener.cpp",
39    "native/src/conditions/timer_listener.cpp",
40    "native/src/event_publisher.cpp",
41    "native/src/policy/app_data_clear_listener.cpp",
42    "native/src/policy/app_removed_listener.cpp",
43    "native/src/policy/memory_policy.cpp",
44    "native/src/policy/thermal_policy.cpp",
45    "native/src/scheduler_bg_task_subscriber.cpp",
46    "native/src/watchdog.cpp",
47    "native/src/work_bundle_group_change_callback.cpp",
48    "native/src/work_conn_manager.cpp",
49    "native/src/work_event_handler.cpp",
50    "native/src/work_policy_manager.cpp",
51    "native/src/work_queue.cpp",
52    "native/src/work_queue_event_handler.cpp",
53    "native/src/work_queue_manager.cpp",
54    "native/src/work_scheduler_connection.cpp",
55    "native/src/work_scheduler_service.cpp",
56    "native/src/work_status.cpp",
57    "zidl/src/work_sched_service_stub.cpp",
58    "zidl/src/work_scheduler_proxy.cpp",
59  ]
60
61  configs = [ ":worksched_private_config" ]
62
63  public_configs = [ ":worksched_public_config" ]
64
65  deps = [
66    "${worksched_frameworks_path}:workschedclient",
67    "${worksched_utils_path}:workschedutils",
68  ]
69
70  external_deps = [
71    "ability_base:want",
72    "ability_runtime:ability_manager",
73    "ability_runtime:wantagent_innerkits",
74    "battery_manager:batterysrv_client",
75    "bundle_framework:appexecfwk_base",
76    "bundle_framework:appexecfwk_core",
77    "c_utils:utils",
78    "common_event_service:cesfwk_innerkits",
79    "eventhandler:libeventhandler",
80    "hisysevent_native:libhisysevent",
81    "hiviewdfx_hilog_native:libhilog",
82    "ipc:ipc_core",
83    "safwk:system_ability_fwk",
84    "samgr:samgr_proxy",
85    "thermal_manager:thermalsrv_client",
86  ]
87
88  defines = []
89  if (bundle_active_enable) {
90    external_deps += [ "device_usage_statistics:usagestatsinner" ]
91    defines += [ "DEVICE_USAGE_STATISTICS_ENABLE" ]
92  }
93  if (resourceschedule_bgtaskmgr_enable) {
94    external_deps += [ "background_task_mgr:bgtaskmgr_innerkits" ]
95    defines += [ "RESOURCESCHEDULE_BGTASKMGR_ENABLE" ]
96  }
97
98  part_name = "${worksched_native_part_name}"
99}
100