1# Copyright (c) 2022 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/ohos.gni") 15import("//foundation/communication/netmanager_base/netmanager_base_config.gni") 16 17config("policy_config") { 18 visibility = [ ":policy" ] 19 20 include_dirs = [ 21 "include", 22 "include/context", 23 "$INNERKITS_ROOT/include", 24 "$NETMANAGER_BASE_ROOT/utils/log/include", 25 ] 26 27 cflags = [ 28 "-Wall", 29 "-Werror", 30 "-g3", 31 ] 32} 33 34ohos_shared_library("policy") { 35 sanitize = { 36 cfi = true 37 cfi_cross_dso = true 38 boundary_sanitize = true 39 all_ubsan = true 40 debug = false 41 } 42 43 sources = [ 44 "src/context/get_net_quota_policies_context.cpp", 45 "src/context/get_policy_by_uid_context.cpp", 46 "src/context/get_uids_by_policy_context.cpp", 47 "src/context/is_uid_net_allowed_context.cpp", 48 "src/context/restore_all_policies_context.cpp", 49 "src/context/set_bg_policy_context.cpp", 50 "src/context/set_device_idle_allow_list_context.cpp", 51 "src/context/set_net_quota_policies_context.cpp", 52 "src/context/set_policy_by_uid_context.cpp", 53 "src/context/set_power_save_allow_list_context.cpp", 54 "src/context/update_remind_policy_context.cpp", 55 "src/net_policy_callback_observer.cpp", 56 "src/netpolicy_async_work.cpp", 57 "src/netpolicy_exec.cpp", 58 "src/netpolicy_module.cpp", 59 "src/policy_observer_wrapper.cpp", 60 ] 61 62 configs = [ ":policy_config" ] 63 64 deps = [ 65 "$INNERKITS_ROOT/netpolicyclient:net_policy_manager_if", 66 "$NETMANAGER_BASE_ROOT/utils/napi_utils:napi_utils", 67 ] 68 69 external_deps = [ 70 "c_utils:utils", 71 "hilog:libhilog", 72 "ipc:ipc_core", 73 "napi:ace_napi", 74 ] 75 relative_install_dir = "module/net" 76 part_name = "netmanager_base" 77 78 subsystem_name = "communication" 79} 80