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 = [ "${powermgr_utils_path}/ffrt:power_ffrt" ] 57 58 external_deps = [ 59 "c_utils:utils", 60 "drivers_interface_power:libpower_proxy_1.2", 61 "ffrt:libffrt", 62 "hdf_core:libhdf_utils", 63 "hdf_core:libhdi", 64 "hdf_core:libpub_utils", 65 "hilog:libhilog", 66 "image_framework:image_native", 67 "init:libbegetutil", 68 "ipc:ipc_core", 69 ] 70 71 if (has_display_manager_part) { 72 sources += [ "display/device_state_action.cpp" ] 73 public_configs += [ ":powermgr_display_actions_impl_public_config" ] 74 external_deps += [ 75 "display_manager:displaymgr", 76 "window_manager:libdm_lite", 77 ] 78 } else { 79 sources += [ "display/default_device_state_action.cpp" ] 80 } 81 82 subsystem_name = "powermgr" 83 part_name = "${powermgr_part_name}" 84} 85