# Copyright (c) 2021-2023 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("../batterymgr.gni") config("batterysrv_public_config") { include_dirs = [ "native/include", "${battery_service_zidl}/include", "${battery_inner_api}/native/include", ] } ohos_shared_library("batteryservice") { sanitize = { cfi = true cfi_cross_dso = true debug = false } branch_protector_ret = "pac_ret" sources = [ "native/src/battery_callback.cpp", "native/src/battery_config.cpp", "native/src/battery_dump.cpp", "native/src/battery_light.cpp", "native/src/battery_notify.cpp", "native/src/battery_service.cpp", ] configs = [ "${battery_utils}:utils_config", "${battery_utils}:coverage_flags", ] public_configs = [ ":batterysrv_public_config" ] deps = [ "${battery_service_zidl}:batterysrv_stub", "//third_party/jsoncpp:jsoncpp", ] external_deps = [ "power_manager:power_permission" ] external_deps += [ "ability_base:want", "ability_runtime:ability_manager", "bundle_framework:appexecfwk_base", "c_utils:utils", "common_event_service:cesfwk_core", "common_event_service:cesfwk_innerkits", "config_policy:configpolicy_util", "drivers_interface_battery:libbattery_proxy_2.0", "ffrt:libffrt", "hdf_core:libhdi", "hdf_core:libpub_utils", "hicollie:libhicollie", "hilog:libhilog", "hisysevent:libhisysevent", "ipc:ipc_core", "miscdevice:light_interface_native", "power_manager:power_ffrt", "power_manager:power_sysparam", "power_manager:power_vibrator", "power_manager:powermgr_client", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] if (battery_manager_feature_set_low_capacity_threshold) { defines = [ "BATTERY_MANAGER_SET_LOW_CAPACITY_THRESHOLD" ] } subsystem_name = "powermgr" part_name = "battery_manager" } group("service") { deps = [ ":batteryservice", "native/profile:battery_config", "native/profile:battery_vibrator_config", ] }