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 sources = [ 36 "src/context/get_net_quota_policies_context.cpp", 37 "src/context/get_policy_by_uid_context.cpp", 38 "src/context/get_uids_by_policy_context.cpp", 39 "src/context/is_uid_net_allowed_context.cpp", 40 "src/context/restore_all_policies_context.cpp", 41 "src/context/set_bg_policy_context.cpp", 42 "src/context/set_device_idle_allow_list_context.cpp", 43 "src/context/set_net_quota_policies_context.cpp", 44 "src/context/set_policy_by_uid_context.cpp", 45 "src/context/update_remind_policy_context.cpp", 46 "src/net_policy_callback_observer.cpp", 47 "src/netpolicy_async_work.cpp", 48 "src/netpolicy_exec.cpp", 49 "src/netpolicy_module.cpp", 50 "src/policy_observer_wrapper.cpp", 51 ] 52 53 configs = [ ":policy_config" ] 54 55 deps = [ 56 "$INNERKITS_ROOT/netpolicyclient:net_policy_manager_if", 57 "$NETMANAGER_BASE_ROOT/utils/napi_utils:napi_utils", 58 "//foundation/arkui/napi/:ace_napi", 59 "//third_party/libuv:uv", 60 ] 61 62 external_deps = [ 63 "c_utils:utils", 64 "hiviewdfx_hilog_native:libhilog", 65 "ipc:ipc_core", 66 ] 67 relative_install_dir = "module/net" 68 part_name = "netmanager_base" 69 70 subsystem_name = "communication" 71} 72