• 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 "distributed_device_profile_client_mock.h"
17 
18 #include "gtest/gtest.h"
19 
20 namespace OHOS {
21 namespace DistributedDeviceProfile {
22 IMPLEMENT_SINGLE_INSTANCE(DistributedDeviceProfileClient);
GetAccessControlProfile(std::map<std::string,std::string> params,std::vector<AccessControlProfile> & accessControlProfiles)23 int32_t DistributedDeviceProfileClient::GetAccessControlProfile(std::map<std::string, std::string> params,
24     std::vector<AccessControlProfile>& accessControlProfiles)
25 {
26     return DpDistributedDeviceProfileClient::dpDistributedDeviceProfileClient->GetAccessControlProfile(params,
27         accessControlProfiles);
28 }
29 
PutAccessControlProfile(const AccessControlProfile & accessControlProfile)30 int32_t DistributedDeviceProfileClient::PutAccessControlProfile(const AccessControlProfile& accessControlProfile)
31 {
32     return DpDistributedDeviceProfileClient::dpDistributedDeviceProfileClient->PutAccessControlProfile(
33         accessControlProfile);
34 }
35 
GetAllAccessControlProfile(std::vector<AccessControlProfile> & accessControlProfiles)36 int32_t DistributedDeviceProfileClient::GetAllAccessControlProfile(
37     std::vector<AccessControlProfile>& accessControlProfiles)
38 {
39     return DpDistributedDeviceProfileClient::dpDistributedDeviceProfileClient->GetAllAccessControlProfile(
40         accessControlProfiles);
41 }
42 
SubscribeDeviceProfileInited(int32_t saId,sptr<IDpInitedCallback> initedCb)43 int32_t DistributedDeviceProfileClient::SubscribeDeviceProfileInited(int32_t saId, sptr<IDpInitedCallback> initedCb)
44 {
45     return DpDistributedDeviceProfileClient::dpDistributedDeviceProfileClient->SubscribeDeviceProfileInited(saId,
46         initedCb);
47 }
48 
UnSubscribeDeviceProfileInited(int32_t saId)49 int32_t DistributedDeviceProfileClient::UnSubscribeDeviceProfileInited(int32_t saId)
50 {
51     return DpDistributedDeviceProfileClient::dpDistributedDeviceProfileClient->UnSubscribeDeviceProfileInited(saId);
52 }
53 
PutAllTrustedDevices(const std::vector<DistributedDeviceProfile::TrustedDeviceInfo> & deviceInfos)54 int32_t DistributedDeviceProfileClient::PutAllTrustedDevices(
55     const std::vector<DistributedDeviceProfile::TrustedDeviceInfo> &deviceInfos)
56 {
57     return DpDistributedDeviceProfileClient::dpDistributedDeviceProfileClient->PutAllTrustedDevices(deviceInfos);
58 }
59 
PutSessionKey(uint32_t userId,const std::vector<uint8_t> & sessionKey,int32_t & sessionKeyId)60 int32_t DistributedDeviceProfileClient::PutSessionKey(
61     uint32_t userId, const std::vector<uint8_t>& sessionKey, int32_t& sessionKeyId)
62 {
63     return DpDistributedDeviceProfileClient::dpDistributedDeviceProfileClient->
64         PutSessionKey(userId, sessionKey, sessionKeyId);
65 }
66 
PutLocalServiceInfo(const LocalServiceInfo & localServiceInfo)67 int32_t DistributedDeviceProfileClient::PutLocalServiceInfo(const LocalServiceInfo& localServiceInfo)
68 {
69     return DpDistributedDeviceProfileClient::dpDistributedDeviceProfileClient->PutLocalServiceInfo(localServiceInfo);
70 }
71 
DeleteLocalServiceInfo(const std::string & bundleName,int32_t pinExchangeType)72 int32_t DistributedDeviceProfileClient::DeleteLocalServiceInfo(const std::string& bundleName, int32_t pinExchangeType)
73 {
74     return DpDistributedDeviceProfileClient::dpDistributedDeviceProfileClient->DeleteLocalServiceInfo(bundleName,
75         pinExchangeType);
76 }
77 
UpdateLocalServiceInfo(const LocalServiceInfo & localServiceInfo)78 int32_t DistributedDeviceProfileClient::UpdateLocalServiceInfo(const LocalServiceInfo& localServiceInfo)
79 {
80     return DpDistributedDeviceProfileClient::dpDistributedDeviceProfileClient->UpdateLocalServiceInfo(localServiceInfo);
81 }
82 
GetLocalServiceInfoByBundleAndPinType(const std::string & bundleName,int32_t pinExchangeType,LocalServiceInfo & localServiceInfo)83 int32_t DistributedDeviceProfileClient::GetLocalServiceInfoByBundleAndPinType(const std::string& bundleName,
84     int32_t pinExchangeType, LocalServiceInfo& localServiceInfo)
85 {
86     return DpDistributedDeviceProfileClient::dpDistributedDeviceProfileClient->GetLocalServiceInfoByBundleAndPinType(
87         bundleName, pinExchangeType, localServiceInfo);
88 }
89 
GetBusinessEvent(BusinessEvent & event)90 int32_t DistributedDeviceProfileClient::GetBusinessEvent(BusinessEvent &event)
91 {
92     return DpDistributedDeviceProfileClient::dpDistributedDeviceProfileClient->GetBusinessEvent(event);
93 }
94 
PutBusinessEvent(const DistributedDeviceProfile::BusinessEvent & event)95 int32_t DistributedDeviceProfileClient::PutBusinessEvent(const DistributedDeviceProfile::BusinessEvent &event)
96 {
97     return DpDistributedDeviceProfileClient::dpDistributedDeviceProfileClient->PutBusinessEvent(event);
98 }
99 
GetAllAclIncludeLnnAcl(std::vector<AccessControlProfile> & profiles)100 int32_t DistributedDeviceProfileClient::GetAllAclIncludeLnnAcl(std::vector<AccessControlProfile>& profiles)
101 {
102     return DpDistributedDeviceProfileClient::dpDistributedDeviceProfileClient->GetAllAclIncludeLnnAcl(profiles);
103 }
104 } // namespace DistributedHardware
105 } // namespace OHOS