2 * Copyright (C) 2014 The Android Open Source Project
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 #define LOG_TAG "FingerprintHal"
21 #include <cutils/log.h>
22 #include <hardware/hardware.h>
23 #include <hardware/fingerprint.h>
25 static int fingerprint_close(hw_device_t *dev)
36 static uint64_t fingerprint_pre_enroll(struct fingerprint_device __unused *dev) {
37 return FINGERPRINT_ERROR;
40 static int fingerprint_enroll(struct fingerprint_device __unused *dev,
41 const hw_auth_token_t __unused *hat,
42 uint32_t __unused gid,
43 uint32_t __unused timeout_sec) {
44 return FINGERPRINT_ERROR;
47 static uint64_t fingerprint_get_auth_id(struct fingerprint_device __unused *dev) {
48 return FINGERPRINT_ERROR;
51 static int fingerprint_cancel(struct fingerprint_device __unused *dev) {
52 return FINGERPRINT_ERROR;
55 static int fingerprint_remove(struct fingerprint_device __unused *dev,
56 uint32_t __unused gid, uint32_t __unused fid) {
57 return FINGERPRINT_ERROR;
60 static int fingerprint_set_active_group(struct fingerprint_device __unused *dev,
61 uint32_t __unused gid, const char __unused *store_path) {
62 return FINGERPRINT_ERROR;
65 static int fingerprint_authenticate(struct fingerprint_device __unused *dev,
66 uint64_t __unused operation_id, __unused uint32_t gid) {
67 return FINGERPRINT_ERROR;
70 static int set_notify_callback(struct fingerprint_device *dev,
71 fingerprint_notify_t notify) {
72 /* Decorate with locks */
74 return FINGERPRINT_ERROR;
77 static int fingerprint_open(const hw_module_t* module, const char __unused *id,
81 ALOGE("NULL device on open");
85 fingerprint_device_t *dev = malloc(sizeof(fingerprint_device_t));
86 memset(dev, 0, sizeof(fingerprint_device_t));
88 dev->common.tag = HARDWARE_DEVICE_TAG;
89 dev->common.version = FINGERPRINT_MODULE_API_VERSION_2_0;
90 dev->common.module = (struct hw_module_t*) module;
91 dev->common.close = fingerprint_close;
93 dev->pre_enroll = fingerprint_pre_enroll;
94 dev->enroll = fingerprint_enroll;
95 dev->get_authenticator_id = fingerprint_get_auth_id;
96 dev->cancel = fingerprint_cancel;
97 dev->remove = fingerprint_remove;
98 dev->set_active_group = fingerprint_set_active_group;
99 dev->authenticate = fingerprint_authenticate;
100 dev->set_notify = set_notify_callback;
103 *device = (hw_device_t*) dev;
107 static struct hw_module_methods_t fingerprint_module_methods = {
108 .open = fingerprint_open,
111 fingerprint_module_t HAL_MODULE_INFO_SYM = {
113 .tag = HARDWARE_MODULE_TAG,
114 .module_api_version = FINGERPRINT_MODULE_API_VERSION_2_0,
115 .hal_api_version = HARDWARE_HAL_API_VERSION,
116 .id = FINGERPRINT_HARDWARE_MODULE_ID,
117 .name = "Demo Fingerprint HAL",
118 .author = "The Android Open Source Project",
119 .methods = &fingerprint_module_methods,