1# Copyright (c) 2021-2025 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("//base/notification/distributed_notification_service/notification.gni") 15import("//build/config/components/idl_tool/idl.gni") 16 17idl_gen_interface("ans_manager_interface") { 18 sources = [ 19 "IAnsDialogCallback.idl", 20 "IAnsManager.idl", 21 "IAnsOperationCallback.idl", 22 "IAnsSubscriber.idl", 23 "IAnsSubscriberLocalLiveView.idl", 24 "ISwingCallBack.idl", 25 ] 26 log_domainid = "0xD001203" 27 log_tag = "Ans" 28 subsystem_name = "notification" 29 part_name = "distributed_notification_service" 30} 31 32group("ans_client") { 33 deps = [ ":ans_innerkits" ] 34} 35 36config("ans_innerkits_public_config") { 37 visibility = [ "./../../*" ] 38 39 include_dirs = [ 40 "${inner_api_path}", 41 "${interfaces_path}/kits/native", 42 "${core_path}/common/include", 43 "${core_path}/include", 44 "${target_gen_dir}", 45 ] 46} 47 48config("ans_innerkits_config") { 49 visibility = [ "./../../*" ] 50 51 include_dirs = [ 52 "${inner_api_path}", 53 "${interfaces_path}/kits/native", 54 "${core_path}/common/include", 55 "${core_path}/include", 56 "${target_gen_dir}", 57 ] 58} 59 60ohos_shared_library("ans_innerkits") { 61 sanitize = { 62 integer_overflow = true 63 ubsan = true 64 boundary_sanitize = true 65 cfi = true 66 cfi_cross_dso = true 67 debug = false 68 } 69 branch_protector_ret = "pac_ret" 70 71 include_dirs = [ "${inner_api_path}" ] 72 73 sources = [ 74 "${core_path}/common/src/ans_convert_enum.cpp", 75 "${core_path}/common/src/ans_inner_errors.cpp", 76 "${core_path}/src/ans_image_util.cpp", 77 "${core_path}/src/ans_notification.cpp", 78 "${core_path}/src/dialog_status_data.cpp", 79 "${core_path}/src/hitrace_util.cpp", 80 "${core_path}/src/listener/ans_subscriber_listener.cpp", 81 "${core_path}/src/listener/swing_callback_service.cpp", 82 "${core_path}/src/manager/ans_manager_death_recipient.cpp", 83 "${frameworks_module_ans_path}/src/ans_dialog_host_client.cpp", 84 "${frameworks_module_ans_path}/src/badge_number_callback_data.cpp", 85 "${frameworks_module_ans_path}/src/distributed_bundle_option.cpp", 86 "${frameworks_module_ans_path}/src/enabled_notification_callback_data.cpp", 87 "${frameworks_module_ans_path}/src/message_user.cpp", 88 "${frameworks_module_ans_path}/src/notification.cpp", 89 "${frameworks_module_ans_path}/src/notification_action_button.cpp", 90 "${frameworks_module_ans_path}/src/notification_basic_content.cpp", 91 "${frameworks_module_ans_path}/src/notification_bundle_option.cpp", 92 "${frameworks_module_ans_path}/src/notification_button_option.cpp", 93 "${frameworks_module_ans_path}/src/notification_capsule.cpp", 94 "${frameworks_module_ans_path}/src/notification_check_info.cpp", 95 "${frameworks_module_ans_path}/src/notification_check_request.cpp", 96 "${frameworks_module_ans_path}/src/notification_constant.cpp", 97 "${frameworks_module_ans_path}/src/notification_content.cpp", 98 "${frameworks_module_ans_path}/src/notification_conversational_content.cpp", 99 "${frameworks_module_ans_path}/src/notification_conversational_message.cpp", 100 "${frameworks_module_ans_path}/src/notification_disable.cpp", 101 "${frameworks_module_ans_path}/src/notification_distributed_options.cpp", 102 "${frameworks_module_ans_path}/src/notification_do_not_disturb_date.cpp", 103 "${frameworks_module_ans_path}/src/notification_do_not_disturb_profile.cpp", 104 "${frameworks_module_ans_path}/src/notification_flags.cpp", 105 "${frameworks_module_ans_path}/src/notification_helper.cpp", 106 "${frameworks_module_ans_path}/src/notification_icon_button.cpp", 107 "${frameworks_module_ans_path}/src/notification_live_view_content.cpp", 108 "${frameworks_module_ans_path}/src/notification_local_live_view_button.cpp", 109 "${frameworks_module_ans_path}/src/notification_local_live_view_content.cpp", 110 "${frameworks_module_ans_path}/src/notification_local_live_view_subscriber.cpp", 111 "${frameworks_module_ans_path}/src/notification_long_text_content.cpp", 112 "${frameworks_module_ans_path}/src/notification_media_content.cpp", 113 "${frameworks_module_ans_path}/src/notification_multiline_content.cpp", 114 "${frameworks_module_ans_path}/src/notification_normal_content.cpp", 115 "${frameworks_module_ans_path}/src/notification_operation_info.cpp", 116 "${frameworks_module_ans_path}/src/notification_picture_content.cpp", 117 "${frameworks_module_ans_path}/src/notification_progress.cpp", 118 "${frameworks_module_ans_path}/src/notification_request.cpp", 119 "${frameworks_module_ans_path}/src/notification_slot.cpp", 120 "${frameworks_module_ans_path}/src/notification_sorting.cpp", 121 "${frameworks_module_ans_path}/src/notification_sorting_map.cpp", 122 "${frameworks_module_ans_path}/src/notification_subscribe_info.cpp", 123 "${frameworks_module_ans_path}/src/notification_subscriber.cpp", 124 "${frameworks_module_ans_path}/src/notification_template.cpp", 125 "${frameworks_module_ans_path}/src/notification_time.cpp", 126 "${frameworks_module_ans_path}/src/notification_unified_group_info.cpp", 127 "${frameworks_module_ans_path}/src/notification_user_input.cpp", 128 "${frameworks_module_ans_path}/src/push_callback_stub.cpp", 129 "${frameworks_module_ans_path}/src/push_promise_callback.cpp", 130 ] 131 132 output_values = get_target_outputs(":ans_manager_interface") 133 sources += filter_include(output_values, 134 [ 135 "*_dialog_callback_proxy.cpp", 136 "*_operation_callback_proxy.cpp", 137 "*_subscriber_proxy.cpp", 138 "*_subscriber_local_live_view_proxy.cpp", 139 "*_manager_proxy.cpp", 140 ]) 141 sources += filter_include(output_values, 142 [ 143 "*_dialog_callback_stub.cpp", 144 "*_operation_callback_stub.cpp", 145 "*_subscriber_stub.cpp", 146 "*_subscriber_local_live_view_stub.cpp", 147 "*_manager_stub.cpp", 148 ]) 149 150 public_configs = [ ":ans_innerkits_public_config" ] 151 152 defines = [] 153 154 deps = [ ":ans_manager_interface" ] 155 156 external_deps = [ 157 "ability_base:want", 158 "ability_base:zuri", 159 "ability_runtime:appkit_native", 160 "bundle_framework:appexecfwk_base", 161 "bundle_framework:appexecfwk_core", 162 "cJSON:cjson_static", 163 "c_utils:utils", 164 "eventhandler:libeventhandler", 165 "ffrt:libffrt", 166 "hicollie:libhicollie", 167 "hilog:libhilog", 168 "hitrace:libhitracechain", 169 "i18n:intl_util", 170 "ipc:ipc_core", 171 "samgr:samgr_proxy", 172 "time_service:time_client", 173 ] 174 175 public_external_deps = [ 176 "ability_runtime:wantagent_innerkits", 177 "image_framework:image_native", 178 "json:nlohmann_json_static", 179 ] 180 181 if (is_double_framework) { 182 cflags = [ "-DCONFIG_DUAL_FRAMEWORK" ] 183 } 184 185 if (ans_hitrace_usage) { 186 external_deps += [ "hitrace:hitrace_meter" ] 187 defines += [ "HITRACE_METER_ENABLE" ] 188 } 189 190 if (notification_smart_reminder_supported) { 191 defines += [ "NOTIFICATION_SMART_REMINDER_SUPPORTED" ] 192 sources += filter_include(output_values, [ "*_call_back_proxy.cpp" ]) 193 sources += filter_include(output_values, [ "*_call_back_stub.cpp" ]) 194 } 195 196 if (distributed_notification_service_feature_privileged_message) { 197 defines += [ "ENABLE_ANS_PRIVILEGED_MESSAGE_EXT_WRAPPER" ] 198 } 199 200 subsystem_name = "${subsystem_name}" 201 part_name = "${component_name}" 202} 203 204ohos_source_set("ans_manager_stub") { 205 sanitize = { 206 integer_overflow = true 207 ubsan = true 208 boundary_sanitize = true 209 cfi = true 210 cfi_cross_dso = true 211 debug = false 212 } 213 public_configs = [ ":ans_innerkits_config" ] 214 output_values = get_target_outputs(":ans_manager_interface") 215 sources = filter_include(output_values, [ "*_stub.cpp" ]) 216 deps = [ ":ans_manager_interface" ] 217 external_deps = [ 218 "c_utils:utils", 219 "hicollie:libhicollie", 220 "hilog:libhilog", 221 "i18n:intl_util", 222 "ipc:ipc_core", 223 "samgr:samgr_proxy", 224 ] 225 public_external_deps = [ 226 "ability_runtime:wantagent_innerkits", 227 "image_framework:image_native", 228 ] 229 subsystem_name = "notification" 230 part_name = "distributed_notification_service" 231} 232