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 #include "schedule_holder_context.h"
16
17 #include "iam_check.h"
18 #include "iam_logger.h"
19
20 #define LOG_TAG "USER_AUTH_SA"
21
22 namespace OHOS {
23 namespace UserIam {
24 namespace UserAuth {
ScheduleHolderContext(uint64_t contextId,std::shared_ptr<ScheduleNode> scheduleNode)25 ScheduleHolderContext::ScheduleHolderContext(uint64_t contextId, std::shared_ptr<ScheduleNode> scheduleNode)
26 : contextId_(contextId),
27 scheduleNode_(scheduleNode)
28 {
29 }
30
Start()31 bool ScheduleHolderContext::Start()
32 {
33 IAM_LOGE("not implemented");
34 return false;
35 }
36
Stop()37 bool ScheduleHolderContext::Stop()
38 {
39 IAM_LOGE("not implemented");
40 return false;
41 }
42
GetContextId() const43 uint64_t ScheduleHolderContext::GetContextId() const
44 {
45 return contextId_;
46 }
47
GetContextType() const48 ContextType ScheduleHolderContext::GetContextType() const
49 {
50 return ContextType::SCHEDULE_HOLDER_CONTEXT;
51 }
52
GetAuthType() const53 int32_t ScheduleHolderContext::GetAuthType() const
54 {
55 IAM_LOGE("not implemented");
56 return 0;
57 }
58
GetCallerName() const59 std::string ScheduleHolderContext::GetCallerName() const
60 {
61 IAM_LOGE("not implemented");
62 return "";
63 }
64
GetScheduleNode(uint64_t scheduleId) const65 std::shared_ptr<ScheduleNode> ScheduleHolderContext::GetScheduleNode(uint64_t scheduleId) const
66 {
67 IF_FALSE_LOGE_AND_RETURN_VAL(scheduleNode_ != nullptr, nullptr);
68 IF_FALSE_LOGE_AND_RETURN_VAL(scheduleNode_->GetScheduleId() == scheduleId, nullptr);
69
70 return scheduleNode_;
71 }
72
GetTokenId() const73 uint32_t ScheduleHolderContext::GetTokenId() const
74 {
75 IAM_LOGE("not implemented");
76 return 0;
77 }
78
GetLatestError() const79 int32_t ScheduleHolderContext::GetLatestError() const
80 {
81 IAM_LOGE("not implemented");
82 return 0;
83 }
84
GetUserId() const85 int32_t ScheduleHolderContext::GetUserId() const
86 {
87 IAM_LOGE("not implemented");
88 return 0;
89 }
90
SetLatestError(int32_t error)91 void ScheduleHolderContext::SetLatestError(int32_t error)
92 {
93 static_cast<void>(error);
94 IAM_LOGE("not implemented");
95 }
96 } // namespace UserAuth
97 } // namespace UserIam
98 } // namespace OHOS
99