1# Copyright (c) 2021-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("../batterymgr.gni") 15 16config("batterysrv_public_config") { 17 include_dirs = [ 18 "native/include", 19 "${battery_service_zidl}/include", 20 "${battery_inner_api}/native/include", 21 ] 22} 23 24ohos_shared_library("batteryservice") { 25 sanitize = { 26 cfi = true 27 cfi_cross_dso = true 28 debug = false 29 } 30 branch_protector_ret = "pac_ret" 31 32 sources = [ 33 "native/src/battery_callback.cpp", 34 "native/src/battery_config.cpp", 35 "native/src/battery_dump.cpp", 36 "native/src/battery_light.cpp", 37 "native/src/battery_notify.cpp", 38 "native/src/battery_service.cpp", 39 ] 40 41 configs = [ 42 "${battery_utils}:utils_config", 43 "${battery_utils}:coverage_flags", 44 ] 45 46 public_configs = [ ":batterysrv_public_config" ] 47 48 deps = [ 49 "${battery_service_zidl}:batterysrv_stub", 50 "//third_party/jsoncpp:jsoncpp", 51 ] 52 53 external_deps = [ "power_manager:power_permission" ] 54 external_deps += [ 55 "ability_base:want", 56 "ability_runtime:ability_manager", 57 "bundle_framework:appexecfwk_base", 58 "c_utils:utils", 59 "common_event_service:cesfwk_core", 60 "common_event_service:cesfwk_innerkits", 61 "config_policy:configpolicy_util", 62 "drivers_interface_battery:libbattery_proxy_2.0", 63 "ffrt:libffrt", 64 "hdf_core:libhdi", 65 "hdf_core:libpub_utils", 66 "hicollie:libhicollie", 67 "hilog:libhilog", 68 "hisysevent:libhisysevent", 69 "ipc:ipc_core", 70 "miscdevice:light_interface_native", 71 "power_manager:power_ffrt", 72 "power_manager:power_sysparam", 73 "power_manager:power_vibrator", 74 "power_manager:powermgr_client", 75 "safwk:system_ability_fwk", 76 "samgr:samgr_proxy", 77 ] 78 79 if (battery_manager_feature_set_low_capacity_threshold) { 80 defines = [ "BATTERY_MANAGER_SET_LOW_CAPACITY_THRESHOLD" ] 81 } 82 83 subsystem_name = "powermgr" 84 part_name = "battery_manager" 85} 86 87group("service") { 88 deps = [ 89 ":batteryservice", 90 "native/profile:battery_config", 91 "native/profile:battery_vibrator_config", 92 ] 93} 94