• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
GetScheduleNode(uint64_t scheduleId) const53 std::shared_ptr<ScheduleNode> ScheduleHolderContext::GetScheduleNode(uint64_t scheduleId) const
54 {
55     IF_FALSE_LOGE_AND_RETURN_VAL(scheduleNode_ != nullptr, nullptr);
56     IF_FALSE_LOGE_AND_RETURN_VAL(scheduleNode_->GetScheduleId() == scheduleId, nullptr);
57 
58     return scheduleNode_;
59 }
60 
GetTokenId() const61 uint32_t ScheduleHolderContext::GetTokenId() const
62 {
63     IAM_LOGE("not implemented");
64     return 0;
65 }
66 
GetLatestError() const67 int32_t ScheduleHolderContext::GetLatestError() const
68 {
69     IAM_LOGE("not implemented");
70     return 0;
71 }
72 
GetUserId() const73 int32_t ScheduleHolderContext::GetUserId() const
74 {
75     IAM_LOGE("not implemented");
76     return 0;
77 }
78 
SetLatestError(int32_t error)79 void ScheduleHolderContext::SetLatestError(int32_t error)
80 {
81     static_cast<void>(error);
82     IAM_LOGE("not implemented");
83 }
84 } // namespace UserAuth
85 } // namespace UserIam
86 } // namespace OHOS
87