• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 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 USER_AUTH_CALLBACK_SERVICE_H
17 #define USER_AUTH_CALLBACK_SERVICE_H
18 
19 #include "user_auth_callback_stub.h"
20 
21 #include "iam_hitrace_helper.h"
22 #include "user_auth_client_callback.h"
23 
24 namespace OHOS {
25 namespace UserIam {
26 namespace UserAuth {
27 class UserAuthCallbackService : public UserAuthCallbackStub {
28 public:
29     explicit UserAuthCallbackService(const std::shared_ptr<AuthenticationCallback> &impl);
30     explicit UserAuthCallbackService(const std::shared_ptr<IdentificationCallback> &impl);
31     explicit UserAuthCallbackService(const std::shared_ptr<PrepareRemoteAuthCallback> &impl);
32     ~UserAuthCallbackService() override;
33     void OnResult(int32_t result, const Attributes &extraInfo) override;
34     void OnAcquireInfo(int32_t module, int32_t acquireInfo, const Attributes &extraInfo) override;
35 
36 private:
37     std::shared_ptr<AuthenticationCallback> authCallback_ {nullptr};
38     std::shared_ptr<IdentificationCallback> identifyCallback_ {nullptr};
39     std::shared_ptr<PrepareRemoteAuthCallback> prepareRemoteAuthCallback_ {nullptr};
40     std::shared_ptr<UserIam::UserAuth::IamHitraceHelper> iamHitraceHelper_ {nullptr};
41 };
42 
43 class GetExecutorPropertyCallbackService : public GetExecutorPropertyCallbackStub {
44 public:
45     explicit GetExecutorPropertyCallbackService(const std::shared_ptr<GetPropCallback> &impl);
46     ~GetExecutorPropertyCallbackService() override;
47     void OnGetExecutorPropertyResult(int32_t result, const Attributes &attributes) override;
48 
49 private:
50     std::shared_ptr<GetPropCallback> getPropCallback_ {nullptr};
51 };
52 
53 class SetExecutorPropertyCallbackService : public SetExecutorPropertyCallbackStub {
54 public:
55     explicit SetExecutorPropertyCallbackService(const std::shared_ptr<SetPropCallback> &impl);
56     ~SetExecutorPropertyCallbackService() override;
57     void OnSetExecutorPropertyResult(int32_t result) override;
58 
59 private:
60     std::shared_ptr<SetPropCallback> setPropCallback_ {nullptr};
61 };
62 } // namespace UserAuth
63 } // namespace UserIam
64 } // namespace OHOS
65 #endif // USER_AUTH_CALLBACK_SERVICE_H