1# Copyright (c) 2022-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("//build/test.gni") 16import("../../cgroup_sched/cgroup_sched.gni") 17import("../ressched.gni") 18 19config("ressched_config") { 20 include_dirs = [ 21 "${ressched_common}/include", 22 "resschedmgr/resschedfwk/include", 23 "resschedmgr/pluginbase/include", 24 ] 25} 26 27config("resschedsvc_public_config") { 28 include_dirs = [ 29 "${ressched_common}/include", 30 "resschedmgr/resschedfwk/include", 31 "resschedmgr/pluginbase/include", 32 ] 33} 34 35config("resschedsvc_private_config") { 36 include_dirs = [ 37 "resschedservice/include", 38 "../sched_controller/common_event/include", 39 "../sched_controller/observer/include", 40 ] 41} 42 43ohos_shared_library("resschedsvc") { 44 configs = [ ":resschedsvc_private_config" ] 45 46 public_configs = [ ":resschedsvc_public_config" ] 47 48 defines = [] 49 include_dirs = [ 50 "${cgroup_sched_framework}/sched_controller/include", 51 "${cgroup_sched_framework}/process_group/include", 52 "//foundation/ability/ability_runtime/interfaces/inner_api/connectionobs_manager/include/", 53 "${cgroup_sched_framework}/utils/include/", 54 ] 55 56 sources = [ 57 "../sched_controller/common_event/src/event_controller.cpp", 58 "../sched_controller/observer/src/audio_observer.cpp", 59 "../sched_controller/observer/src/connection_subscriber.cpp", 60 "../sched_controller/observer/src/hisysevent_observer.cpp", 61 "../sched_controller/observer/src/mmi_observer.cpp", 62 "../sched_controller/observer/src/observer_manager.cpp", 63 "resschedmgr/resschedfwk/src/config_reader.cpp", 64 "resschedmgr/resschedfwk/src/kill_process.cpp", 65 "resschedmgr/resschedfwk/src/plugin_mgr.cpp", 66 "resschedmgr/resschedfwk/src/plugin_switch.cpp", 67 "resschedmgr/resschedfwk/src/res_sched_mgr.cpp", 68 "resschedservice/src/res_sched_service.cpp", 69 "resschedservice/src/res_sched_service_ability.cpp", 70 "resschedservice/src/res_sched_service_stub.cpp", 71 ] 72 73 deps = [ 74 "${cgroup_sched_framework}:cgroup_sched", 75 "${ressched_interfaces}/innerkits/ressched_client:ressched_client", 76 "//third_party/libxml2:xml2", 77 ] 78 79 external_deps = [ 80 "ability_base:want", 81 "ability_runtime:app_manager", 82 "ability_runtime:connection_obs_manager", 83 "ability_runtime:wantagent_innerkits", 84 "access_token:libaccesstoken_sdk", 85 "access_token:libtokenid_sdk", 86 "bundle_framework:appexecfwk_base", 87 "bundle_framework:appexecfwk_core", 88 "c_utils:utils", 89 "common_event_service:cesfwk_innerkits", 90 "config_policy:configpolicy_util", 91 "eventhandler:libeventhandler", 92 "ffrt:libffrt", 93 "hilog:libhilog", 94 "hisysevent:libhisysevent", 95 "hisysevent:libhisyseventmanager", 96 "hitrace:hitrace_meter", 97 "init:libbegetutil", 98 "input:libmmi-client", 99 "ipc:ipc_single", 100 "safwk:system_ability_fwk", 101 "samgr:samgr_proxy", 102 ] 103 104 if (device_movement_perception_enable) { 105 defines += [ "DEVICE_MOVEMENT_PERCEPTION_ENABLE" ] 106 external_deps += [ "movement:movement_client" ] 107 sources += 108 [ "../sched_controller/observer/src/device_movement_observer.cpp" ] 109 } 110 if (ressched_with_telephony_state_registry_enable) { 111 defines += [ "RESSCHED_TELEPHONY_STATE_REGISTRY_ENABLE" ] 112 external_deps += [ 113 "core_service:tel_core_service_api", 114 "state_registry:tel_state_registry_api", 115 ] 116 sources += 117 [ "../sched_controller/observer/src/sched_telephony_observer.cpp" ] 118 } 119 if (communication_bluetooth_perception_enable) { 120 defines += [ "RESSCHED_COMMUNICATION_BLUETOOTH_ENABLE" ] 121 external_deps += [ "bluetooth:btframework" ] 122 } 123 if (ressched_with_resourceschedule_multimedia_av_session_enable) { 124 defines += [ "RESSCHED_MULTIMEDIA_AV_SESSION_ENABLE" ] 125 sources += 126 [ "../sched_controller/observer/src/av_session_state_listener.cpp" ] 127 external_deps += [ "av_session:avsession_client" ] 128 } 129 if (ressched_with_resourceschedule_multimedia_audio_framework_enable) { 130 defines += [ "RESSCHED_AUDIO_FRAMEWORK_ENABLE" ] 131 external_deps += [ "audio_framework:audio_client" ] 132 } 133 if (resource_schedule_service_with_ffrt_enable) { 134 defines += [ "RESOURCE_SCHEDULE_SERVICE_WITH_FFRT_ENABLE" ] 135 } 136 137 version_script = "libresschedsvc.versionscript" 138 shlib_type = "sa" 139 subsystem_name = "resourceschedule" 140 part_name = "resource_schedule_service" 141 branch_protector_ret = "pac_ret" 142 143 sanitize = { 144 cfi = true 145 cfi_cross_dso = true 146 debug = false 147 } 148} 149 150# for unittest 151ohos_static_library("resschedsvc_static") { 152 configs = [] 153 154 public_configs = [ 155 ":resschedsvc_private_config", 156 ":resschedsvc_public_config", 157 ] 158 159 defines = [] 160 161 include_dirs = [ 162 "//foundation/ability/ability_runtime/interfaces/inner_api/connectionobs_manager/include/", 163 "//foundation/resourceschedule/resource_schedule_service/cgroup_sched/framework/utils/include/", 164 "//foundation/resourceschedule/resource_schedule_service/cgroup_sched/framework/sched_controller/include/", 165 "//foundation/resourceschedule/resource_schedule_service/cgroup_sched/framework/process_group/include/", 166 ] 167 168 sources = [ 169 "../sched_controller/common_event/src/event_controller.cpp", 170 "../sched_controller/observer/src/audio_observer.cpp", 171 "../sched_controller/observer/src/connection_subscriber.cpp", 172 "../sched_controller/observer/src/hisysevent_observer.cpp", 173 "../sched_controller/observer/src/mmi_observer.cpp", 174 "../sched_controller/observer/src/observer_manager.cpp", 175 "resschedmgr/resschedfwk/src/config_reader.cpp", 176 "resschedmgr/resschedfwk/src/kill_process.cpp", 177 "resschedmgr/resschedfwk/src/plugin_mgr.cpp", 178 "resschedmgr/resschedfwk/src/plugin_switch.cpp", 179 "resschedmgr/resschedfwk/src/res_sched_mgr.cpp", 180 "resschedservice/src/res_sched_service.cpp", 181 "resschedservice/src/res_sched_service_ability.cpp", 182 "resschedservice/src/res_sched_service_stub.cpp", 183 ] 184 185 deps = [ 186 "${cgroup_sched_framework}:cgroup_sched", 187 "${ressched_interfaces}/innerkits/ressched_client:ressched_client", 188 "//third_party/libxml2:xml2", 189 ] 190 191 external_deps = [ 192 "ability_base:want", 193 "ability_runtime:app_manager", 194 "ability_runtime:connection_obs_manager", 195 "ability_runtime:wantagent_innerkits", 196 "access_token:libaccesstoken_sdk", 197 "access_token:libtokenid_sdk", 198 "bundle_framework:appexecfwk_base", 199 "bundle_framework:appexecfwk_core", 200 "c_utils:utils", 201 "common_event_service:cesfwk_innerkits", 202 "config_policy:configpolicy_util", 203 "eventhandler:libeventhandler", 204 "ffrt:libffrt", 205 "hilog:libhilog", 206 "hisysevent:libhisysevent", 207 "hisysevent:libhisyseventmanager", 208 "hitrace:hitrace_meter", 209 "init:libbegetutil", 210 "input:libmmi-client", 211 "ipc:ipc_single", 212 "safwk:system_ability_fwk", 213 "samgr:samgr_proxy", 214 ] 215 216 if (device_movement_perception_enable) { 217 defines += [ "DEVICE_MOVEMENT_PERCEPTION_ENABLE" ] 218 external_deps += [ "movement:movement_client" ] 219 sources += 220 [ "../sched_controller/observer/src/device_movement_observer.cpp" ] 221 } 222 if (ressched_with_telephony_state_registry_enable) { 223 defines += [ "RESSCHED_TELEPHONY_STATE_REGISTRY_ENABLE" ] 224 external_deps += [ 225 "core_service:tel_core_service_api", 226 "state_registry:tel_state_registry_api", 227 ] 228 sources += 229 [ "../sched_controller/observer/src/sched_telephony_observer.cpp" ] 230 } 231 if (communication_bluetooth_perception_enable) { 232 defines += [ "RESSCHED_COMMUNICATION_BLUETOOTH_ENABLE" ] 233 external_deps += [ "bluetooth:btframework" ] 234 } 235 if (ressched_with_resourceschedule_multimedia_av_session_enable) { 236 defines += [ "RESSCHED_MULTIMEDIA_AV_SESSION_ENABLE" ] 237 sources += 238 [ "../sched_controller/observer/src/av_session_state_listener.cpp" ] 239 external_deps += [ "av_session:avsession_client" ] 240 } 241 if (ressched_with_resourceschedule_multimedia_audio_framework_enable) { 242 defines += [ "RESSCHED_AUDIO_FRAMEWORK_ENABLE" ] 243 external_deps += [ "audio_framework:audio_client" ] 244 } 245 subsystem_name = "resourceschedule" 246 part_name = "resource_schedule_service" 247 branch_protector_ret = "pac_ret" 248 249 sanitize = { 250 cfi = true 251 cfi_cross_dso = true 252 debug = false 253 } 254} 255