# Copyright (c) 2021 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("//base/powermgr/power_manager/powermgr.gni") config("powermgr_public_config") { include_dirs = [ "native/include", "zidl/include", "//base/hiviewdfx/hicollie/interfaces/native/innerkits/include/xcollie/", "//base/msdp/device_status/interfaces/innerkits/include", "//base/msdp/device_status/services/native/include", "//base/sensors/sensor/interfaces/native/include", ] } ohos_shared_library("powermgrservice") { sources = [ "native/src/power_mgr_dumper.cpp", "native/src/power_mgr_factory.cpp", "native/src/power_mgr_monitor.cpp", "native/src/power_mgr_notify.cpp", "native/src/power_mgr_service.cpp", "native/src/power_mode_module.cpp", "native/src/power_mode_policy.cpp", "native/src/power_save_mode.cpp", "native/src/power_state_machine.cpp", "native/src/powerms_event_handler.cpp", "native/src/running_lock_inner.cpp", "native/src/running_lock_mgr.cpp", "native/src/shutdown_service.cpp", "zidl/src/power_mgr_stub.cpp", "zidl/src/power_mode_callback_stub.cpp", "zidl/src/power_shutdown_callback_stub.cpp", "zidl/src/power_state_callback_stub.cpp", ] configs = [ "${powermgr_utils_path}:utils_config" ] public_configs = [ ":powermgr_public_config" ] deps = [ "${powermgr_framework_path}/dialog/dialog_ui/js:dialog_js_files_etc", "${powermgr_native_innerkits_path}:powermgr_client", "${powermgr_utils_path}:powermgr_utils", "native/src/actions:powermgr_actions", "//base/msdp/device_status/frameworks/native/src:deviceagent", "//drivers/interface/power/v1_0:libpower_proxy_1.0", "//foundation/ace/ace_engine/interfaces/innerkits/ui_service_manager:ui_service_mgr", "//foundation/windowmanager/utils:libwmutil", "//utils/native/base:utils", ] external_deps = [ "ability_base:base", "ability_base:want", "ces_standard:cesfwk_innerkits", "display_manager_native:displaymgr", "eventhandler:libeventhandler", "hicollie_native:libhicollie", "hisysevent_native:libhisysevent", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", "multimedia_image_standard:image_native", "multimodalinput_base:libmmi-client", "safwk:system_ability_fwk", "samgr_standard:samgr_proxy", "sensor:sensor_interface_native", "window_manager:libdm", ] part_name = "${powermgr_native_part_name}" } group("power_service_config") { deps = [ "native/profile:power_mode_config" ] VENDOR_CONFIG_PATH = rebase_path( "//vendor/${product_company}/${product_name}/power_config/power_mode_config.xml") CMD = "if [ -f ${VENDOR_CONFIG_PATH} ]; then echo true; else echo false; fi" vendor_config_exist = exec_script("//build/lite/run_shell_cmd.py", [ CMD ], "value") if (vendor_config_exist) { deps += [ "native/profile:power_mode_config_vendor" ] } }