1 /*
2  * Copyright (c) 2023 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 
16 #include "network_status.h"
17 #include "dfs_error.h"
18 
19 namespace OHOS::FileManagement::CloudSync {
20 using namespace CloudFile;
21 
RegisterNetConnCallback(std::shared_ptr<DataSyncManager> dataSyncManager)22 int32_t NetworkStatus::RegisterNetConnCallback(std::shared_ptr<DataSyncManager> dataSyncManager)
23 {
24     return E_OK;
25 }
26 
GetDefaultNet()27 int32_t NetworkStatus::GetDefaultNet()
28 {
29     return E_OK;
30 }
31 
SetNetConnStatus(NetManagerStandard::NetAllCapabilities & netAllCap)32 void NetworkStatus::SetNetConnStatus(NetManagerStandard::NetAllCapabilities &netAllCap)
33 {
34 }
35 
GetAndRegisterNetwork(std::shared_ptr<DataSyncManager> dataSyncManager)36 int32_t NetworkStatus::GetAndRegisterNetwork(std::shared_ptr<DataSyncManager> dataSyncManager)
37 {
38     int32_t res = GetDefaultNet();
39     if (res != E_OK) {
40         return res;
41     }
42 
43     return RegisterNetConnCallback(dataSyncManager);
44 }
45 
InitNetwork(std::shared_ptr<DataSyncManager> dataSyncManager)46 void NetworkStatus::InitNetwork(std::shared_ptr<DataSyncManager> dataSyncManager)
47 {
48 }
49 
SetNetConnStatus(NetworkStatus::NetConnStatus netStatus)50 void NetworkStatus::SetNetConnStatus(NetworkStatus::NetConnStatus netStatus)
51 {
52     return;
53 }
54 
CheckMobileNetwork(const std::string & bundleName,const int32_t userId)55 bool NetworkStatus::CheckMobileNetwork(const std::string &bundleName, const int32_t userId)
56 {
57     return true;
58 }
59 
CheckNetwork(const std::string & bundleName,const int32_t userId)60 bool NetworkStatus::CheckNetwork(const std::string &bundleName, const int32_t userId)
61 {
62     return true;
63 }
64 
GetNetConnStatus()65 NetworkStatus::NetConnStatus NetworkStatus::GetNetConnStatus()
66 {
67     return NetworkStatus::NetConnStatus::WIFI_CONNECT;
68 }
69 
NetWorkChangeStopUploadTask()70 void NetworkStatus::NetWorkChangeStopUploadTask()
71 {
72 }
73 } // namespace OHOS::FileManagement::CloudSync