1 /*
2 * Copyright (c) 2024-2025 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 "data_sync_manager.h"
17 #include "dfs_error.h"
18
19 namespace OHOS::FileManagement::CloudFile {
20 using namespace std;
21
TriggerStartSync(const std::string & bundleName,const int32_t userId,bool forceFlag,SyncTriggerType triggerType,std::string prepareTraceId)22 int32_t DataSyncManager::TriggerStartSync(const std::string &bundleName,
23 const int32_t userId,
24 bool forceFlag,
25 SyncTriggerType triggerType,
26 std::string prepareTraceId)
27 {
28 return E_OK;
29 }
30
TriggerStopSync(const std::string & bundleName,const int32_t userId,bool forceFlag,SyncTriggerType triggerType)31 int32_t DataSyncManager::TriggerStopSync(const std::string &bundleName,
32 const int32_t userId,
33 bool forceFlag,
34 SyncTriggerType triggerType)
35 {
36 return E_OK;
37 }
38
StopSyncSynced(const std::string & bundleName,const int32_t userId,bool forceFlag,SyncTriggerType triggerType)39 int32_t DataSyncManager::StopSyncSynced(const std::string &bundleName,
40 const int32_t userId,
41 bool forceFlag,
42 SyncTriggerType triggerType)
43 {
44 return E_OK;
45 }
46
StopUploadTask(const std::string & bundleName,const int32_t userId)47 int32_t DataSyncManager::StopUploadTask(const std::string &bundleName, const int32_t userId)
48 {
49 return E_OK;
50 }
51
ChangeAppSwitch(const std::string & bundleName,const int32_t userId,bool status)52 int32_t DataSyncManager::ChangeAppSwitch(const std::string &bundleName, const int32_t userId, bool status)
53 {
54 return E_OK;
55 }
56
TriggerRecoverySync(SyncTriggerType triggerType)57 int32_t DataSyncManager::TriggerRecoverySync(SyncTriggerType triggerType)
58 {
59 return E_OK;
60 }
61
ResetCursor(const std::string & bundleName,const int32_t & userId)62 int32_t DataSyncManager::ResetCursor(const std::string &bundleName, const int32_t &userId)
63 {
64 return E_OK;
65 }
66
RegisterCloudSyncCallback(const std::string & bundleName,const std::string & callerBundleName,const int32_t userId,const sptr<CloudSync::ICloudSyncCallback> & callback)67 void DataSyncManager::RegisterCloudSyncCallback(const std::string &bundleName,
68 const std::string &callerBundleName,
69 const int32_t userId,
70 const sptr<CloudSync::ICloudSyncCallback> &callback)
71 {
72 return;
73 }
74
UnRegisterCloudSyncCallback(const std::string & bundleName,const std::string & callerBundleName)75 void DataSyncManager::UnRegisterCloudSyncCallback(const std::string &bundleName,
76 const std::string &callerBundleName)
77 {
78 return;
79 }
80
IsSkipSync(const std::string & bundleName,const int32_t userId,bool forceFlag)81 int32_t DataSyncManager::IsSkipSync(const std::string &bundleName, const int32_t userId, bool forceFlag)
82 {
83 return E_OK;
84 }
85
StartDownloadFile(const BundleNameUserInfo & bundleNameUserInfo,const std::vector<std::string> & pathVec,int64_t & downloadId,int32_t fieldkey,const sptr<CloudSync::ICloudDownloadCallback> & downloadCallback,int32_t timeout)86 int32_t DataSyncManager::StartDownloadFile(const BundleNameUserInfo &bundleNameUserInfo,
87 const std::vector<std::string> &pathVec,
88 int64_t &downloadId, int32_t fieldkey,
89 const sptr<CloudSync::ICloudDownloadCallback> &downloadCallback,
90 int32_t timeout)
91 {
92 return E_OK;
93 }
94
StopDownloadFile(const BundleNameUserInfo & bundleNameUserInfo,int64_t downloadId,bool needClean,int32_t timeout)95 int32_t DataSyncManager::StopDownloadFile(const BundleNameUserInfo &bundleNameUserInfo,
96 int64_t downloadId,
97 bool needClean,
98 int32_t timeout)
99 {
100 return E_OK;
101 }
102
CleanCloudFile(const int32_t userId,const std::string & bundleName,const int action)103 int32_t DataSyncManager::CleanCloudFile(const int32_t userId, const std::string &bundleName, const int action)
104 {
105 return E_OK;
106 }
107
CleanRemainFile(const std::string & bundleName,const int32_t userId)108 int32_t DataSyncManager::CleanRemainFile(const std::string &bundleName, const int32_t userId)
109 {
110 return E_OK;
111 }
112
OptimizeStorage(const std::string & bundleName,const int32_t userId,const int32_t agingDays)113 int32_t DataSyncManager::OptimizeStorage(const std::string &bundleName, const int32_t userId, const int32_t agingDays)
114 {
115 return E_OK;
116 }
117
StartOptimizeStorage(const BundleNameUserInfo & bundleNameUserInfo,const CloudSync::OptimizeSpaceOptions & optimizeOptions,const sptr<CloudSync::ICloudOptimizeCallback> & optimizeCallback)118 int32_t DataSyncManager::StartOptimizeStorage(const BundleNameUserInfo &bundleNameUserInfo,
119 const CloudSync::OptimizeSpaceOptions &optimizeOptions,
120 const sptr<CloudSync::ICloudOptimizeCallback> &optimizeCallback)
121 {
122 return E_OK;
123 }
124
StopOptimizeStorage(const BundleNameUserInfo & bundleNameUserInfo)125 int32_t DataSyncManager::StopOptimizeStorage(const BundleNameUserInfo &bundleNameUserInfo)
126 {
127 return E_OK;
128 }
129
OptimizeCache(const int32_t userId,const std::string & bundleName)130 int32_t DataSyncManager::OptimizeCache(const int32_t userId, const std::string &bundleName)
131 {
132 return E_OK;
133 }
134
DownloadThumb()135 int32_t DataSyncManager::DownloadThumb()
136 {
137 return E_OK;
138 }
139
TriggerDownloadThumb()140 int32_t DataSyncManager::TriggerDownloadThumb()
141 {
142 return E_OK;
143 }
144
CacheVideo()145 int32_t DataSyncManager::CacheVideo()
146 {
147 return E_OK;
148 }
149
CleanVideoCache()150 int32_t DataSyncManager::CleanVideoCache()
151 {
152 return E_OK;
153 }
154
CleanCache(const std::string & bundleName,const int32_t userId,const std::string & uri)155 int32_t DataSyncManager::CleanCache(const std::string &bundleName, const int32_t userId, const std::string &uri)
156 {
157 return E_OK;
158 }
159
BatchDentryFileInsert(const std::vector<CloudSync::DentryFileInfo> & fileInfo,std::vector<std::string> & failCloudId)160 int32_t DataSyncManager::BatchDentryFileInsert(const std::vector<CloudSync::DentryFileInfo> &fileInfo,
161 std::vector<std::string> &failCloudId)
162 {
163 return E_OK;
164 }
165
DisableCloud(const int32_t userId)166 int32_t DataSyncManager::DisableCloud(const int32_t userId)
167 {
168 return E_OK;
169 }
170
GetUserId(int32_t & userId)171 int32_t DataSyncManager::GetUserId(int32_t &userId)
172 {
173 return E_OK;
174 }
175
SaveSubscription(const std::string & bundleName,const int32_t userId)176 int32_t DataSyncManager::SaveSubscription(const std::string &bundleName, const int32_t userId)
177 {
178 return E_OK;
179 }
180
ReportEntry(const std::string & bundleName,const int32_t userId)181 int32_t DataSyncManager::ReportEntry(const std::string &bundleName, const int32_t userId)
182 {
183 return E_OK;
184 }
185
BatchCleanFile(const std::vector<CloudSync::CleanFileInfo> & fileInfo,std::vector<std::string> & failCloudId)186 int32_t DataSyncManager::BatchCleanFile(const std::vector<CloudSync::CleanFileInfo> &fileInfo,
187 std::vector<std::string> &failCloudId)
188 {
189 return E_OK;
190 }
191
StartDowngrade(const std::string & bundleName,const sptr<CloudSync::IDowngradeDlCallback> & downloadCallback)192 int32_t DataSyncManager::StartDowngrade(const std::string &bundleName,
193 const sptr<CloudSync::IDowngradeDlCallback> &downloadCallback)
194 {
195 return E_OK;
196 }
197
StopDowngrade(const std::string & bundleName)198 int32_t DataSyncManager::StopDowngrade(const std::string &bundleName)
199 {
200 return E_OK;
201 }
202
GetCloudFileInfo(const std::string & bundleName,CloudSync::CloudFileInfo & cloudFileInfo)203 int32_t DataSyncManager::GetCloudFileInfo(const std::string &bundleName, CloudSync::CloudFileInfo &cloudFileInfo)
204 {
205 return E_OK;
206 }
207
GetHistoryVersionList(const BundleNameUserInfo & bundleNameUserInfo,const std::string & uri,const int32_t versionNumLimit,std::vector<CloudSync::HistoryVersion> & historyVersionList)208 int32_t DataSyncManager::GetHistoryVersionList(const BundleNameUserInfo &bundleNameUserInfo, const std::string &uri,
209 const int32_t versionNumLimit, std::vector<CloudSync::HistoryVersion> &historyVersionList)
210 {
211 return E_OK;
212 }
213
DownloadHistoryVersion(const BundleNameUserInfo & bundleNameUserInfo,const std::string & uri,int64_t & downloadId,uint64_t versionId,const sptr<CloudSync::ICloudDownloadCallback> & downloadCallback,std::string & versionUri)214 int32_t DataSyncManager::DownloadHistoryVersion(const BundleNameUserInfo &bundleNameUserInfo, const std::string &uri,
215 int64_t &downloadId, uint64_t versionId, const sptr<CloudSync::ICloudDownloadCallback> &downloadCallback,
216 std::string &versionUri)
217 {
218 return E_OK;
219 }
220
ReplaceFileWithHistoryVersion(const BundleNameUserInfo & bundleNameUserInfo,const std::string & uri,const std::string & versionUri)221 int32_t DataSyncManager::ReplaceFileWithHistoryVersion(const BundleNameUserInfo &bundleNameUserInfo,
222 const std::string &uri, const std::string &versionUri)
223 {
224 return E_OK;
225 }
226
IsFileConflict(const BundleNameUserInfo & bundleNameUserInfo,const std::string & uri,bool & isConflict)227 int32_t DataSyncManager::IsFileConflict(const BundleNameUserInfo &bundleNameUserInfo,
228 const std::string &uri, bool &isConflict)
229 {
230 return E_OK;
231 }
232
ClearFileConflict(const BundleNameUserInfo & bundleNameUserInfo,const std::string & uri)233 int32_t DataSyncManager::ClearFileConflict(const BundleNameUserInfo &bundleNameUserInfo, const std::string &uri)
234 {
235 return E_OK;
236 }
237
238 } // namespace OHOS::FileManagement::CloudFile