• 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_DRIVER_HDI
17 #define FACE_AUTH_DRIVER_HDI
18 
19 #include <vector>
20 
21 #include "iremote_broker.h"
22 #include "nocopyable.h"
23 
24 #include "iam_executor_iauth_driver_hdi.h"
25 #include "iam_executor_iauth_executor_hdi.h"
26 
27 #include "face_auth_executor_hdi.h"
28 #include "face_auth_interface_adapter.h"
29 
30 namespace OHOS {
31 namespace UserIam {
32 namespace FaceAuth {
33 namespace UserAuth = OHOS::UserIam::UserAuth;
34 class FaceAuthDriverHdi : public UserAuth::IAuthDriverHdi, public NoCopyable {
35 public:
36     explicit FaceAuthDriverHdi(const std::shared_ptr<FaceAuthInterfaceAdapter> faceAuthInterfaceAdapter);
37     ~FaceAuthDriverHdi() override = default;
38 
39     void GetExecutorList(std::vector<std::shared_ptr<UserAuth::IAuthExecutorHdi>> &executorList) override;
40     void OnHdiDisconnect() override;
41 
42     int32_t SetBufferProducer(sptr<IBufferProducer> &producer);
43 
44 private:
45     static std::mutex mutex_;
46     const std::shared_ptr<FaceAuthInterfaceAdapter> faceAuthInterfaceAdapter_;
47     std::vector<std::shared_ptr<FaceAuthExecutorHdi>> faceAuthExecutorList_;
48 };
49 } // namespace FaceAuth
50 } // namespace UserIam
51 } // namespace OHOS
52 
53 #endif // FACE_AUTH_DRIVER_HDI