• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023-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 "device_manager_service_impl_lite.h"
17 
18 #include <functional>
19 
20 #include "dm_anonymous.h"
21 #include "dm_error_type.h"
22 #include "dm_log.h"
23 #include "app_manager.h"
24 
25 namespace OHOS {
26 namespace DistributedHardware {
27 constexpr uint32_t DEVICE_BIUND_LEVEL = 1;
DeviceManagerServiceImpl()28 DeviceManagerServiceImpl::DeviceManagerServiceImpl()
29 {
30     LOGI("DeviceManagerServiceImpl constructor");
31 }
32 
~DeviceManagerServiceImpl()33 DeviceManagerServiceImpl::~DeviceManagerServiceImpl()
34 {
35     LOGI("DeviceManagerServiceImpl destructor");
36 }
37 
Initialize(const std::shared_ptr<IDeviceManagerServiceListener> & listener)38 int32_t DeviceManagerServiceImpl::Initialize(const std::shared_ptr<IDeviceManagerServiceListener> &listener)
39 {
40     LOGI("DeviceManagerServiceImpl Initialize");
41     if (softbusConnector_ == nullptr) {
42         softbusConnector_ = std::make_shared<SoftbusConnector>();
43     }
44     if (hiChainConnector_ == nullptr) {
45         hiChainConnector_ = std::make_shared<HiChainConnector>();
46     }
47     if (mineHiChainConnector_ == nullptr) {
48         mineHiChainConnector_ = std::make_shared<MineHiChainConnector>();
49     }
50     if (hiChainAuthConnector_ == nullptr) {
51         hiChainAuthConnector_ = std::make_shared<HiChainAuthConnector>();
52     }
53     if (deviceStateMgr_ == nullptr) {
54         deviceStateMgr_ = std::make_shared<DmDeviceStateManager>(softbusConnector_, listener,
55                                                                  hiChainConnector_, hiChainAuthConnector_);
56     }
57     if (credentialMgr_ == nullptr) {
58         credentialMgr_ = std::make_shared<DmCredentialManager>(hiChainConnector_, listener);
59     }
60 
61     LOGI("Init success, singleton initialized");
62     return DM_OK;
63 }
64 
Release()65 void DeviceManagerServiceImpl::Release()
66 {
67     LOGI("DeviceManagerServiceImpl Release");
68     deviceStateMgr_ = nullptr;
69     softbusConnector_ = nullptr;
70     hiChainConnector_ = nullptr;
71     mineHiChainConnector_ = nullptr;
72     return;
73 }
74 
UnAuthenticateDevice(const std::string & pkgName,const std::string & udid,int32_t bindLevel)75 int32_t DeviceManagerServiceImpl::UnAuthenticateDevice(const std::string &pkgName, const std::string &udid,
76     int32_t bindLevel)
77 {
78     (void)pkgName;
79     (void)udid;
80     (void)bindLevel;
81     return DM_OK;
82 }
83 
UnBindDevice(const std::string & pkgName,const std::string & udid,int32_t bindLevel)84 int32_t DeviceManagerServiceImpl::UnBindDevice(const std::string &pkgName, const std::string &udid,
85     int32_t bindLevel)
86 {
87     (void)pkgName;
88     (void)udid;
89     (void)bindLevel;
90     return DM_OK;
91 }
92 
UnBindDevice(const std::string & pkgName,const std::string & udid,int32_t bindLevel,const std::string & extra)93 int32_t DeviceManagerServiceImpl::UnBindDevice(const std::string &pkgName, const std::string &udid,
94     int32_t bindLevel, const std::string &extra)
95 {
96     (void)pkgName;
97     (void)udid;
98     (void)bindLevel;
99     (void)extra;
100     return DM_OK;
101 }
102 
SetUserOperation(std::string & pkgName,int32_t action,const std::string & params)103 int32_t DeviceManagerServiceImpl::SetUserOperation(std::string &pkgName, int32_t action,
104     const std::string &params)
105 {
106     (void)pkgName;
107     (void)action;
108     (void)params;
109     return DM_OK;
110 }
111 
HandleDeviceStatusChange(DmDeviceState devState,DmDeviceInfo & devInfo)112 void DeviceManagerServiceImpl::HandleDeviceStatusChange(DmDeviceState devState, DmDeviceInfo &devInfo)
113 {
114     if (deviceStateMgr_ == nullptr || softbusConnector_ == nullptr) {
115         LOGE("deviceStateMgr_ or softbusConnector_ is nullpter!");
116         return;
117     }
118     std::string deviceId = GetUdidHashByNetworkId(devInfo.networkId);
119     if (memcpy_s(devInfo.deviceId, DM_MAX_DEVICE_ID_LEN, deviceId.c_str(), deviceId.length()) != 0) {
120         LOGE("get deviceId: %{public}s failed", GetAnonyString(deviceId).c_str());
121         return;
122     }
123     std::vector<ProcessInfo> processInfoVec;
124     if (devState == DEVICE_INFO_CHANGED) {
125         processInfoVec = softbusConnector_->GetChangeProcessInfo();
126     } else {
127         processInfoVec = softbusConnector_->GetProcessInfo();
128     }
129     deviceStateMgr_->HandleDeviceStatusChange(devState, devInfo, processInfoVec);
130     return;
131 }
132 
GetUdidHashByNetworkId(const std::string & networkId)133 std::string DeviceManagerServiceImpl::GetUdidHashByNetworkId(const std::string &networkId)
134 {
135     if (softbusConnector_ == nullptr) {
136         LOGE("softbusConnector_ is nullpter!");
137         return "";
138     }
139     std::string udid = "";
140     int32_t ret = softbusConnector_->GetUdidByNetworkId(networkId.c_str(), udid);
141     if (ret != DM_OK) {
142         LOGE("GetUdidByNetworkId failed ret: %{public}d", ret);
143         return "";
144     }
145     return softbusConnector_->GetDeviceUdidHashByUdid(udid);
146 }
147 
OnSessionOpened(int sessionId,int result)148 int DeviceManagerServiceImpl::OnSessionOpened(int sessionId, int result)
149 {
150     (void)sessionId;
151     (void)result;
152     return DM_OK;
153 }
154 
OnSessionClosed(int sessionId)155 void DeviceManagerServiceImpl::OnSessionClosed(int sessionId)
156 {
157     (void)sessionId;
158     return;
159 }
160 
OnBytesReceived(int sessionId,const void * data,unsigned int dataLen)161 void DeviceManagerServiceImpl::OnBytesReceived(int sessionId, const void *data, unsigned int dataLen)
162 {
163     (void)sessionId;
164     (void)data;
165     (void)dataLen;
166     return;
167 }
168 
OnPinHolderSessionOpened(int sessionId,int result)169 int DeviceManagerServiceImpl::OnPinHolderSessionOpened(int sessionId, int result)
170 {
171     (void)sessionId;
172     (void)result;
173     return DM_OK;
174 }
175 
OnPinHolderSessionClosed(int sessionId)176 void DeviceManagerServiceImpl::OnPinHolderSessionClosed(int sessionId)
177 {
178     (void)sessionId;
179     return;
180 }
181 
OnPinHolderBytesReceived(int sessionId,const void * data,unsigned int dataLen)182 void DeviceManagerServiceImpl::OnPinHolderBytesReceived(int sessionId, const void *data, unsigned int dataLen)
183 {
184     (void)sessionId;
185     (void)data;
186     (void)dataLen;
187     return;
188 }
189 
RequestCredential(const std::string & reqJsonStr,std::string & returnJsonStr)190 int32_t DeviceManagerServiceImpl::RequestCredential(const std::string &reqJsonStr, std::string &returnJsonStr)
191 {
192     if (reqJsonStr.empty()) {
193         LOGE("reqJsonStr is empty");
194         return ERR_DM_INPUT_PARA_INVALID;
195     }
196     if (credentialMgr_== nullptr) {
197         LOGE("credentialMgr_ is nullptr");
198         return ERR_DM_POINT_NULL;
199     }
200     return credentialMgr_->RequestCredential(reqJsonStr, returnJsonStr);
201 }
202 
ImportCredential(const std::string & pkgName,const std::string & credentialInfo)203 int32_t DeviceManagerServiceImpl::ImportCredential(const std::string &pkgName, const std::string &credentialInfo)
204 {
205     if (pkgName.empty() || credentialInfo.empty()) {
206         LOGE("DeviceManagerServiceImpl::ImportCredential failed, pkgName is %{public}s, credentialInfo is %{public}s",
207             pkgName.c_str(), GetAnonyString(credentialInfo).c_str());
208         return ERR_DM_INPUT_PARA_INVALID;
209     }
210     if (credentialMgr_== nullptr) {
211         LOGE("credentialMgr_ is nullptr");
212         return ERR_DM_POINT_NULL;
213     }
214     return credentialMgr_->ImportCredential(pkgName, credentialInfo);
215 }
216 
DeleteCredential(const std::string & pkgName,const std::string & deleteInfo)217 int32_t DeviceManagerServiceImpl::DeleteCredential(const std::string &pkgName, const std::string &deleteInfo)
218 {
219     if (pkgName.empty() || deleteInfo.empty()) {
220         LOGE("DeviceManagerServiceImpl::DeleteCredential failed, pkgName is %{public}s, deleteInfo is %{public}s",
221             pkgName.c_str(), GetAnonyString(deleteInfo).c_str());
222         return ERR_DM_INPUT_PARA_INVALID;
223     }
224     if (credentialMgr_== nullptr) {
225         LOGE("credentialMgr_ is nullptr");
226         return ERR_DM_POINT_NULL;
227     }
228     return credentialMgr_->DeleteCredential(pkgName, deleteInfo);
229 }
230 
MineRequestCredential(const std::string & pkgName,std::string & returnJsonStr)231 int32_t DeviceManagerServiceImpl::MineRequestCredential(const std::string &pkgName, std::string &returnJsonStr)
232 {
233     (void)pkgName;
234     if (mineHiChainConnector_->RequestCredential(returnJsonStr) != DM_OK) {
235         LOGE("failed to get device credential from hichain");
236         return ERR_DM_HICHAIN_CREDENTIAL_REQUEST_FAILED;
237     }
238     return DM_OK;
239 }
240 
CheckCredential(const std::string & pkgName,const std::string & reqJsonStr,std::string & returnJsonStr)241 int32_t DeviceManagerServiceImpl::CheckCredential(const std::string &pkgName, const std::string &reqJsonStr,
242     std::string &returnJsonStr)
243 {
244     (void)pkgName;
245     if (reqJsonStr.empty()) {
246         LOGE("reqJsonStr is empty");
247         return ERR_DM_INPUT_PARA_INVALID;
248     }
249     if (mineHiChainConnector_->CheckCredential(reqJsonStr, returnJsonStr) != DM_OK) {
250         LOGE("failed to check devices credential status");
251         return ERR_DM_HICHAIN_CREDENTIAL_CHECK_FAILED;
252     }
253     return DM_OK;
254 }
255 
ImportCredential(const std::string & pkgName,const std::string & reqJsonStr,std::string & returnJsonStr)256 int32_t DeviceManagerServiceImpl::ImportCredential(const std::string &pkgName, const std::string &reqJsonStr,
257     std::string &returnJsonStr)
258 {
259     (void)pkgName;
260     if (reqJsonStr.empty()) {
261         LOGE("reqJsonStr is empty");
262         return ERR_DM_INPUT_PARA_INVALID;
263     }
264     if (mineHiChainConnector_->ImportCredential(reqJsonStr, returnJsonStr) != DM_OK) {
265         LOGE("failed to import devices credential");
266         return ERR_DM_HICHAIN_CREDENTIAL_IMPORT_FAILED;
267     }
268     return DM_OK;
269 }
270 
DeleteCredential(const std::string & pkgName,const std::string & reqJsonStr,std::string & returnJsonStr)271 int32_t DeviceManagerServiceImpl::DeleteCredential(const std::string &pkgName, const std::string &reqJsonStr,
272     std::string &returnJsonStr)
273 {
274     (void)pkgName;
275     if (reqJsonStr.empty()) {
276         LOGE("reqJsonStr is empty");
277         return ERR_DM_INPUT_PARA_INVALID;
278     }
279     if (mineHiChainConnector_->DeleteCredential(reqJsonStr, returnJsonStr) != DM_OK) {
280         LOGE("failed to delete devices credential");
281         return ERR_DM_HICHAIN_CREDENTIAL_DELETE_FAILED;
282     }
283     return DM_OK;
284 }
285 
RegisterCredentialCallback(const std::string & pkgName)286 int32_t DeviceManagerServiceImpl::RegisterCredentialCallback(const std::string &pkgName)
287 {
288     (void)pkgName;
289     return DM_OK;
290 }
291 
UnRegisterCredentialCallback(const std::string & pkgName)292 int32_t DeviceManagerServiceImpl::UnRegisterCredentialCallback(const std::string &pkgName)
293 {
294     (void)pkgName;
295     return DM_OK;
296 }
297 
RegisterUiStateCallback(const std::string & pkgName)298 int32_t DeviceManagerServiceImpl::RegisterUiStateCallback(const std::string &pkgName)
299 {
300     (void)pkgName;
301     return DM_OK;
302 }
303 
UnRegisterUiStateCallback(const std::string & pkgName)304 int32_t DeviceManagerServiceImpl::UnRegisterUiStateCallback(const std::string &pkgName)
305 {
306     (void)pkgName;
307     return DM_OK;
308 }
309 
NotifyEvent(const std::string & pkgName,const int32_t eventId,const std::string & event)310 int32_t DeviceManagerServiceImpl::NotifyEvent(const std::string &pkgName, const int32_t eventId,
311     const std::string &event)
312 {
313     (void)pkgName;
314     (void)eventId;
315     (void)event;
316     return DM_OK;
317 }
318 
GetGroupType(std::vector<DmDeviceInfo> & deviceList)319 int32_t DeviceManagerServiceImpl::GetGroupType(std::vector<DmDeviceInfo> &deviceList)
320 {
321     (void)deviceList;
322     return DM_OK;
323 }
324 
GetUdidHashByNetWorkId(const char * networkId,std::string & deviceId)325 int32_t DeviceManagerServiceImpl::GetUdidHashByNetWorkId(const char *networkId, std::string &deviceId)
326 {
327     (void)networkId;
328     (void)deviceId;
329     return DM_OK;
330 }
331 
ImportAuthCode(const std::string & pkgName,const std::string & authCode)332 int32_t DeviceManagerServiceImpl::ImportAuthCode(const std::string &pkgName, const std::string &authCode)
333 {
334     (void)pkgName;
335     (void)authCode;
336     return DM_OK;
337 }
338 
HandleCredentialDeleted(const char * credId,const char * credInfo,const std::string & localUdid,std::string & remoteUdid,bool & isSendBroadCast)339 void DeviceManagerServiceImpl::HandleCredentialDeleted(const char *credId, const char *credInfo,
340     const std::string &localUdid, std::string &remoteUdid, bool &isSendBroadCast)
341 {
342     (void)credId;
343     (void)credInfo;
344     (void)localUdid;
345     (void)remoteUdid;
346     (void)isSendBroadCast;
347     return;
348 }
349 
ExportAuthCode(std::string & authCode)350 int32_t DeviceManagerServiceImpl::ExportAuthCode(std::string &authCode)
351 {
352     (void)authCode;
353     return DM_OK;
354 }
355 
RegisterPinHolderCallback(const std::string & pkgName)356 int32_t DeviceManagerServiceImpl::RegisterPinHolderCallback(const std::string &pkgName)
357 {
358     (void)pkgName;
359     return DM_OK;
360 }
361 
CreatePinHolder(const std::string & pkgName,const PeerTargetId & targetId,DmPinType pinType,const std::string & payload)362 int32_t DeviceManagerServiceImpl::CreatePinHolder(const std::string &pkgName, const PeerTargetId &targetId,
363     DmPinType pinType, const std::string &payload)
364 {
365     (void)pkgName;
366     (void)targetId;
367     (void)pinType;
368     (void)payload;
369     return DM_OK;
370 }
371 
DestroyPinHolder(const std::string & pkgName,const PeerTargetId & targetId,DmPinType pinType,const std::string & payload)372 int32_t DeviceManagerServiceImpl::DestroyPinHolder(const std::string &pkgName, const PeerTargetId &targetId,
373     DmPinType pinType, const std::string &payload)
374 {
375     (void)pkgName;
376     (void)targetId;
377     (void)pinType;
378     (void)payload;
379     return DM_OK;
380 }
381 
BindTarget(const std::string & pkgName,const PeerTargetId & targetId,const std::map<std::string,std::string> & bindParam)382 int32_t DeviceManagerServiceImpl::BindTarget(const std::string &pkgName, const PeerTargetId &targetId,
383     const std::map<std::string, std::string> &bindParam)
384 {
385     (void)pkgName;
386     (void)targetId;
387     (void)bindParam;
388     return DM_OK;
389 }
390 
GetAppTrustDeviceIdList(std::string pkgname)391 std::unordered_map<std::string, DmAuthForm> DeviceManagerServiceImpl::GetAppTrustDeviceIdList(
392     std::string pkgname)
393 {
394     (void)pkgname;
395     std::unordered_map<std::string, DmAuthForm> tmp;
396     return tmp;
397 }
398 
LoadHardwareFwkService()399 void DeviceManagerServiceImpl::LoadHardwareFwkService()
400 {
401     return;
402 }
403 
DpAclAdd(const std::string & udid)404 int32_t DeviceManagerServiceImpl::DpAclAdd(const std::string &udid)
405 {
406     (void)udid;
407     return DM_OK;
408 }
409 
IsSameAccount(const std::string & udid)410 int32_t DeviceManagerServiceImpl::IsSameAccount(const std::string &udid)
411 {
412     (void)udid;
413     return DM_OK;
414 }
415 
GetDeviceIdByUserIdAndTokenId(int32_t userId,int32_t tokenId)416 std::vector<std::string> DeviceManagerServiceImpl::GetDeviceIdByUserIdAndTokenId(int32_t userId, int32_t tokenId)
417 {
418     (void)userId;
419     (void)tokenId;
420     std::vector<std::string> tmp;
421     return tmp;
422 }
423 
GetTokenIdByNameAndDeviceId(std::string extra,std::string requestDeviceId)424 uint64_t DeviceManagerServiceImpl::GetTokenIdByNameAndDeviceId(std::string extra, std::string requestDeviceId)
425 {
426     (void)extra;
427     (void)requestDeviceId;
428     return 0;
429 }
430 
ScreenCommonEventCallback(std::string commonEventType)431 void DeviceManagerServiceImpl::ScreenCommonEventCallback(std::string commonEventType)
432 {
433     (void)commonEventType;
434     return;
435 }
436 
CheckIsSameAccount(const DmAccessCaller & caller,const std::string & srcUdid,const DmAccessCallee & callee,const std::string & sinkUdid)437 bool DeviceManagerServiceImpl::CheckIsSameAccount(const DmAccessCaller &caller, const std::string &srcUdid,
438     const DmAccessCallee &callee, const std::string &sinkUdid)
439 {
440     (void)caller;
441     (void)srcUdid;
442     (void)callee;
443     (void)sinkUdid;
444     return true;
445 }
446 
CheckAccessControl(const DmAccessCaller & caller,const std::string & srcUdid,const DmAccessCallee & callee,const std::string & sinkUdid)447 bool DeviceManagerServiceImpl::CheckAccessControl(const DmAccessCaller &caller, const std::string &srcUdid,
448     const DmAccessCallee &callee, const std::string &sinkUdid)
449 {
450     (void)caller;
451     (void)srcUdid;
452     (void)callee;
453     (void)sinkUdid;
454     return true;
455 }
456 
HandleDeviceNotTrust(const std::string & udid)457 void DeviceManagerServiceImpl::HandleDeviceNotTrust(const std::string &udid)
458 {
459     (void)udid;
460     return;
461 }
462 
GetBindLevel(const std::string & pkgName,const std::string & localUdid,const std::string & udid,uint64_t & tokenId)463 int32_t DeviceManagerServiceImpl::GetBindLevel(const std::string &pkgName, const std::string &localUdid,
464     const std::string &udid, uint64_t &tokenId)
465 {
466     (void)pkgName;
467     (void)udid;
468     (void)tokenId;
469     (void)localUdid;
470     return DEVICE_BIUND_LEVEL;
471 }
472 
GetDeviceIdAndUserId(int32_t userId,const std::string & accountId)473 std::multimap<std::string, int32_t> DeviceManagerServiceImpl::GetDeviceIdAndUserId(int32_t userId,
474     const std::string &accountId)
475 {
476     (void)userId;
477     (void)accountId;
478     return std::multimap<std::string, int32_t> {};
479 }
480 
HandleAccountLogoutEvent(int32_t remoteUserId,const std::string & remoteAccountHash,const std::string & remoteUdid)481 void DeviceManagerServiceImpl::HandleAccountLogoutEvent(int32_t remoteUserId, const std::string &remoteAccountHash,
482     const std::string &remoteUdid)
483 {
484     (void)remoteUserId;
485     (void)remoteAccountHash;
486     (void)remoteUdid;
487     return;
488 }
489 
HandleDevUnBindEvent(int32_t remoteUserId,const std::string & remoteUdid)490 void DeviceManagerServiceImpl::HandleDevUnBindEvent(int32_t remoteUserId, const std::string &remoteUdid)
491 {
492     (void)remoteUserId;
493     (void)remoteUdid;
494     return;
495 }
496 
HandleAppUnBindEvent(int32_t remoteUserId,const std::string & remoteUdid,int32_t tokenId)497 void DeviceManagerServiceImpl::HandleAppUnBindEvent(int32_t remoteUserId, const std::string &remoteUdid,
498     int32_t tokenId)
499 {
500     (void)remoteUserId;
501     (void)remoteUdid;
502     (void)tokenId;
503     return;
504 }
505 
HandleAppUnBindEvent(int32_t remoteUserId,const std::string & remoteUdid,int32_t tokenId,int32_t peerTokenId)506 void DeviceManagerServiceImpl::HandleAppUnBindEvent(int32_t remoteUserId, const std::string &remoteUdid,
507     int32_t tokenId, int32_t peerTokenId)
508 {
509     (void)remoteUserId;
510     (void)remoteUdid;
511     (void)tokenId;
512     (void)peerTokenId;
513     return;
514 }
515 
HandleIdentAccountLogout(const DMAclQuadInfo & info,const std::string & accountId)516 void DeviceManagerServiceImpl::HandleIdentAccountLogout(const DMAclQuadInfo &info, const std::string &accountId)
517 {
518     (void)info;
519     (void)accountId;
520     return;
521 }
522 
HandleUserRemoved(std::vector<std::string> peerUdids,int32_t preUserId)523 void DeviceManagerServiceImpl::HandleUserRemoved(std::vector<std::string> peerUdids, int32_t preUserId)
524 {
525     (void)peerUdids;
526     (void)preUserId;
527     return;
528 }
529 
HandleDeviceScreenStatusChange(DmDeviceInfo & devInfo)530 void DeviceManagerServiceImpl::HandleDeviceScreenStatusChange(DmDeviceInfo &devInfo)
531 {
532     (void)devInfo;
533     return;
534 }
535 
HandleUserSwitched(const std::vector<std::string> & deviceVec,int32_t currentUserId,int32_t beforeUserId)536 void DeviceManagerServiceImpl::HandleUserSwitched(const std::vector<std::string> &deviceVec,
537     int32_t currentUserId, int32_t beforeUserId)
538 {
539     (void)deviceVec;
540     (void)currentUserId;
541     (void)beforeUserId;
542     return;
543 }
544 
StopAuthenticateDevice(const std::string & pkgName)545 int32_t DeviceManagerServiceImpl::StopAuthenticateDevice(const std::string &pkgName)
546 {
547     (void)pkgName;
548     return 0;
549 }
550 
SyncLocalAclListProcess(const DevUserInfo & localDevUserInfo,const DevUserInfo & remoteDevUserInfo,std::string remoteAclList)551 int32_t DeviceManagerServiceImpl::SyncLocalAclListProcess(const DevUserInfo &localDevUserInfo,
552     const DevUserInfo &remoteDevUserInfo, std::string remoteAclList)
553 {
554     (void)localDevUserInfo;
555     (void)remoteDevUserInfo;
556     (void)remoteAclList;
557     return 0;
558 }
559 
GetAclListHash(const DevUserInfo & localDevUserInfo,const DevUserInfo & remoteDevUserInfo,std::string & aclList)560 int32_t DeviceManagerServiceImpl::GetAclListHash(const DevUserInfo &localDevUserInfo,
561     const DevUserInfo &remoteDevUserInfo, std::string &aclList)
562 {
563     (void)localDevUserInfo;
564     (void)remoteDevUserInfo;
565     (void)aclList;
566     return 0;
567 }
568 
HandleCredentialAuthStatus(const std::string & deviceList,uint16_t deviceTypeId,int32_t errcode)569 void DeviceManagerServiceImpl::HandleCredentialAuthStatus(const std::string &deviceList, uint16_t deviceTypeId,
570     int32_t errcode)
571 {
572     (void)deviceList;
573     (void)deviceTypeId;
574     (void)errcode;
575     return;
576 }
577 
ProcessAppUnintall(const std::string & appId,int32_t accessTokenId)578 int32_t DeviceManagerServiceImpl::ProcessAppUnintall(const std::string &appId, int32_t accessTokenId)
579 {
580     (void)appId;
581     (void)accessTokenId;
582     return 0;
583 }
584 
ProcessAppUninstall(int32_t userId,int32_t accessTokenId)585 int32_t DeviceManagerServiceImpl::ProcessAppUninstall(int32_t userId, int32_t accessTokenId)
586 {
587     (void)userId;
588     (void)accessTokenId;
589     return 0;
590 }
591 
ProcessUnBindApp(int32_t userId,int32_t accessTokenId,const std::string & extra,const std::string & udid)592 void DeviceManagerServiceImpl::ProcessUnBindApp(int32_t userId, int32_t accessTokenId, const std::string &extra,
593     const std::string &udid)
594 {
595     (void)userId;
596     (void)accessTokenId;
597     (void)extra;
598     (void)udid;
599     return;
600 }
601 
HandleSyncUserIdEvent(const std::vector<uint32_t> & foregroundUserIds,const std::vector<uint32_t> & backgroundUserIds,const std::string & remoteUdid,bool isCheckUserStatus)602 void DeviceManagerServiceImpl::HandleSyncUserIdEvent(const std::vector<uint32_t> &foregroundUserIds,
603     const std::vector<uint32_t> &backgroundUserIds, const std::string &remoteUdid, bool isCheckUserStatus)
604 {
605     (void)foregroundUserIds;
606     (void)backgroundUserIds;
607     (void)remoteUdid;
608     (void)isCheckUserStatus;
609     return;
610 }
611 
HandleShareUnbindBroadCast(const std::string & credId,const int32_t & userId,const std::string & localUdid)612 void DeviceManagerServiceImpl::HandleShareUnbindBroadCast(const std::string &credId, const int32_t &userId,
613     const std::string &localUdid)
614 {
615     (void)credId;
616     (void)userId;
617     (void)localUdid;
618     return;
619 }
620 
HandleRemoteUserRemoved(int32_t preUserId,const std::string & remoteUdid)621 void DeviceManagerServiceImpl::HandleRemoteUserRemoved(int32_t preUserId, const std::string &remoteUdid)
622 {
623     (void)preUserId;
624     (void)remoteUdid;
625     return;
626 }
627 
GetDeviceIdAndBindLevel(int32_t userId)628 std::map<std::string, int32_t> DeviceManagerServiceImpl::GetDeviceIdAndBindLevel(int32_t userId)
629 {
630     (void)userId;
631     return std::map<std::string, int32_t> {};
632 }
633 
GetDeviceIdAndUserId(int32_t localUserId)634 std::multimap<std::string, int32_t> DeviceManagerServiceImpl::GetDeviceIdAndUserId(int32_t localUserId)
635 {
636     (void)localUserId;
637     return std::multimap<std::string, int32_t> {};
638 }
639 
SaveOnlineDeviceInfo(const std::vector<DmDeviceInfo> & deviceList)640 int32_t DeviceManagerServiceImpl::SaveOnlineDeviceInfo(const std::vector<DmDeviceInfo> &deviceList)
641 {
642     (void)deviceList;
643     return DM_OK;
644 }
645 
HandleDeviceUnBind(int32_t bindType,const std::string & peerUdid,const std::string & localUdid,int32_t localUserId,const std::string & localAccountId)646 void DeviceManagerServiceImpl::HandleDeviceUnBind(int32_t bindType, const std::string &peerUdid,
647     const std::string &localUdid, int32_t localUserId, const std::string &localAccountId)
648 {
649     (void)bindType;
650     (void)peerUdid;
651     (void)localUdid;
652     (void)localUserId;
653     (void)localAccountId;
654     return;
655 }
656 
RegisterAuthenticationType(int32_t authenticationType)657 int32_t DeviceManagerServiceImpl::RegisterAuthenticationType(int32_t authenticationType)
658 {
659     (void)authenticationType;
660     return DM_OK;
661 }
662 
DeleteAlwaysAllowTimeOut()663 void DeviceManagerServiceImpl::DeleteAlwaysAllowTimeOut()
664 {
665     return;
666 }
667 
CheckDeleteCredential(const std::string & remoteUdid,int32_t remoteUserId)668 void DeviceManagerServiceImpl::CheckDeleteCredential(const std::string &remoteUdid, int32_t remoteUserId)
669 {
670     (void)remoteUdid;
671     (void)remoteUserId;
672     return;
673 }
674 
CheckDeviceInfoPermission(const std::string & localUdid,const std::string & peerDeviceId)675 int32_t DeviceManagerServiceImpl::CheckDeviceInfoPermission(const std::string &localUdid,
676     const std::string &peerDeviceId)
677 {
678     (void)localUdid;
679     (void)peerDeviceId;
680     return DM_OK;
681 }
682 
HandleServiceUnBindEvent(int32_t userId,const std::string & remoteUdid,int32_t remoteTokenId)683 void DeviceManagerServiceImpl::HandleServiceUnBindEvent(int32_t userId, const std::string &remoteUdid,
684     int32_t remoteTokenId)
685 {
686     (void)userId;
687     (void)remoteUdid;
688     (void)remoteTokenId;
689     return;
690 }
691 
HandleCommonEventBroadCast(const std::vector<uint32_t> & foregroundUserIds,const std::vector<uint32_t> & backgroundUserIds,const std::string & remoteUdid)692 void DeviceManagerServiceImpl::HandleCommonEventBroadCast(const std::vector<uint32_t> &foregroundUserIds,
693     const std::vector<uint32_t> &backgroundUserIds, const std::string &remoteUdid)
694 {
695     (void)foregroundUserIds;
696     (void)backgroundUserIds;
697     (void)remoteUdid;
698     return;
699 }
700 
CheckSrcAccessControl(const DmAccessCaller & caller,const std::string & srcUdid,const DmAccessCallee & callee,const std::string & sinkUdid)701 bool DeviceManagerServiceImpl::CheckSrcAccessControl(const DmAccessCaller &caller, const std::string &srcUdid,
702     const DmAccessCallee &callee, const std::string &sinkUdid)
703 {
704     (void)caller;
705     (void)srcUdid;
706     (void)callee;
707     (void)sinkUdid;
708     return true;
709 }
710 
CheckSinkAccessControl(const DmAccessCaller & caller,const std::string & srcUdid,const DmAccessCallee & callee,const std::string & sinkUdid)711 bool DeviceManagerServiceImpl::CheckSinkAccessControl(const DmAccessCaller &caller, const std::string &srcUdid,
712     const DmAccessCallee &callee, const std::string &sinkUdid)
713 {
714     (void)caller;
715     (void)srcUdid;
716     (void)callee;
717     (void)sinkUdid;
718     return true;
719 }
720 
CheckSrcIsSameAccount(const DmAccessCaller & caller,const std::string & srcUdid,const DmAccessCallee & callee,const std::string & sinkUdid)721 bool DeviceManagerServiceImpl::CheckSrcIsSameAccount(const DmAccessCaller &caller, const std::string &srcUdid,
722     const DmAccessCallee &callee, const std::string &sinkUdid)
723 {
724     (void)caller;
725     (void)srcUdid;
726     (void)callee;
727     (void)sinkUdid;
728     return true;
729 }
730 
CheckSinkIsSameAccount(const DmAccessCaller & caller,const std::string & srcUdid,const DmAccessCallee & callee,const std::string & sinkUdid)731 bool DeviceManagerServiceImpl::CheckSinkIsSameAccount(const DmAccessCaller &caller, const std::string &srcUdid,
732     const DmAccessCallee &callee, const std::string &sinkUdid)
733 {
734     (void)caller;
735     (void)srcUdid;
736     (void)callee;
737     (void)sinkUdid;
738     return true;
739 }
740 
DeleteHoDevice(const std::string & peerUdid,const std::vector<int32_t> & foreGroundUserIds,const std::vector<int32_t> & backGroundUserIds)741 void DeviceManagerServiceImpl::DeleteHoDevice(const std::string &peerUdid,
742     const std::vector<int32_t> &foreGroundUserIds, const std::vector<int32_t> &backGroundUserIds)
743 {
744     (void)peerUdid;
745     (void)foreGroundUserIds;
746     (void)backGroundUserIds;
747     return;
748 }
749 
CreateDMServiceObject(void)750 extern "C" IDeviceManagerServiceImpl *CreateDMServiceObject(void)
751 {
752     return new DeviceManagerServiceImpl;
753 }
754 } // namespace DistributedHardware
755 } // namespace OHOS