1 /*
2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15 #include "net_conn_service_iface.h"
16 #include "net_conn_service.h"
17
18 namespace OHOS {
19 namespace NetManagerStandard {
GetIfaceNames(NetBearType bearerType,std::list<std::string> & ifaceNames)20 int32_t NetConnServiceIface::GetIfaceNames(NetBearType bearerType, std::list<std::string> &ifaceNames)
21 {
22 return DelayedSingleton<NetConnService>::GetInstance()->GetIfaceNames(bearerType, ifaceNames);
23 }
24
GetIfaceNameByType(NetBearType bearerType,const std::string & ident,std::string & ifaceName)25 int32_t NetConnServiceIface::GetIfaceNameByType(
26 NetBearType bearerType, const std::string &ident, std::string &ifaceName)
27 {
28 return DelayedSingleton<NetConnService>::GetInstance()->GetIfaceNameByType(bearerType, ident, ifaceName);
29 }
30
RegisterNetSupplier(NetBearType bearerType,const std::string & ident,const std::set<NetCap> & netCaps,uint32_t & supplierId)31 int32_t NetConnServiceIface::RegisterNetSupplier(NetBearType bearerType,
32 const std::string &ident, const std::set<NetCap> &netCaps, uint32_t &supplierId)
33 {
34 return DelayedSingleton<NetConnService>::GetInstance()->RegisterNetSupplier(
35 bearerType, ident, netCaps, supplierId);
36 }
37
UnregisterNetSupplier(uint32_t supplierId)38 int32_t NetConnServiceIface::UnregisterNetSupplier(uint32_t supplierId)
39 {
40 return DelayedSingleton<NetConnService>::GetInstance()->UnregisterNetSupplier(supplierId);
41 }
42
UpdateNetLinkInfo(uint32_t supplierId,const sptr<NetLinkInfo> & netLinkInfo)43 int32_t NetConnServiceIface::UpdateNetLinkInfo(uint32_t supplierId, const sptr<NetLinkInfo> &netLinkInfo)
44 {
45 return DelayedSingleton<NetConnService>::GetInstance()->UpdateNetLinkInfo(supplierId, netLinkInfo);
46 }
47
UpdateNetSupplierInfo(uint32_t supplierId,const sptr<NetSupplierInfo> & netSupplierInfo)48 int32_t NetConnServiceIface::UpdateNetSupplierInfo(uint32_t supplierId, const sptr<NetSupplierInfo> &netSupplierInfo)
49 {
50 return DelayedSingleton<NetConnService>::GetInstance()->UpdateNetSupplierInfo(supplierId, netSupplierInfo);
51 }
52
RestrictBackgroundChanged(bool isRestrictBackground)53 int32_t NetConnServiceIface::RestrictBackgroundChanged(bool isRestrictBackground)
54 {
55 return DelayedSingleton<NetConnService>::GetInstance()->RestrictBackgroundChanged(isRestrictBackground);
56 }
57 } // namespace NetManagerStandard
58 } // namespace OHOS