• 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 FACE_AUTH_EXECUTOR_CALLBACK_HDI
17 #define FACE_AUTH_EXECUTOR_CALLBACK_HDI
18 
19 #include <cstdint>
20 
21 #include "hdf_base.h"
22 #include "nocopyable.h"
23 
24 #include "iexecute_callback.h"
25 #include "v1_0/iexecutor_callback.h"
26 
27 namespace OHOS {
28 namespace UserIam {
29 namespace FaceAuth {
30 namespace FaceHdi = OHOS::HDI::FaceAuth::V1_0;
31 namespace UserAuth = OHOS::UserIam::UserAuth;
32 class FaceAuthExecutorCallbackHdi : public FaceHdi::IExecutorCallback, public NoCopyable {
33 public:
34     explicit FaceAuthExecutorCallbackHdi(std::shared_ptr<UserAuth::IExecuteCallback> frameworkCallback);
35     ~FaceAuthExecutorCallbackHdi() override = default;
36 
37     // FaceHdi::IExecutorCallback
38     int32_t OnResult(int32_t result, const std::vector<uint8_t> &extraInfo) override;
39     int32_t OnTip(int32_t tip, const std::vector<uint8_t> &extraInfo) override;
40 
41 private:
42     UserIam::UserAuth::ResultCode ConvertResultCode(const int32_t in);
43 
44     std::shared_ptr<UserAuth::IExecuteCallback> frameworkCallback_;
45 };
46 } // namespace FaceAuth
47 } // namespace UserIam
48 } // namespace OHOS
49 
50 #endif // FACE_AUTH_EXECUTOR_CALLBACK_HDI
51