1 /*
2  * Copyright (c) 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 #ifndef DUMMY_RESOURCE_NODE_H
17 #define DUMMY_RESOURCE_NODE_H
18 
19 #include "resource_node.h"
20 
21 #undef private
22 
23 namespace OHOS {
24 namespace UserIam {
25 namespace UserAuth {
26 namespace {
27 class DummyResourceNode : public ResourceNode {
28 public:
GetExecutorIndex()29     uint64_t GetExecutorIndex() const
30     {
31         return 0;
32     };
GetOwnerDeviceId()33     std::string GetOwnerDeviceId() const
34     {
35         return "";
36     };
GetOwnerPid()37     uint32_t GetOwnerPid() const
38     {
39         return 0;
40     };
GetAuthType()41     AuthType GetAuthType() const
42     {
43         return static_cast<AuthType>(0);
44     };
GetExecutorRole()45     ExecutorRole GetExecutorRole() const
46     {
47         return static_cast<ExecutorRole>(0);
48     };
GetExecutorSensorHint()49     uint64_t GetExecutorSensorHint() const
50     {
51         return 0;
52     };
GetExecutorMatcher()53     uint64_t GetExecutorMatcher() const
54     {
55         return 0;
56     };
GetExecutorEsl()57     ExecutorSecureLevel GetExecutorEsl() const
58     {
59         return static_cast<ExecutorSecureLevel>(0);
60     };
GetExecutorPublicKey()61     std::vector<uint8_t> GetExecutorPublicKey() const
62     {
63         return {};
64     };
GetExecutorDeviceUdid()65     std::string GetExecutorDeviceUdid() const
66     {
67         return "";
68     };
BeginExecute(uint64_t scheduleId,const std::vector<uint8_t> & publicKey,const Attributes & command)69     int32_t BeginExecute(uint64_t scheduleId, const std::vector<uint8_t> &publicKey,
70         const Attributes &command)
71     {
72         return 0;
73     };
EndExecute(uint64_t scheduleId,const Attributes & command)74     int32_t EndExecute(uint64_t scheduleId, const Attributes &command)
75     {
76         return 0;
77     };
SetProperty(const Attributes & properties)78     int32_t SetProperty(const Attributes &properties)
79     {
80         return 0;
81     };
GetProperty(const Attributes & condition,Attributes & values)82     int32_t GetProperty(const Attributes &condition, Attributes &values)
83     {
84         return 0;
85     };
SendData(uint64_t scheduleId,const Attributes & data)86     int32_t SendData(uint64_t scheduleId, const Attributes &data)
87     {
88         return 0;
89     };
DeleteFromDriver()90     void DeleteFromDriver()
91     {};
DetachFromDriver()92     void DetachFromDriver()
93     {};
94 
MakeNewResource(const ExecutorRegisterInfo & info,const std::shared_ptr<ExecutorCallbackInterface> & callback,std::vector<uint64_t> & templateIdList,std::vector<uint8_t> & fwkPublicKey)95     static std::shared_ptr<ResourceNode> MakeNewResource(const ExecutorRegisterInfo &info,
96         const std::shared_ptr<ExecutorCallbackInterface> &callback, std::vector<uint64_t> &templateIdList,
97         std::vector<uint8_t> &fwkPublicKey)
98         {
99             return nullptr;
100         };
101 
CreateWithExecuteIndex(uint64_t executorId,AuthType authType,ExecutorRole executorRole,ExecutorCallbackInterface & callback)102     static std::shared_ptr<ResourceNode> CreateWithExecuteIndex(uint64_t executorId, AuthType authType,
103         ExecutorRole executorRole, ExecutorCallbackInterface &callback)
104     {
105         auto node = std::make_shared<DummyResourceNode>();
106         return node;
107     };
108 };
109 }
110 } // UserAuth
111 } // UserIam
112 } // OHOS
113 
114 #endif // DUMMY_RESOURCE_NODE_H