# Copyright (c) 2022-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("//build/ohos.gni") import("../../power.gni") ohos_shared_library("libpower_interface_service_1.2") { include_dirs = [ "../../utils/include" ] sources = [ "src/power_interface_impl.cpp", "src/running_lock_counter.cpp", "src/running_lock_impl.cpp", "src/running_lock_timer_handler.cpp", "src/system_operation.cpp", ] external_deps = [ "drivers_interface_power:libpower_stub_1.2", "hdf_core:libhdf_host", "hdf_core:libhdf_utils", "hilog:libhilog", "ipc:ipc_single", "libxml2:libxml2", ] if (has_power_c_utils_part) { external_deps += [ "c_utils:utils" ] } if (has_power_hisysevent_part) { external_deps += [ "hisysevent:libhisysevent" ] } defines = [] if (drivers_peripheral_power_wakeup_cause_path) { sources += [ "src/power_config.cpp" ] external_deps += [ "jsoncpp:jsoncpp" ] if (has_power_config_policy_part) { external_deps += [ "config_policy:configpolicy_util" ] } defines += [ "DRIVER_PERIPHERAL_POWER_WAKEUP_CAUSE_PATH" ] } if (drivers_peripheral_power_suspend_with_tag) { defines += [ "DRIVER_PERIPHERAL_POWER_SUSPEND_WITH_TAG" ] } if (drivers_peripheral_power_faster_retry_of_sleep) { defines += [ "FASTER_RETRY_OF_SLEEP" ] } if (drivers_peripheral_power_enable_s4) { sources += [ "src/hibernate.cpp" ] defines += [ "DRIVERS_PERIPHERAL_POWER_ENABLE_S4" ] } if (drivers_peripheral_power_slower_retry_of_sleep) { defines += [ "SLOWER_RETRY_OF_SLEEP" ] } install_images = [ chipset_base_dir ] subsystem_name = "hdf" part_name = "drivers_peripheral_power" } ############################################################################################## ohos_shared_library("libpower_driver") { sources = [ "src/power_interface_driver.cpp" ] external_deps = [ "drivers_interface_power:libpower_stub_1.2", "hdf_core:libhdf_host", "hdf_core:libhdf_ipc_adapter", "hdf_core:libhdf_utils", "hdf_core:libhdi", "hilog:libhilog", "ipc:ipc_single", ] if (has_power_c_utils_part) { external_deps += [ "c_utils:utils" ] } shlib_type = "hdi" install_images = [ chipset_base_dir ] subsystem_name = "hdf" part_name = "drivers_peripheral_power" } group("hdf_power") { deps = [ ":libpower_driver", ":libpower_interface_service_1.2", ] if (drivers_peripheral_power_wakeup_cause_path) { deps += [ "profile:power_hdi_service_config" ] } }