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("//build/config/components/idl_tool/idl.gni") 15import("../../displaymgr.gni") 16 17config("displaymgr_private_config") { 18 include_dirs = [ "${displaymgr_inner_api}/native/include" ] 19} 20 21config("displaymgr_public_config") { 22 include_dirs = [ 23 "native/include", 24 "zidl/include", 25 "${target_gen_dir}", 26 ] 27} 28 29ohos_shared_library("displaymgrservice") { 30 sanitize = { 31 cfi = true 32 cfi_cross_dso = true 33 debug = false 34 } 35 branch_protector_ret = "pac_ret" 36 37 sources = [ 38 "${displaymgr_utils_path}/native/src/display_xcollie.cpp", 39 "native/src/display_auto_brightness.cpp", 40 "native/src/display_common_event_mgr.cpp", 41 "native/src/display_param_helper.cpp", 42 "native/src/display_power_mgr_service.cpp", 43 "native/src/display_setting_helper.cpp", 44 "native/src/display_system_ability.cpp", 45 "native/src/gradual_animator.cpp", 46 "native/src/screen_action.cpp", 47 "native/src/screen_controller.cpp", 48 "zidl/src/display_brightness_callback_proxy.cpp", 49 "zidl/src/display_power_callback_proxy.cpp", 50 ] 51 52 configs = [ 53 "${displaymgr_utils_path}:utils_config", 54 ":displaymgr_private_config", 55 "${displaymgr_utils_path}:coverage_flags", 56 ] 57 58 deps = [ 59 "${displaymgr_root_path}/service:displaymgr_stub", 60 ] 61 public_configs = [ 62 ":displaymgr_public_config", 63 "${brightnessmgr_root_path}:brightness_manager_config", 64 ] 65 66 public_deps = [ "${brightnessmgr_root_path}:brightness_manager" ] 67 68 external_deps = [ "power_manager:power_permission" ] 69 external_deps += [ 70 "ability_base:zuri", 71 "ability_runtime:ability_manager", 72 "cJSON:cjson", 73 "c_utils:utils", 74 "data_share:datashare_consumer", 75 "eventhandler:libeventhandler", 76 "ffrt:libffrt", 77 "graphic_2d:librender_service_base", 78 "hicollie:libhicollie", 79 "hilog:libhilog", 80 "image_framework:image_native", 81 "ipc:ipc_core", 82 "power_manager:power_ffrt", 83 "power_manager:power_setting", 84 "power_manager:power_sysparam", 85 "power_manager:powermgr_client", 86 "safwk:system_ability_fwk", 87 "samgr:samgr_proxy", 88 "skia:skia_canvaskit", 89 "window_manager:libdm_lite", 90 ] 91 92 defines = [] 93 if (has_sensors_sensor_part) { 94 external_deps += [ "sensor:sensor_interface_native" ] 95 defines += [ "ENABLE_SENSOR_PART" ] 96 } 97 if (has_hiviewdfx_hisysevent_part) { 98 external_deps += [ "hisysevent:libhisysevent" ] 99 } 100 if (use_clang_coverage) { 101 defines += [ "FUZZ_COV_TEST" ] 102 } 103 shlib_type = "sa" 104 subsystem_name = "powermgr" 105 part_name = "${displaymgr_part_name}" 106} 107 108idl_gen_interface("displaymgr_interface") { 109 sources = [ 110 "IDisplayPowerMgr.idl" 111 ] 112 configs = [ 113 "${displaymgr_utils_path}:utils_config", 114 ":displaymgr_private_config", 115 "${displaymgr_utils_path}:coverage_flags", 116 ] 117 log_domainid = "0xD002982" 118 log_tag = "DisplayPowerSvc" 119 part_name = "${displaymgr_part_name}" 120 subsystem_name = "powermgr" 121} 122 123ohos_source_set("displaymgr_proxy") { 124 sanitize = { 125 cfi = true 126 cfi_cross_dso = true 127 debug = false 128 } 129 output_values = get_target_outputs(":displaymgr_interface") 130 sources = filter_include(output_values, [ "*_proxy.cpp" ]) 131 132 configs = [ 133 "${displaymgr_utils_path}:utils_config", 134 ":displaymgr_private_config", 135 "${displaymgr_utils_path}:coverage_flags", 136 ] 137 deps = [ ":displaymgr_interface" ] 138 public_configs = [ ":displaymgr_public_config" ] 139 140 external_deps = [ 141 "c_utils:utils", 142 "hicollie:libhicollie", 143 "hilog:libhilog", 144 "ipc:ipc_core", 145 "power_manager:power_setting", 146 "safwk:system_ability_fwk", 147 ] 148 part_name = "${displaymgr_part_name}" 149 subsystem_name = "powermgr" 150} 151 152ohos_source_set("displaymgr_stub") { 153 sanitize = { 154 cfi = true 155 cfi_cross_dso = true 156 debug = false 157 } 158 output_values = get_target_outputs(":displaymgr_interface") 159 sources = filter_include(output_values, [ "*_stub.cpp" ]) 160 161 configs = [ 162 "${displaymgr_utils_path}:utils_config", 163 ":displaymgr_private_config", 164 "${displaymgr_utils_path}:coverage_flags", 165 ] 166 deps = [ ":displaymgr_interface" ] 167 public_configs = [ ":displaymgr_public_config" ] 168 169 external_deps = [ 170 "c_utils:utils", 171 "hicollie:libhicollie", 172 "hilog:libhilog", 173 "ipc:ipc_core", 174 "power_manager:power_setting", 175 "safwk:system_ability_fwk", 176 ] 177 178 subsystem_name = "powermgr" 179 part_name = "${displaymgr_part_name}" 180} 181