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("../../../../../powermgr.gni") 15import("../actions.gni") 16 17config("powermgr_actions_impl_public_config") { 18 include_dirs = [ "." ] 19} 20 21config("powermgr_display_actions_impl_public_config") { 22 include_dirs = [ "./display" ] 23} 24 25config("powermgr_actions_common_config") { 26 include_dirs = [ 27 "${powermgr_inner_api}/native/include", 28 "${powermgr_service_path}/native/include", 29 ] 30} 31 32ohos_source_set("${powermgr_actions_default_target}") { 33 sanitize = { 34 cfi = true 35 cfi_cross_dso = true 36 debug = false 37 } 38 branch_protector_ret = "pac_ret" 39 40 sources = [ 41 "device_power_action.cpp", 42 "running_lock_action.cpp", 43 "suspend/running_lock_hub.cpp", 44 "suspend/suspend_controller.cpp", 45 "system_suspend_controller.cpp", 46 ] 47 48 configs = [ 49 ":powermgr_actions_common_config", 50 "${powermgr_utils_path}:utils_config", 51 "${powermgr_utils_path}:coverage_flags", 52 ] 53 54 public_configs = [ ":powermgr_actions_impl_public_config" ] 55 56 deps = [ 57 "${powermgr_utils_path}:power_utils", 58 "${powermgr_utils_path}/ffrt:power_ffrt", 59 "${powermgr_utils_path}/hookmgr:power_hookmgr", 60 ] 61 62 external_deps = [ 63 "c_utils:utils", 64 "drivers_interface_power:libpower_proxy_1.2", 65 "drivers_interface_power:libpower_proxy_1.3", 66 "ffrt:libffrt", 67 "hdf_core:libhdf_utils", 68 "hdf_core:libhdi", 69 "hdf_core:libpub_utils", 70 "hilog:libhilog", 71 "image_framework:image_native", 72 "init:libbegetutil", 73 "ipc:ipc_core", 74 ] 75 76 if (has_hiviewdfx_hisysevent_part) { 77 external_deps += [ "hisysevent:libhisysevent" ] 78 } 79 80 if (power_manager_feature_poweroff_charge && defined(global_parts_info) && 81 defined(global_parts_info.powermgr_battery_manager)) { 82 defines += [ "POWER_MANAGER_POWEROFF_CHARGE" ] 83 } 84 85 if (has_display_manager_part) { 86 sources += [ "display/device_state_action.cpp" ] 87 public_configs += [ ":powermgr_display_actions_impl_public_config" ] 88 external_deps += [ 89 "display_manager:displaymgr", 90 "window_manager:libdm_lite", 91 ] 92 } else { 93 sources += [ "display/default_device_state_action.cpp" ] 94 } 95 96 subsystem_name = "powermgr" 97 part_name = "${powermgr_part_name}" 98} 99