# Copyright (c) 2022-2023 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/ohos.gni") import("//foundation/communication/netmanager_ext/netmanager_ext_config.gni") config("net_tether_manager_config") { include_dirs = [ "$UTILS_ROOT/native/base/include", "$UTILS_ROOT/system/safwk/native/include", "$THIRD_PARTY_ROOT/json/include", "$THIRD_PARTY_ROOT/openssl/include", "$BASE_INNERKITS_ROOT/netshareclient/include", "$BASE_INNERKITS_ROOT/netshareclient/include/proxy", "$BASE_INNERKITS_ROOT/netshareclient/include/proxy/ipccallback", "$BASE_INNERKITS_ROOT/ethernetclient/include/proxy", "$BASE_INNERKITS_ROOT/netstatsclient/include", "$EXT_INNERKITS_ROOT/include", "$EXT_INNERKITS_ROOT/netshareclient/include", "$EXT_INNERKITS_ROOT/netshareclient/include/proxy", "$EXT_INNERKITS_ROOT/netshareclient/include/proxy/ipccallback", "$NETCONNMANAGER_COMMON_DIR/include", "$NETMANAGER_EXT_ROOT/utils/log/include", "$NETWORKSHAREMANAGER_SOURCE_DIR/include", "$NETWORKSHAREMANAGER_SOURCE_DIR/include/stub", "$NETWORKSHAREMANAGER_UTILS_DIR/event_report/include", "$BASE_INNERKITS_ROOT/include", "$BASE_INNERKITS_ROOT/netconnclient/include", "$BASE_INNERKITS_ROOT/netmanagernative/include", "$BASE_INNERKITS_ROOT/dnsresolverclient/include", "$NETSYSCONTROLLER_ROOT_DIR/include", "$WIFI_MANAGER_ROOT/interfaces/kits/c", "$WIFI_MANAGER_ROOT/frameworks/native/interfaces", "$DHCP_MANAGER_ROOT/interfaces/inner_api/interfaces", "$DHCP_MANAGER_ROOT/interfaces/inner_api/include", "$BLUETOOTH_ROOT/interfaces/inner_api/include", "$USB_MANAGER_ROOT/interfaces/innerkits/native/include", "$USB_MANAGER_ROOT/utils/native/include", "$USB_MANAGER_ROOT/services/zidl/include", "//third_party/jsoncpp/include/json", "$NETMANAGER_BASE_ROOT/services/netmanagernative/include/netsys", "$NETMANAGER_BASE_ROOT/utils/common_utils/include", "$SAMGR_MANAGER_ROOT/interfaces/innerkits/samgr_proxy/include", ] } ohos_shared_library("net_tether_manager") { sources = [ "$NETWORKSHAREMANAGER_INNERKITS_SOURCE_DIR/src/proxy/ipccallback/sharing_event_callback_proxy.cpp", "$NETWORKSHAREMANAGER_INNERKITS_SOURCE_DIR/src/proxy/ipccallback/sharing_event_callback_stub.cpp", "$NETWORKSHAREMANAGER_SOURCE_DIR/src/networkshare_configuration.cpp", "$NETWORKSHAREMANAGER_SOURCE_DIR/src/networkshare_hisysevent.cpp", "$NETWORKSHAREMANAGER_SOURCE_DIR/src/networkshare_main_statemachine.cpp", "$NETWORKSHAREMANAGER_SOURCE_DIR/src/networkshare_service.cpp", "$NETWORKSHAREMANAGER_SOURCE_DIR/src/networkshare_sub_statemachine.cpp", "$NETWORKSHAREMANAGER_SOURCE_DIR/src/networkshare_tracker.cpp", "$NETWORKSHAREMANAGER_SOURCE_DIR/src/networkshare_upstreammonitor.cpp", "$NETWORKSHAREMANAGER_SOURCE_DIR/src/stub/networkshare_service_stub.cpp", ] configs = [ ":net_tether_manager_config" ] deps = [ "$NETMANAGER_EXT_ROOT/utils:net_event_report" ] cflags = [ "-fvisibility=hidden", "-fdata-sections", "-ffunction-sections", "-Os", ] cflags_cc = [ "-fvisibility-inlines-hidden", "-Os", ] ldflags = [ "-Wl,--exclude-libs=ALL", "-Wl,--gc-sections", ] external_deps = [ "c_utils:utils", "dhcp:dhcp_manager_service", "drivers_interface_usb:usb_idl_headers", "eventhandler:libeventhandler", "ipc:ipc_core", "netmanager_base:net_conn_manager_if", "netmanager_base:net_manager_common", "netmanager_base:netsys_controller", "safwk:system_ability_fwk", "usb_manager:usbsrv_client", "wifi:wifi_sdk", ] if (!defined(global_parts_info) || defined(global_parts_info.communication_bluetooth)) { defines = [ "BLUETOOTH_MODOULE=1" ] external_deps += [ "bluetooth:btframework" ] } else { defines = [] } defines += [ "NETMGR_LOG_TAG = \"NetworkShareManager\"", "LOG_DOMAIN = 0xD0015B0", "NETWORK_SHARING_CONFIG_PATH = \"/system/etc/communication/netmanager_ext/network_share_config.cfg\"", ] if (enable_netmgr_ext_debug) { defines += [ "NETMGR_DEBUG" ] } external_deps += [ "hilog:libhilog" ] part_name = "netmanager_ext" subsystem_name = "communication" } ohos_static_library("net_tether_manager_static") { testonly = true sources = [ "$NETWORKSHAREMANAGER_INNERKITS_SOURCE_DIR/src/proxy/ipccallback/sharing_event_callback_proxy.cpp", "$NETWORKSHAREMANAGER_INNERKITS_SOURCE_DIR/src/proxy/ipccallback/sharing_event_callback_stub.cpp", "$NETWORKSHAREMANAGER_SOURCE_DIR/src/networkshare_configuration.cpp", "$NETWORKSHAREMANAGER_SOURCE_DIR/src/networkshare_hisysevent.cpp", "$NETWORKSHAREMANAGER_SOURCE_DIR/src/networkshare_main_statemachine.cpp", "$NETWORKSHAREMANAGER_SOURCE_DIR/src/networkshare_service.cpp", "$NETWORKSHAREMANAGER_SOURCE_DIR/src/networkshare_sub_statemachine.cpp", "$NETWORKSHAREMANAGER_SOURCE_DIR/src/networkshare_tracker.cpp", "$NETWORKSHAREMANAGER_SOURCE_DIR/src/networkshare_upstreammonitor.cpp", "$NETWORKSHAREMANAGER_SOURCE_DIR/src/stub/networkshare_service_stub.cpp", ] configs = [ ":net_tether_manager_config" ] deps = [ "$BASE_INNERKITS_ROOT/netconnclient:net_conn_manager_if", "$DHCP_MANAGER_ROOT/services/mgr_service:dhcp_manager_service", "$NETMANAGER_BASE_ROOT/utils:net_manager_common", "$NETMANAGER_EXT_ROOT/utils:net_event_report", "$NETSYSCONTROLLER_ROOT_DIR:netsys_controller", "$USB_MANAGER_ROOT/interfaces/innerkits:usbsrv_client", ] external_deps = [ "c_utils:utils", "drivers_interface_usb:usb_idl_headers", "eventhandler:libeventhandler", "ipc:ipc_core", "safwk:system_ability_fwk", "wifi:wifi_sdk", ] if (!defined(global_parts_info) || defined(global_parts_info.communication_bluetooth)) { defines = [ "BLUETOOTH_MODOULE=1" ] external_deps += [ "bluetooth:btframework" ] } else { defines = [] } defines += [ "NETMGR_LOG_TAG = \"NetworkShareManager\"", "LOG_DOMAIN = 0xD0015B0", "NETWORK_SHARING_CONFIG_PATH = \"/system/etc/communication/netmanager_ext/network_share_config.cfg\"", ] if (enable_netmgr_ext_debug) { defines += [ "NETMGR_DEBUG" ] } external_deps += [ "hilog:libhilog" ] part_name = "netmanager_ext" subsystem_name = "communication" } ## Install network_share_config.cfg to /system/etc/communication/netmanager_ext ohos_prebuilt_etc("network_share_config") { source = "$NETMANAGER_EXT_ROOT/services/networksharemanager/network_share_config.cfg" install_enable = true relative_install_dir = "communication/netmanager_ext" part_name = "netmanager_ext" }