• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-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 "mock/storage_manager_proxy_mock.h"
17 #include "storage_service_errno.h"
18 
19 namespace OHOS {
20 namespace StorageManager {
PrepareAddUser(int32_t userId,uint32_t flags)21 int32_t StorageManagerProxy::PrepareAddUser(int32_t userId, uint32_t flags)
22 {
23     return E_OK;
24 }
25 
RemoveUser(int32_t userId,uint32_t flags)26 int32_t StorageManagerProxy::RemoveUser(int32_t userId, uint32_t flags)
27 {
28     return E_OK;
29 }
30 
PrepareStartUser(int32_t userId)31 int32_t StorageManagerProxy::PrepareStartUser(int32_t userId)
32 {
33     return E_OK;
34 }
35 
StopUser(int32_t userId)36 int32_t StorageManagerProxy::StopUser(int32_t userId)
37 {
38     return E_OK;
39 }
40 
CompleteAddUser(int32_t userId)41 int32_t StorageManagerProxy::CompleteAddUser(int32_t userId)
42 {
43     return E_OK;
44 }
45 
GenerateUserKeys(uint32_t userId,uint32_t flags)46 int32_t StorageManagerProxy::GenerateUserKeys(uint32_t userId, uint32_t flags)
47 {
48     return E_OK;
49 }
50 
DeleteUserKeys(uint32_t userId)51 int32_t StorageManagerProxy::DeleteUserKeys(uint32_t userId)
52 {
53     return E_OK;
54 }
55 
UpdateUserAuth(uint32_t userId,uint64_t secureUid,const std::vector<uint8_t> & token,const std::vector<uint8_t> & oldSecret,const std::vector<uint8_t> & newSecret)56 int32_t StorageManagerProxy::UpdateUserAuth(uint32_t userId, uint64_t secureUid,
57                                             const std::vector<uint8_t> &token,
58                                             const std::vector<uint8_t> &oldSecret,
59                                             const std::vector<uint8_t> &newSecret)
60 {
61     return E_OK;
62 }
63 
UpdateUseAuthWithRecoveryKey(const std::vector<uint8_t> & authToken,const std::vector<uint8_t> & newSecret,uint64_t secureUid,uint32_t userId,std::vector<std::vector<uint8_t>> & plainText)64 int32_t StorageManagerProxy::UpdateUseAuthWithRecoveryKey(const std::vector<uint8_t> &authToken,
65                                                           const std::vector<uint8_t> &newSecret,
66                                                           uint64_t secureUid,
67                                                           uint32_t userId,
68                                                           std::vector<std::vector<uint8_t>> &plainText)
69 {
70     return E_OK;
71 }
72 
ActiveUserKey(uint32_t userId,const std::vector<uint8_t> & token,const std::vector<uint8_t> & secret)73 int32_t StorageManagerProxy::ActiveUserKey(uint32_t userId,
74                                            const std::vector<uint8_t> &token,
75                                            const std::vector<uint8_t> &secret)
76 {
77     return E_OK;
78 }
79 
InactiveUserKey(uint32_t userId)80 int32_t StorageManagerProxy::InactiveUserKey(uint32_t userId)
81 {
82     return E_OK;
83 }
84 
LockUserScreen(uint32_t userId)85 int32_t StorageManagerProxy::LockUserScreen(uint32_t userId)
86 {
87     return E_OK;
88 }
89 
UnlockUserScreen(uint32_t userId,const std::vector<uint8_t> & token,const std::vector<uint8_t> & secret)90 int32_t StorageManagerProxy::UnlockUserScreen(uint32_t userId,
91                                               const std::vector<uint8_t> &token,
92                                               const std::vector<uint8_t> &secret)
93 {
94     return E_OK;
95 }
96 
GetLockScreenStatus(uint32_t userId,bool & lockScreenStatus)97 int32_t StorageManagerProxy::GetLockScreenStatus(uint32_t userId, bool &lockScreenStatus)
98 {
99     return E_OK;
100 }
101 
UpdateKeyContext(uint32_t userId,bool needRemoveTmpKey)102 int32_t StorageManagerProxy::UpdateKeyContext(uint32_t userId, bool needRemoveTmpKey)
103 {
104     return E_OK;
105 }
106 
GenerateAppkey(uint32_t hashId,uint32_t userId,std::string & keyId)107 int32_t StorageManagerProxy::GenerateAppkey(uint32_t hashId, uint32_t userId, std::string &keyId)
108 {
109     return E_OK;
110 }
111 
DeleteAppkey(const std::string keyId)112 int32_t StorageManagerProxy::DeleteAppkey(const std::string keyId)
113 {
114     return E_OK;
115 }
116 
CreateRecoverKey(uint32_t userId,uint32_t userType,const std::vector<uint8_t> & token,const std::vector<uint8_t> & secret)117 int32_t StorageManagerProxy::CreateRecoverKey(uint32_t userId,
118                                               uint32_t userType,
119                                               const std::vector<uint8_t> &token,
120                                               const std::vector<uint8_t> &secret)
121 {
122     return E_OK;
123 }
124 
SetRecoverKey(const std::vector<uint8_t> & key)125 int32_t StorageManagerProxy::SetRecoverKey(const std::vector<uint8_t> &key)
126 {
127     return E_OK;
128 }
129 
GetFreeSizeOfVolume(std::string volumeUuid,int64_t & freeSize)130 int32_t StorageManagerProxy::GetFreeSizeOfVolume(std::string volumeUuid, int64_t &freeSize)
131 {
132     return E_OK;
133 }
134 
GetTotalSizeOfVolume(std::string volumeUuid,int64_t & totalSize)135 int32_t StorageManagerProxy::GetTotalSizeOfVolume(std::string volumeUuid, int64_t &totalSize)
136 {
137     return E_OK;
138 }
139 
GetBundleStats(std::string pkgName,BundleStats & bundleStats,int32_t appIndex,uint32_t statFlag)140 int32_t StorageManagerProxy::GetBundleStats(std::string pkgName, BundleStats &bundleStats,
141     int32_t appIndex, uint32_t statFlag)
142 {
143     return E_OK;
144 }
145 
NotifyVolumeCreated(VolumeCore vc)146 int32_t StorageManagerProxy::NotifyVolumeCreated(VolumeCore vc)
147 {
148     return E_OK;
149 }
150 
NotifyVolumeMounted(std::string volumeId,int32_t fsType,std::string fsUuid,std::string path,std::string description)151 int32_t StorageManagerProxy::NotifyVolumeMounted(std::string volumeId, int32_t fsType, std::string fsUuid,
152     std::string path, std::string description)
153 {
154     return E_OK;
155 }
156 
NotifyVolumeStateChanged(std::string volumeId,VolumeState state)157 int32_t StorageManagerProxy::NotifyVolumeStateChanged(std::string volumeId, VolumeState state)
158 {
159     return E_OK;
160 }
161 
Mount(std::string volumeId)162 int32_t StorageManagerProxy::Mount(std::string volumeId)
163 {
164     return E_OK;
165 }
166 
Unmount(std::string volumeId)167 int32_t StorageManagerProxy::Unmount(std::string volumeId)
168 {
169     return E_OK;
170 }
171 
GetAllVolumes(std::vector<VolumeExternal> & vecOfVol)172 int32_t StorageManagerProxy::GetAllVolumes(std::vector<VolumeExternal> &vecOfVol)
173 {
174     return E_OK;
175 }
176 
NotifyDiskCreated(Disk disk)177 int32_t StorageManagerProxy::NotifyDiskCreated(Disk disk)
178 {
179     return E_OK;
180 }
181 
NotifyDiskDestroyed(std::string diskId)182 int32_t StorageManagerProxy::NotifyDiskDestroyed(std::string diskId)
183 {
184     return E_OK;
185 }
186 
Partition(std::string diskId,int32_t type)187 int32_t StorageManagerProxy::Partition(std::string diskId, int32_t type)
188 {
189     return E_OK;
190 }
191 
GetAllDisks(std::vector<Disk> & vecOfDisk)192 int32_t StorageManagerProxy::GetAllDisks(std::vector<Disk> &vecOfDisk)
193 {
194     return E_OK;
195 }
196 
GetSystemSize(int64_t & systemSize)197 int32_t StorageManagerProxy::GetSystemSize(int64_t &systemSize)
198 {
199     return E_OK;
200 }
201 
GetTotalSize(int64_t & totalSize)202 int32_t StorageManagerProxy::GetTotalSize(int64_t &totalSize)
203 {
204     return E_OK;
205 }
206 
GetFreeSize(int64_t & freeSize)207 int32_t StorageManagerProxy::GetFreeSize(int64_t &freeSize)
208 {
209     return E_OK;
210 }
211 
GetUserStorageStats(StorageStats & storageStats)212 int32_t StorageManagerProxy::GetUserStorageStats(StorageStats &storageStats)
213 {
214     return E_OK;
215 }
216 
GetUserStorageStats(int32_t userId,StorageStats & storageStats)217 int32_t StorageManagerProxy::GetUserStorageStats(int32_t userId, StorageStats &storageStats)
218 {
219     return E_OK;
220 }
221 
GetCurrentBundleStats(BundleStats & bundleStats,uint32_t statFlag)222 int32_t StorageManagerProxy::GetCurrentBundleStats(BundleStats &bundleStats, uint32_t statFlag)
223 {
224     return E_OK;
225 }
226 
GetVolumeByUuid(std::string fsUuid,VolumeExternal & vc)227 int32_t StorageManagerProxy::GetVolumeByUuid(std::string fsUuid, VolumeExternal &vc)
228 {
229     return E_OK;
230 }
231 
GetVolumeById(std::string volumeId,VolumeExternal & vc)232 int32_t StorageManagerProxy::GetVolumeById(std::string volumeId, VolumeExternal &vc)
233 {
234     return E_OK;
235 }
236 
SetVolumeDescription(std::string fsUuid,std::string description)237 int32_t StorageManagerProxy::SetVolumeDescription(std::string fsUuid, std::string description)
238 {
239     return E_OK;
240 }
241 
Format(std::string volumeId,std::string fsType)242 int32_t StorageManagerProxy::Format(std::string volumeId, std::string fsType)
243 {
244     return E_OK;
245 }
246 
GetDiskById(std::string diskId,Disk & disk)247 int32_t StorageManagerProxy::GetDiskById(std::string diskId, Disk &disk)
248 {
249     return E_OK;
250 }
251 
CreateShareFile(const std::vector<std::string> & uriList,uint32_t tokenId,uint32_t flag)252 std::vector<int32_t> StorageManagerProxy::CreateShareFile(const std::vector<std::string> &uriList,
253                                                           uint32_t tokenId, uint32_t flag)
254 {
255     return {E_OK};
256 }
257 
DeleteShareFile(uint32_t tokenId,const std::vector<std::string> & uriList)258 int32_t StorageManagerProxy::DeleteShareFile(uint32_t tokenId, const std::vector<std::string> &uriList)
259 {
260     return E_OK;
261 }
SetBundleQuota(const std::string & bundleName,int32_t uid,const std::string & bundleDataDirPath,int32_t limitSizeMb)262 int32_t StorageManagerProxy::SetBundleQuota(const std::string &bundleName, int32_t uid,
263     const std::string &bundleDataDirPath, int32_t limitSizeMb)
264 {
265     return E_OK;
266 }
267 
268 
GetBundleStatsForIncrease(uint32_t userId,const std::vector<std::string> & bundleNames,const std::vector<int64_t> & incrementalBackTimes,std::vector<int64_t> & pkgFileSizes,std::vector<int64_t> & incPkgFileSizes)269 int32_t StorageManagerProxy::GetBundleStatsForIncrease(uint32_t userId, const std::vector<std::string> &bundleNames,
270     const std::vector<int64_t> &incrementalBackTimes, std::vector<int64_t> &pkgFileSizes,
271     std::vector<int64_t> &incPkgFileSizes)
272 {
273     return E_OK;
274 }
275 
UpdateMemoryPara(int32_t size,int32_t & oldSize)276 int32_t StorageManagerProxy::UpdateMemoryPara(int32_t size, int32_t &oldSize)
277 {
278     return E_OK;
279 }
280 
SendRequest(uint32_t code,MessageParcel & data,MessageParcel & reply,MessageOption & option)281 int32_t StorageManagerProxy::SendRequest(uint32_t code, MessageParcel &data, MessageParcel &reply,
282     MessageOption &option)
283 {
284     return E_OK;
285 }
286 
GetUserStorageStatsByType(int32_t userId,StorageStats & storageStats,std::string type)287 int32_t StorageManagerProxy::GetUserStorageStatsByType(int32_t userId, StorageStats &storageStats, std::string type)
288 {
289     return E_OK;
290 }
291 
MountDfsDocs(int32_t userId,const std::string & relativePath,const std::string & networkId,const std::string & deviceId)292 int32_t StorageManagerProxy::MountDfsDocs(int32_t userId, const std::string &relativePath,
293     const std::string &networkId, const std::string &deviceId)
294 {
295     return E_OK;
296 }
297 
UMountDfsDocs(int32_t userId,const std::string & relativePath,const std::string & networkId,const std::string & deviceId)298 int32_t StorageManagerProxy::UMountDfsDocs(int32_t userId, const std::string &relativePath,
299     const std::string &networkId, const std::string &deviceId)
300 {
301     return E_OK;
302 }
303 
GetFileEncryptStatus(uint32_t userId,bool & isEncrypted,bool needCheckDirMount)304 int32_t StorageManagerProxy::GetFileEncryptStatus(uint32_t userId, bool &isEncrypted, bool needCheckDirMount)
305 {
306     return E_OK;
307 }
308 
NotifyMtpMounted(const std::string & id,const std::string & path,const std::string & desc,const std::string & uuid)309 int32_t StorageManagerProxy::NotifyMtpMounted(const std::string &id, const std::string &path, const std::string &desc,
310                                               const std::string &uuid)
311 {
312     return E_OK;
313 }
314 
NotifyMtpUnmounted(const std::string & id,const std::string & path,const bool isBadRemove)315 int32_t StorageManagerProxy::NotifyMtpUnmounted(const std::string &id, const std::string &path, const bool isBadRemove)
316 {
317     return E_OK;
318 }
319 
MountMediaFuse(int32_t userId,int32_t & devFd)320 int32_t StorageManagerProxy::MountMediaFuse(int32_t userId, int32_t &devFd)
321 {
322     return E_OK;
323 }
324 
UMountMediaFuse(int32_t userId)325 int32_t StorageManagerProxy::UMountMediaFuse(int32_t userId)
326 {
327     return E_OK;
328 }
329 
GetUserNeedActiveStatus(uint32_t userId,bool & needActive)330 int32_t StorageManagerProxy::GetUserNeedActiveStatus(uint32_t userId, bool &needActive)
331 {
332     return E_OK;
333 }
334 
MountFileMgrFuse(int32_t userId,const std::string & path,int32_t & fuseFd)335 int32_t StorageManagerProxy::MountFileMgrFuse(int32_t userId, const std::string &path, int32_t &fuseFd)
336 {
337     return E_OK;
338 }
339 
UMountFileMgrFuse(int32_t userId,const std::string & path)340 int32_t StorageManagerProxy::UMountFileMgrFuse(int32_t userId, const std::string &path)
341 {
342     return E_OK;
343 }
344 } // StorageManager
345 } // OHOS
346