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_daemon_proxy_mock.h"
17 #include "storage_service_errno.h"
18
19 namespace OHOS {
20 namespace StorageDaemon {
StorageDaemonProxy(const sptr<IRemoteObject> & impl)21 StorageDaemonProxy::StorageDaemonProxy(const sptr<IRemoteObject> &impl) : IRemoteProxy<IStorageDaemon>(impl)
22 {}
23
Shutdown()24 int32_t StorageDaemonProxy::Shutdown()
25 {
26 return E_OK;
27 }
28
Mount(const std::string & volId,uint32_t flags)29 int32_t StorageDaemonProxy::Mount(const std::string &volId, uint32_t flags)
30 {
31 return E_OK;
32 }
33
UMount(const std::string & volId)34 int32_t StorageDaemonProxy::UMount(const std::string &volId)
35 {
36 return E_OK;
37 }
38
Check(const std::string & volId)39 int32_t StorageDaemonProxy::Check(const std::string &volId)
40 {
41 return E_OK;
42 }
43
Format(const std::string & volId,const std::string & fsType)44 int32_t StorageDaemonProxy::Format(const std::string &volId, const std::string &fsType)
45 {
46 return E_OK;
47 }
48
GetFileEncryptStatus(uint32_t userId,bool & isEncrypted,bool needCheckDirMount)49 int32_t StorageDaemonProxy::GetFileEncryptStatus(uint32_t userId, bool &isEncrypted, bool needCheckDirMount)
50 {
51 return E_OK;
52 }
53
Partition(const std::string & diskId,int32_t type)54 int32_t StorageDaemonProxy::Partition(const std::string &diskId, int32_t type)
55 {
56 return E_OK;
57 }
58
SetVolumeDescription(const std::string & volId,const std::string & description)59 int32_t StorageDaemonProxy::SetVolumeDescription(const std::string &volId, const std::string &description)
60 {
61 return E_OK;
62 }
63
PrepareUserDirs(int32_t userId,uint32_t flags)64 int32_t StorageDaemonProxy::PrepareUserDirs(int32_t userId, uint32_t flags)
65 {
66 return E_OK;
67 }
68
DestroyUserDirs(int32_t userId,uint32_t flags)69 int32_t StorageDaemonProxy::DestroyUserDirs(int32_t userId, uint32_t flags)
70 {
71 return E_OK;
72 }
73
StartUser(int32_t userId)74 int32_t StorageDaemonProxy::StartUser(int32_t userId)
75 {
76 return E_OK;
77 }
78
StopUser(int32_t userId)79 int32_t StorageDaemonProxy::StopUser(int32_t userId)
80 {
81 return E_OK;
82 }
83
CompleteAddUser(int32_t userId)84 int32_t StorageDaemonProxy::CompleteAddUser(int32_t userId)
85 {
86 return E_OK;
87 }
88
InitGlobalKey(void)89 int32_t StorageDaemonProxy::InitGlobalKey(void)
90 {
91 return E_OK;
92 }
93
InitGlobalUserKeys(void)94 int32_t StorageDaemonProxy::InitGlobalUserKeys(void)
95 {
96 return E_OK;
97 }
98
GenerateUserKeys(uint32_t userId,uint32_t flags)99 int32_t StorageDaemonProxy::GenerateUserKeys(uint32_t userId, uint32_t flags)
100 {
101 return E_OK;
102 }
103
DeleteUserKeys(uint32_t userId)104 int32_t StorageDaemonProxy::DeleteUserKeys(uint32_t userId)
105 {
106 return E_OK;
107 }
108
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)109 int32_t StorageDaemonProxy::UpdateUserAuth(uint32_t userId, uint64_t secureUid,
110 const std::vector<uint8_t> &token,
111 const std::vector<uint8_t> &oldSecret,
112 const std::vector<uint8_t> &newSecret)
113 {
114 return E_OK;
115 }
116
ActiveUserKey(uint32_t userId,const std::vector<uint8_t> & token,const std::vector<uint8_t> & secret)117 int32_t StorageDaemonProxy::ActiveUserKey(uint32_t userId,
118 const std::vector<uint8_t> &token,
119 const std::vector<uint8_t> &secret)
120 {
121 return E_OK;
122 }
123
InactiveUserKey(uint32_t userId)124 int32_t StorageDaemonProxy::InactiveUserKey(uint32_t userId)
125 {
126 return E_OK;
127 }
128
LockUserScreen(uint32_t userId)129 int32_t StorageDaemonProxy::LockUserScreen(uint32_t userId)
130 {
131 return E_OK;
132 }
133
UnlockUserScreen(uint32_t userId,const std::vector<uint8_t> & token,const std::vector<uint8_t> & secret)134 int32_t StorageDaemonProxy::UnlockUserScreen(uint32_t userId,
135 const std::vector<uint8_t> &token,
136 const std::vector<uint8_t> &secret)
137 {
138 return E_OK;
139 }
140
GetLockScreenStatus(uint32_t userId,bool & lockScreenStatus)141 int32_t StorageDaemonProxy::GetLockScreenStatus(uint32_t userId, bool &lockScreenStatus)
142 {
143 return E_OK;
144 }
145
GenerateAppkey(uint32_t userId,uint32_t hashId,std::string & keyId)146 int32_t StorageDaemonProxy::GenerateAppkey(uint32_t userId, uint32_t hashId, std::string &keyId)
147 {
148 return E_OK;
149 }
150
DeleteAppkey(uint32_t userId,const std::string & keyId)151 int32_t StorageDaemonProxy::DeleteAppkey(uint32_t userId, const std::string &keyId)
152 {
153 return E_OK;
154 }
155
UpdateKeyContext(uint32_t userId)156 int32_t StorageDaemonProxy::UpdateKeyContext(uint32_t userId)
157 {
158 return E_OK;
159 }
160
MountCryptoPathAgain(uint32_t userId)161 int32_t StorageDaemonProxy::MountCryptoPathAgain(uint32_t userId)
162 {
163 return E_OK;
164 }
165
CreateShareFile(const std::vector<std::string> & uriList,uint32_t tokenId,uint32_t flag)166 std::vector<int32_t> StorageDaemonProxy::CreateShareFile(const std::vector<std::string> &uriList,
167 uint32_t tokenId, uint32_t flag)
168 {
169 return {E_OK};
170 }
171
DeleteShareFile(uint32_t tokenId,const std::vector<std::string> & uriList)172 int32_t StorageDaemonProxy::DeleteShareFile(uint32_t tokenId, const std::vector<std::string> &uriList)
173 {
174 return E_OK;
175 }
176
SetBundleQuota(const std::string & bundleName,int32_t uid,const std::string & bundleDataDirPath,int32_t limitSizeMb)177 int32_t StorageDaemonProxy::SetBundleQuota(const std::string &bundleName, int32_t uid,
178 const std::string &bundleDataDirPath, int32_t limitSizeMb)
179 {
180 return E_OK;
181 }
182
GetOccupiedSpace(int32_t idType,int32_t id,int64_t & size)183 int32_t StorageDaemonProxy::GetOccupiedSpace(int32_t idType, int32_t id, int64_t &size)
184 {
185 return E_OK;
186 }
187
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)188 int32_t StorageDaemonProxy::GetBundleStatsForIncrease(uint32_t userId, const std::vector<std::string> &bundleNames,
189 const std::vector<int64_t> &incrementalBackTimes, std::vector<int64_t> &pkgFileSizes,
190 std::vector<int64_t> &incPkgFileSizes)
191 {
192 return E_OK;
193 }
194
MountDfsDocs(int32_t userId,const std::string & relativePath,const std::string & networkId,const std::string & deviceId)195 int32_t StorageDaemonProxy::MountDfsDocs(int32_t userId, const std::string &relativePath,
196 const std::string &networkId, const std::string &deviceId)
197 {
198 return E_OK;
199 }
200
UMountDfsDocs(int32_t userId,const std::string & relativePath,const std::string & networkId,const std::string & deviceId)201 int32_t StorageDaemonProxy::UMountDfsDocs(int32_t userId, const std::string &relativePath,
202 const std::string &networkId, const std::string &deviceId)
203 {
204 return E_OK;
205 }
206
UpdateMemoryPara(int32_t size,int32_t & oldSize)207 int32_t StorageDaemonProxy::UpdateMemoryPara(int32_t size, int32_t &oldSize)
208 {
209 return E_OK;
210 }
211
SendRequest(uint32_t code,MessageParcel & data,MessageParcel & reply,MessageOption & option)212 int32_t StorageDaemonProxy::SendRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option)
213 {
214 return E_OK;
215 }
216 } // StorageDaemon
217 } // OHOS
218