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") 15 16config("powermgr_public_config") { 17 include_dirs = [ 18 "native/include", 19 "zidl/include", 20 "${powermgr_inner_api}/native/include", 21 ] 22} 23 24config("powermgr_private_config") { 25 include_dirs = [ 26 "native/src", 27 "native/src/setting", 28 "native/src/shutdown", 29 "native/src/suspend", 30 "native/src/wakeup", 31 ] 32} 33 34ohos_shared_library("powermgrservice") { 35 sources = [ 36 "native/src/power_hdi_callback.cpp", 37 "native/src/power_mgr_dumper.cpp", 38 "native/src/power_mgr_factory.cpp", 39 "native/src/power_mgr_notify.cpp", 40 "native/src/power_mgr_service.cpp", 41 "native/src/power_mode_module.cpp", 42 "native/src/power_mode_policy.cpp", 43 "native/src/power_save_mode.cpp", 44 "native/src/power_state_machine.cpp", 45 "native/src/running_lock_inner.cpp", 46 "native/src/running_lock_mgr.cpp", 47 "native/src/running_lock_proxy.cpp", 48 "native/src/setting/setting_helper.cpp", 49 "native/src/shutdown/shutdown_callback_holer.cpp", 50 "native/src/shutdown/shutdown_controller.cpp", 51 "native/src/shutdown/shutdown_dialog.cpp", 52 "native/src/suspend/suspend_controller.cpp", 53 "native/src/suspend/suspend_source_parser.cpp", 54 "native/src/suspend/suspend_sources.cpp", 55 "native/src/wakeup/wakeup_controller.cpp", 56 "native/src/wakeup/wakeup_source_parser.cpp", 57 "native/src/wakeup/wakeup_sources.cpp", 58 ] 59 60 configs = [ 61 ":powermgr_private_config", 62 "${powermgr_utils_path}:utils_config", 63 "${powermgr_utils_path}:coverage_flags", 64 ] 65 66 public_configs = [ ":powermgr_public_config" ] 67 68 deps = [ 69 ":powermgr_stub", 70 "${powermgr_inner_api}:powermgr_client", 71 "${powermgr_utils_path}/ffrt:power_ffrt", 72 "${powermgr_utils_path}/param:power_sysparam", 73 "${powermgr_utils_path}/permission:power_permission", 74 "${powermgr_utils_path}/setting:power_setting", 75 "native/src/actions:powermgr_actions", 76 "//third_party/jsoncpp:jsoncpp", 77 "//third_party/libxml2:libxml2", 78 ] 79 80 external_deps = [ 81 "ability_base:want", 82 "ability_runtime:ability_manager", 83 "c_utils:utils", 84 "c_utils:utils", 85 "common_event_service:cesfwk_innerkits", 86 "config_policy:configpolicy_util", 87 "data_share:datashare_consumer", 88 "device_standby:standby_innerkits", 89 "drivers_interface_power:libpower_proxy_1.1", 90 "ffrt:libffrt", 91 "hdf_core:libhdi", 92 "hdf_core:libpub_utils", 93 "hicollie:libhicollie", 94 "hilog:libhilog", 95 "hisysevent:libhisysevent", 96 "hitrace:hitrace_meter", 97 "image_framework:image_native", 98 "input:libmmi-client", 99 "ipc:ipc_core", 100 "safwk:system_ability_fwk", 101 "sensor:sensor_interface_native", 102 ] 103 104 if (has_display_manager_part) { 105 external_deps += [ 106 "display_manager:displaymgr", 107 "window_manager:libdm", 108 ] 109 } 110 111 if (power_manager_feature_poweroff_charge) { 112 external_deps += [ 113 "battery_manager:batterysrv_client", 114 "drivers_interface_factory:libfactory_proxy_1.0", 115 ] 116 117 defines = [ "POWER_MANAGER_POWEROFF_CHARGE" ] 118 } 119 120 subsystem_name = "powermgr" 121 part_name = "${powermgr_part_name}" 122} 123 124config("zidl_private_config") { 125 include_dirs = [ "zidl/src/shutdown" ] 126} 127 128ohos_shared_library("powermgr_stub") { 129 sources = [ 130 "zidl/src/power_mgr_stub.cpp", 131 "zidl/src/power_mode_callback_stub.cpp", 132 "zidl/src/power_state_callback_stub.cpp", 133 "zidl/src/shutdown/shutdown_stub_delegator.cpp", 134 ] 135 136 configs = [ 137 "${powermgr_utils_path}:utils_config", 138 "${powermgr_utils_path}:coverage_flags", 139 ":zidl_private_config", 140 ] 141 142 public_configs = [ ":powermgr_public_config" ] 143 144 deps = [ "${powermgr_inner_api}:powermgr_client" ] 145 146 external_deps = [ 147 "c_utils:utils", 148 "hicollie:libhicollie", 149 "hilog:libhilog", 150 "ipc:ipc_core", 151 ] 152 153 subsystem_name = "powermgr" 154 part_name = "${powermgr_part_name}" 155} 156 157group("service") { 158 deps = [ 159 ":powermgr_stub", 160 ":powermgrservice", 161 "native/profile:power_service_config", 162 ] 163} 164