• 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 #include "fingerprint_auth_interface_service.h"
17 
18 #include <hdf_base.h>
19 
20 #include "executor_impl.h"
21 #include "iam_logger.h"
22 
23 #define LOG_LABEL OHOS::UserIam::Common::LABEL_FINGERPRINT_AUTH_IMPL
24 
25 namespace OHOS {
26 namespace HDI {
27 namespace FingerprintAuth {
28 namespace V1_0 {
FingerprintAuthInterfaceImplGetInstance(void)29 extern "C" IFingerprintAuthInterface *FingerprintAuthInterfaceImplGetInstance(void)
30 {
31     auto fingerprintAuthInterfaceService = new (std::nothrow) FingerprintAuthInterfaceService();
32     if (fingerprintAuthInterfaceService == nullptr) {
33         IAM_LOGE("fingerprintAuthInterfaceService is nullptr");
34         return nullptr;
35     }
36     return fingerprintAuthInterfaceService;
37 }
38 
FingerprintAuthInterfaceService()39 FingerprintAuthInterfaceService::FingerprintAuthInterfaceService()
40 {
41     auto executor = new (std::nothrow) ExecutorImpl();
42     if (executor == nullptr) {
43         IAM_LOGE("executor is nullptr");
44         return;
45     }
46     executorList_.push_back(sptr<IExecutor>(executor));
47 }
48 
GetExecutorList(std::vector<sptr<IExecutor>> & executorList)49 int32_t FingerprintAuthInterfaceService::GetExecutorList(std::vector<sptr<IExecutor>> &executorList)
50 {
51     IAM_LOGI("interface mock start");
52     executorList = executorList_;
53     IAM_LOGI("interface mock success");
54     return HDF_SUCCESS;
55 }
56 } // namespace V1_0
57 } // namespace FingerprintAuth
58 } // namespace HDI
59 } // namespace OHOS
60