1 /*
2  * Copyright (c) 2022-2023 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 FINGERPRINT_AUTH_DRIVER_HDI
17 #define FINGERPRINT_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 "fingerprint_auth_all_in_one_executor_hdi.h"
28 #include "fingerprint_auth_interface_adapter.h"
29 
30 namespace OHOS {
31 namespace UserIam {
32 namespace FingerprintAuth {
33 namespace UserAuth = OHOS::UserIam::UserAuth;
34 class FingerprintAuthDriverHdi : public UserAuth::IAuthDriverHdi, public NoCopyable {
35 public:
36     explicit FingerprintAuthDriverHdi(
37         const std::shared_ptr<FingerprintAuthInterfaceAdapter> fingerprintAuthInterfaceAdapter);
38     ~FingerprintAuthDriverHdi() override = default;
39 
40     void GetExecutorList(std::vector<std::shared_ptr<UserAuth::IAuthExecutorHdi>> &executorList) override;
41     void OnHdiDisconnect() override;
42 
43 private:
44     static std::mutex mutex_;
45     const std::shared_ptr<FingerprintAuthInterfaceAdapter> fingerprintAuthInterfaceAdapter_;
46     std::vector<std::shared_ptr<FingerprintAllInOneExecutorHdi>> fingerprintAuthExecutorList_;
47 };
48 } // namespace FingerprintAuth
49 } // namespace UserIam
50 } // namespace OHOS
51 
52 #endif // FINGERPRINT_AUTH_DRIVER_HDI