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 
ActiveUserKey(uint32_t userId,const std::vector<uint8_t> & token,const std::vector<uint8_t> & secret)64 int32_t StorageManagerProxy::ActiveUserKey(uint32_t userId,
65                                            const std::vector<uint8_t> &token,
66                                            const std::vector<uint8_t> &secret)
67 {
68     return E_OK;
69 }
70 
InactiveUserKey(uint32_t userId)71 int32_t StorageManagerProxy::InactiveUserKey(uint32_t userId)
72 {
73     return E_OK;
74 }
75 
LockUserScreen(uint32_t userId)76 int32_t StorageManagerProxy::LockUserScreen(uint32_t userId)
77 {
78     return E_OK;
79 }
80 
UnlockUserScreen(uint32_t userId,const std::vector<uint8_t> & token,const std::vector<uint8_t> & secret)81 int32_t StorageManagerProxy::UnlockUserScreen(uint32_t userId,
82                                               const std::vector<uint8_t> &token,
83                                               const std::vector<uint8_t> &secret)
84 {
85     return E_OK;
86 }
87 
GetLockScreenStatus(uint32_t userId,bool & lockScreenStatus)88 int32_t StorageManagerProxy::GetLockScreenStatus(uint32_t userId, bool &lockScreenStatus)
89 {
90     return E_OK;
91 }
92 
UpdateKeyContext(uint32_t userId)93 int32_t StorageManagerProxy::UpdateKeyContext(uint32_t userId)
94 {
95     return E_OK;
96 }
97 
GenerateAppkey(uint32_t hashId,uint32_t userId,std::string & keyId)98 int32_t StorageManagerProxy::GenerateAppkey(uint32_t hashId, uint32_t userId, std::string &keyId)
99 {
100     return E_OK;
101 }
102 
DeleteAppkey(const std::string keyId)103 int32_t StorageManagerProxy::DeleteAppkey(const std::string keyId)
104 {
105     return E_OK;
106 }
107 
GetFreeSizeOfVolume(std::string volumeUuid,int64_t & freeSize)108 int32_t StorageManagerProxy::GetFreeSizeOfVolume(std::string volumeUuid, int64_t &freeSize)
109 {
110     return E_OK;
111 }
112 
GetTotalSizeOfVolume(std::string volumeUuid,int64_t & totalSize)113 int32_t StorageManagerProxy::GetTotalSizeOfVolume(std::string volumeUuid, int64_t &totalSize)
114 {
115     return E_OK;
116 }
117 
118 
GetFileEncryptStatus(uint32_t userId,bool & isEncrypted,bool needCheckDirMount)119 int32_t StorageManagerProxy::GetFileEncryptStatus(uint32_t userId, bool &isEncrypted, bool needCheckDirMount)
120 {
121     return E_OK;
122 }
123 
GetBundleStats(std::string pkgName,BundleStats & bundleStats,int32_t appIndex,uint32_t statFlag)124 int32_t StorageManagerProxy::GetBundleStats(std::string pkgName, BundleStats &bundleStats,
125     int32_t appIndex, uint32_t statFlag)
126 {
127     return E_OK;
128 }
129 
NotifyVolumeCreated(VolumeCore vc)130 int32_t StorageManagerProxy::NotifyVolumeCreated(VolumeCore vc)
131 {
132     return E_OK;
133 }
134 
NotifyVolumeMounted(std::string volumeId,int32_t fsType,std::string fsUuid,std::string path,std::string description)135 int32_t StorageManagerProxy::NotifyVolumeMounted(std::string volumeId, int32_t fsType, std::string fsUuid,
136     std::string path, std::string description)
137 {
138     return E_OK;
139 }
140 
NotifyVolumeStateChanged(std::string volumeId,VolumeState state)141 int32_t StorageManagerProxy::NotifyVolumeStateChanged(std::string volumeId, VolumeState state)
142 {
143     return E_OK;
144 }
145 
Mount(std::string volumeId)146 int32_t StorageManagerProxy::Mount(std::string volumeId)
147 {
148     return E_OK;
149 }
150 
Unmount(std::string volumeId)151 int32_t StorageManagerProxy::Unmount(std::string volumeId)
152 {
153     return E_OK;
154 }
155 
GetAllVolumes(std::vector<VolumeExternal> & vecOfVol)156 int32_t StorageManagerProxy::GetAllVolumes(std::vector<VolumeExternal> &vecOfVol)
157 {
158     return E_OK;
159 }
160 
NotifyDiskCreated(Disk disk)161 int32_t StorageManagerProxy::NotifyDiskCreated(Disk disk)
162 {
163     return E_OK;
164 }
165 
NotifyDiskDestroyed(std::string diskId)166 int32_t StorageManagerProxy::NotifyDiskDestroyed(std::string diskId)
167 {
168     return E_OK;
169 }
170 
Partition(std::string diskId,int32_t type)171 int32_t StorageManagerProxy::Partition(std::string diskId, int32_t type)
172 {
173     return E_OK;
174 }
175 
GetAllDisks(std::vector<Disk> & vecOfDisk)176 int32_t StorageManagerProxy::GetAllDisks(std::vector<Disk> &vecOfDisk)
177 {
178     return E_OK;
179 }
180 
GetSystemSize(int64_t & systemSize)181 int32_t StorageManagerProxy::GetSystemSize(int64_t &systemSize)
182 {
183     return E_OK;
184 }
185 
GetTotalSize(int64_t & totalSize)186 int32_t StorageManagerProxy::GetTotalSize(int64_t &totalSize)
187 {
188     return E_OK;
189 }
190 
GetFreeSize(int64_t & freeSize)191 int32_t StorageManagerProxy::GetFreeSize(int64_t &freeSize)
192 {
193     return E_OK;
194 }
195 
GetUserStorageStats(StorageStats & storageStats)196 int32_t StorageManagerProxy::GetUserStorageStats(StorageStats &storageStats)
197 {
198     return E_OK;
199 }
200 
GetUserStorageStats(int32_t userId,StorageStats & storageStats)201 int32_t StorageManagerProxy::GetUserStorageStats(int32_t userId, StorageStats &storageStats)
202 {
203     return E_OK;
204 }
205 
GetCurrentBundleStats(BundleStats & bundleStats,uint32_t statFlag)206 int32_t StorageManagerProxy::GetCurrentBundleStats(BundleStats &bundleStats, uint32_t statFlag)
207 {
208     return E_OK;
209 }
210 
GetVolumeByUuid(std::string fsUuid,VolumeExternal & vc)211 int32_t StorageManagerProxy::GetVolumeByUuid(std::string fsUuid, VolumeExternal &vc)
212 {
213     return E_OK;
214 }
215 
GetVolumeById(std::string volumeId,VolumeExternal & vc)216 int32_t StorageManagerProxy::GetVolumeById(std::string volumeId, VolumeExternal &vc)
217 {
218     return E_OK;
219 }
220 
SetVolumeDescription(std::string fsUuid,std::string description)221 int32_t StorageManagerProxy::SetVolumeDescription(std::string fsUuid, std::string description)
222 {
223     return E_OK;
224 }
225 
Format(std::string volumeId,std::string fsType)226 int32_t StorageManagerProxy::Format(std::string volumeId, std::string fsType)
227 {
228     return E_OK;
229 }
230 
GetDiskById(std::string diskId,Disk & disk)231 int32_t StorageManagerProxy::GetDiskById(std::string diskId, Disk &disk)
232 {
233     return E_OK;
234 }
235 
CreateShareFile(const std::vector<std::string> & uriList,uint32_t tokenId,uint32_t flag)236 std::vector<int32_t> StorageManagerProxy::CreateShareFile(const std::vector<std::string> &uriList,
237                                                           uint32_t tokenId, uint32_t flag)
238 {
239     return {E_OK};
240 }
241 
DeleteShareFile(uint32_t tokenId,const std::vector<std::string> & uriList)242 int32_t StorageManagerProxy::DeleteShareFile(uint32_t tokenId, const std::vector<std::string> &uriList)
243 {
244     return E_OK;
245 }
SetBundleQuota(const std::string & bundleName,int32_t uid,const std::string & bundleDataDirPath,int32_t limitSizeMb)246 int32_t StorageManagerProxy::SetBundleQuota(const std::string &bundleName, int32_t uid,
247     const std::string &bundleDataDirPath, int32_t limitSizeMb)
248 {
249     return E_OK;
250 }
251 
252 
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)253 int32_t StorageManagerProxy::GetBundleStatsForIncrease(uint32_t userId, const std::vector<std::string> &bundleNames,
254     const std::vector<int64_t> &incrementalBackTimes, std::vector<int64_t> &pkgFileSizes,
255     std::vector<int64_t> &incPkgFileSizes)
256 {
257     return E_OK;
258 }
259 
UpdateMemoryPara(int32_t size,int32_t & oldSize)260 int32_t StorageManagerProxy::UpdateMemoryPara(int32_t size, int32_t &oldSize)
261 {
262     return E_OK;
263 }
264 
SendRequest(uint32_t code,MessageParcel & data,MessageParcel & reply,MessageOption & option)265 int32_t StorageManagerProxy::SendRequest(uint32_t code, MessageParcel &data, MessageParcel &reply,
266     MessageOption &option)
267 {
268     return E_OK;
269 }
270 
GetUserStorageStatsByType(int32_t userId,StorageStats & storageStats,std::string type)271 int32_t StorageManagerProxy::GetUserStorageStatsByType(int32_t userId, StorageStats &storageStats, std::string type)
272 {
273     return E_OK;
274 }
275 
MountDfsDocs(int32_t userId,const std::string & relativePath,const std::string & networkId,const std::string & deviceId)276 int32_t StorageManagerProxy::MountDfsDocs(int32_t userId, const std::string &relativePath,
277     const std::string &networkId, const std::string &deviceId)
278 {
279     return E_OK;
280 }
281 
UMountDfsDocs(int32_t userId,const std::string & relativePath,const std::string & networkId,const std::string & deviceId)282 int32_t StorageManagerProxy::UMountDfsDocs(int32_t userId, const std::string &relativePath,
283     const std::string &networkId, const std::string &deviceId)
284 {
285     return E_OK;
286 }
287 } // StorageManager
288 } // OHOS
289