• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024 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 
StopUploadTask(const std::string & bundleName,const int32_t userId)39 int32_t DataSyncManager::StopUploadTask(const std::string &bundleName, const int32_t userId)
40 {
41     return E_OK;
42 }
43 
ChangeAppSwitch(const std::string & bundleName,const int32_t userId,bool status)44 int32_t DataSyncManager::ChangeAppSwitch(const std::string &bundleName, const int32_t userId, bool status)
45 {
46     return E_OK;
47 }
48 
TriggerRecoverySync(SyncTriggerType triggerType)49 int32_t DataSyncManager::TriggerRecoverySync(SyncTriggerType triggerType)
50 {
51     return E_OK;
52 }
53 
ResetCursor(const std::string & bundleName,const int32_t & userId)54 int32_t DataSyncManager::ResetCursor(const std::string &bundleName, const int32_t &userId)
55 {
56     return E_OK;
57 }
58 
RegisterCloudSyncCallback(const std::string & bundleName,const std::string & callerBundleName,const int32_t userId,const sptr<CloudSync::ICloudSyncCallback> & callback)59 void DataSyncManager::RegisterCloudSyncCallback(const std::string &bundleName,
60                                                 const std::string &callerBundleName,
61                                                 const int32_t userId,
62                                                 const sptr<CloudSync::ICloudSyncCallback> &callback)
63 {
64     return;
65 }
66 
UnRegisterCloudSyncCallback(const std::string & bundleName,const std::string & callerBundleName)67 void DataSyncManager::UnRegisterCloudSyncCallback(const std::string &bundleName,
68                                                   const std::string &callerBundleName)
69 {
70     return;
71 }
72 
IsSkipSync(const std::string & bundleName,const int32_t userId,bool forceFlag)73 int32_t DataSyncManager::IsSkipSync(const std::string &bundleName, const int32_t userId, bool forceFlag)
74 {
75     return E_OK;
76 }
77 
StartDownloadFile(const BundleNameUserInfo & bundleNameUserInfo,const std::vector<std::string> & pathVec,int64_t & downloadId,std::bitset<FIELD_KEY_MAX_SIZE> fieldkey,const sptr<CloudSync::ICloudDownloadCallback> & downloadCallback,int32_t timeout)78 int32_t DataSyncManager::StartDownloadFile(const BundleNameUserInfo &bundleNameUserInfo,
79                                            const std::vector<std::string> &pathVec,
80                                            int64_t &downloadId, std::bitset<FIELD_KEY_MAX_SIZE> fieldkey,
81                                            const sptr<CloudSync::ICloudDownloadCallback> &downloadCallback,
82                                            int32_t timeout)
83 {
84     return E_OK;
85 }
86 
StopDownloadFile(const BundleNameUserInfo & bundleNameUserInfo,const std::string & path,bool needClean)87 int32_t DataSyncManager::StopDownloadFile(const BundleNameUserInfo &bundleNameUserInfo,
88                                           const std::string &path,
89                                           bool needClean)
90 {
91     return E_OK;
92 }
93 
StopFileCache(const BundleNameUserInfo & bundleNameUserInfo,int64_t downloadId,bool needClean,int32_t timeout)94 int32_t DataSyncManager::StopFileCache(const BundleNameUserInfo &bundleNameUserInfo,
95                                        int64_t downloadId,
96                                        bool needClean,
97                                        int32_t timeout)
98 {
99     return E_OK;
100 }
101 
RegisterDownloadFileCallback(const BundleNameUserInfo & bundleNameUserInfo,const sptr<CloudSync::ICloudDownloadCallback> & downloadCallback)102 int32_t DataSyncManager::RegisterDownloadFileCallback(const BundleNameUserInfo &bundleNameUserInfo,
103                                                       const sptr<CloudSync::ICloudDownloadCallback> &downloadCallback)
104 {
105     return E_OK;
106 }
107 
UnregisterDownloadFileCallback(const BundleNameUserInfo & bundleNameUserInfo)108 int32_t DataSyncManager::UnregisterDownloadFileCallback(const BundleNameUserInfo &bundleNameUserInfo)
109 {
110     return E_OK;
111 }
112 
CleanCloudFile(const int32_t userId,const std::string & bundleName,const int action)113 int32_t DataSyncManager::CleanCloudFile(const int32_t userId, const std::string &bundleName, const int action)
114 {
115     return E_OK;
116 }
117 
CleanRemainFile(const std::string & bundleName,const int32_t userId)118 int32_t DataSyncManager::CleanRemainFile(const std::string &bundleName, const int32_t userId)
119 {
120     return E_OK;
121 }
122 
OptimizeStorage(const std::string & bundleName,const int32_t userId,const int32_t agingDays)123 int32_t DataSyncManager::OptimizeStorage(const std::string &bundleName, const int32_t userId, const int32_t agingDays)
124 {
125     return E_OK;
126 }
127 
StartOptimizeStorage(const BundleNameUserInfo & bundleNameUserInfo,const CloudSync::OptimizeSpaceOptions & optimizeOptions,const sptr<CloudSync::ICloudOptimizeCallback> & optimizeCallback)128 int32_t DataSyncManager::StartOptimizeStorage(const BundleNameUserInfo &bundleNameUserInfo,
129     const CloudSync::OptimizeSpaceOptions &optimizeOptions,
130     const sptr<CloudSync::ICloudOptimizeCallback> &optimizeCallback)
131 {
132     return E_OK;
133 }
134 
StopOptimizeStorage(const BundleNameUserInfo & bundleNameUserInfo)135 int32_t DataSyncManager::StopOptimizeStorage(const BundleNameUserInfo &bundleNameUserInfo)
136 {
137     return E_OK;
138 }
139 
DownloadThumb()140 int32_t DataSyncManager::DownloadThumb()
141 {
142     return E_OK;
143 }
144 
TriggerDownloadThumb()145 int32_t DataSyncManager::TriggerDownloadThumb()
146 {
147     return E_OK;
148 }
149 
CacheVideo()150 int32_t DataSyncManager::CacheVideo()
151 {
152     return E_OK;
153 }
154 
CleanVideoCache()155 int32_t DataSyncManager::CleanVideoCache()
156 {
157     return E_OK;
158 }
159 
CleanCache(const std::string & bundleName,const int32_t userId,const std::string & uri)160 int32_t DataSyncManager::CleanCache(const std::string &bundleName, const int32_t userId, const std::string &uri)
161 {
162     return E_OK;
163 }
164 
BatchDentryFileInsert(const std::vector<CloudSync::DentryFileInfo> & fileInfo,std::vector<std::string> & failCloudId)165 int32_t DataSyncManager::BatchDentryFileInsert(const std::vector<CloudSync::DentryFileInfo> &fileInfo,
166     std::vector<std::string> &failCloudId)
167 {
168     return E_OK;
169 }
170 
DisableCloud(const int32_t userId)171 int32_t DataSyncManager::DisableCloud(const int32_t userId)
172 {
173     return E_OK;
174 }
175 
GetUserId(int32_t & userId)176 int32_t DataSyncManager::GetUserId(int32_t &userId)
177 {
178     return E_OK;
179 }
180 
SaveSubscription(const std::string & bundleName,const int32_t userId)181 int32_t DataSyncManager::SaveSubscription(const std::string &bundleName, const int32_t userId)
182 {
183     return E_OK;
184 }
185 
ReportEntry(const std::string & bundleName,const int32_t userId)186 int32_t DataSyncManager::ReportEntry(const std::string &bundleName, const int32_t userId)
187 {
188     return E_OK;
189 }
190 
BatchCleanFile(const std::vector<CloudSync::CleanFileInfo> & fileInfo,std::vector<std::string> & failCloudId)191 int32_t DataSyncManager::BatchCleanFile(const std::vector<CloudSync::CleanFileInfo> &fileInfo,
192     std::vector<std::string> &failCloudId)
193 {
194     return E_OK;
195 }
196 
197 } // namespace OHOS::FileManagement::CloudFile