Sasha Levitskiy | a747c06 | 2014-03-24 16:14:42 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2014 The Android Open Source Project |
| 3 | * |
| 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 |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 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. |
| 15 | */ |
| 16 | |
| 17 | #ifndef ANDROID_INCLUDE_HARDWARE_FINGERPRINT_H |
| 18 | #define ANDROID_INCLUDE_HARDWARE_FINGERPRINT_H |
| 19 | |
Sasha Levitskiy | 6eced70 | 2015-04-12 22:58:21 -0700 | [diff] [blame] | 20 | #include <hardware/hw_auth_token.h> |
| 21 | |
Sasha Levitskiy | a747c06 | 2014-03-24 16:14:42 -0700 | [diff] [blame] | 22 | #define FINGERPRINT_MODULE_API_VERSION_1_0 HARDWARE_MODULE_API_VERSION(1, 0) |
Sasha Levitskiy | 3b7402e | 2014-12-11 06:49:36 -0800 | [diff] [blame] | 23 | #define FINGERPRINT_MODULE_API_VERSION_2_0 HARDWARE_MODULE_API_VERSION(2, 0) |
Sasha Levitskiy | c7ffe16 | 2015-10-28 13:58:44 -0700 | [diff] [blame] | 24 | #define FINGERPRINT_MODULE_API_VERSION_2_1 HARDWARE_MODULE_API_VERSION(2, 1) |
Sasha Levitskiy | a747c06 | 2014-03-24 16:14:42 -0700 | [diff] [blame] | 25 | #define FINGERPRINT_HARDWARE_MODULE_ID "fingerprint" |
| 26 | |
Sasha Levitskiy | 7308284 | 2014-04-18 11:14:11 -0700 | [diff] [blame] | 27 | typedef enum fingerprint_msg_type { |
Sasha Levitskiy | a747c06 | 2014-03-24 16:14:42 -0700 | [diff] [blame] | 28 | FINGERPRINT_ERROR = -1, |
Sasha Levitskiy | ba45e05 | 2014-06-09 13:19:52 -0700 | [diff] [blame] | 29 | FINGERPRINT_ACQUIRED = 1, |
Sasha Levitskiy | ba45e05 | 2014-06-09 13:19:52 -0700 | [diff] [blame] | 30 | FINGERPRINT_TEMPLATE_ENROLLING = 3, |
Sasha Levitskiy | 3b7402e | 2014-12-11 06:49:36 -0800 | [diff] [blame] | 31 | FINGERPRINT_TEMPLATE_REMOVED = 4, |
Sasha Levitskiy | c7ffe16 | 2015-10-28 13:58:44 -0700 | [diff] [blame] | 32 | FINGERPRINT_AUTHENTICATED = 5, |
| 33 | FINGERPRINT_TEMPLATE_ENUMERATING = 6, |
Sasha Levitskiy | 7308284 | 2014-04-18 11:14:11 -0700 | [diff] [blame] | 34 | } fingerprint_msg_type_t; |
Sasha Levitskiy | a747c06 | 2014-03-24 16:14:42 -0700 | [diff] [blame] | 35 | |
Jim Miller | 929e0a1 | 2015-07-24 18:25:40 -0700 | [diff] [blame] | 36 | /* |
| 37 | * Fingerprint errors are meant to tell the framework to terminate the current operation and ask |
| 38 | * for the user to correct the situation. These will almost always result in messaging and user |
| 39 | * interaction to correct the problem. |
| 40 | * |
| 41 | * For example, FINGERPRINT_ERROR_CANCELED should follow any acquisition message that results in |
| 42 | * a situation where the current operation can't continue without user interaction. For example, |
| 43 | * if the sensor is dirty during enrollment and no further enrollment progress can be made, |
| 44 | * send FINGERPRINT_ACQUIRED_IMAGER_DIRTY followed by FINGERPRINT_ERROR_CANCELED. |
| 45 | */ |
Sasha Levitskiy | a747c06 | 2014-03-24 16:14:42 -0700 | [diff] [blame] | 46 | typedef enum fingerprint_error { |
Jim Miller | 929e0a1 | 2015-07-24 18:25:40 -0700 | [diff] [blame] | 47 | FINGERPRINT_ERROR_HW_UNAVAILABLE = 1, /* The hardware has an error that can't be resolved. */ |
| 48 | FINGERPRINT_ERROR_UNABLE_TO_PROCESS = 2, /* Bad data; operation can't continue */ |
| 49 | FINGERPRINT_ERROR_TIMEOUT = 3, /* The operation has timed out waiting for user input. */ |
Jim Miller | 1fb1e33 | 2015-03-24 19:25:47 -0700 | [diff] [blame] | 50 | FINGERPRINT_ERROR_NO_SPACE = 4, /* No space available to store a template */ |
Jim Miller | 929e0a1 | 2015-07-24 18:25:40 -0700 | [diff] [blame] | 51 | FINGERPRINT_ERROR_CANCELED = 5, /* The current operation can't proceed. See above. */ |
| 52 | FINGERPRINT_ERROR_UNABLE_TO_REMOVE = 6, /* fingerprint with given id can't be removed */ |
Sasha Levitskiy | 7e9204a | 2016-01-07 14:46:45 -0800 | [diff] [blame] | 53 | FINGERPRINT_ERROR_LOCKOUT = 7, /* the functionality is temporarily locked out */ |
Jim Miller | 1fb1e33 | 2015-03-24 19:25:47 -0700 | [diff] [blame] | 54 | FINGERPRINT_ERROR_VENDOR_BASE = 1000 /* vendor-specific error messages start here */ |
Sasha Levitskiy | a747c06 | 2014-03-24 16:14:42 -0700 | [diff] [blame] | 55 | } fingerprint_error_t; |
| 56 | |
Jim Miller | 929e0a1 | 2015-07-24 18:25:40 -0700 | [diff] [blame] | 57 | /* |
| 58 | * Fingerprint acquisition info is meant as feedback for the current operation. Anything but |
| 59 | * FINGERPRINT_ACQUIRED_GOOD will be shown to the user as feedback on how to take action on the |
| 60 | * current operation. For example, FINGERPRINT_ACQUIRED_IMAGER_DIRTY can be used to tell the user |
| 61 | * to clean the sensor. If this will cause the current operation to fail, an additional |
| 62 | * FINGERPRINT_ERROR_CANCELED can be sent to stop the operation in progress (e.g. enrollment). |
| 63 | * In general, these messages will result in a "Try again" message. |
| 64 | */ |
Jim Miller | 953524b | 2014-06-16 17:59:40 -0700 | [diff] [blame] | 65 | typedef enum fingerprint_acquired_info { |
| 66 | FINGERPRINT_ACQUIRED_GOOD = 0, |
Jim Miller | 929e0a1 | 2015-07-24 18:25:40 -0700 | [diff] [blame] | 67 | FINGERPRINT_ACQUIRED_PARTIAL = 1, /* sensor needs more data, i.e. longer swipe. */ |
| 68 | FINGERPRINT_ACQUIRED_INSUFFICIENT = 2, /* image doesn't contain enough detail for recognition*/ |
| 69 | FINGERPRINT_ACQUIRED_IMAGER_DIRTY = 3, /* sensor needs to be cleaned */ |
| 70 | FINGERPRINT_ACQUIRED_TOO_SLOW = 4, /* mostly swipe-type sensors; not enough data collected */ |
| 71 | FINGERPRINT_ACQUIRED_TOO_FAST = 5, /* for swipe and area sensors; tell user to slow down*/ |
Jim Miller | 1fb1e33 | 2015-03-24 19:25:47 -0700 | [diff] [blame] | 72 | FINGERPRINT_ACQUIRED_VENDOR_BASE = 1000 /* vendor-specific acquisition messages start here */ |
Jim Miller | 953524b | 2014-06-16 17:59:40 -0700 | [diff] [blame] | 73 | } fingerprint_acquired_info_t; |
Sasha Levitskiy | ba45e05 | 2014-06-09 13:19:52 -0700 | [diff] [blame] | 74 | |
Sasha Levitskiy | 3b7402e | 2014-12-11 06:49:36 -0800 | [diff] [blame] | 75 | typedef struct fingerprint_finger_id { |
| 76 | uint32_t gid; |
| 77 | uint32_t fid; |
| 78 | } fingerprint_finger_id_t; |
| 79 | |
Sasha Levitskiy | 7308284 | 2014-04-18 11:14:11 -0700 | [diff] [blame] | 80 | typedef struct fingerprint_enroll { |
Sasha Levitskiy | 3b7402e | 2014-12-11 06:49:36 -0800 | [diff] [blame] | 81 | fingerprint_finger_id_t finger; |
Sasha Levitskiy | 3b9ee8d | 2014-04-23 10:04:57 -0700 | [diff] [blame] | 82 | /* samples_remaining goes from N (no data collected, but N scans needed) |
Sasha Levitskiy | 3b7402e | 2014-12-11 06:49:36 -0800 | [diff] [blame] | 83 | * to 0 (no more data is needed to build a template). */ |
Jim Miller | 1fb1e33 | 2015-03-24 19:25:47 -0700 | [diff] [blame] | 84 | uint32_t samples_remaining; |
Sasha Levitskiy | a70ab95 | 2015-06-02 11:29:12 -0700 | [diff] [blame] | 85 | uint64_t msg; /* Vendor specific message. Used for user guidance */ |
Sasha Levitskiy | 7308284 | 2014-04-18 11:14:11 -0700 | [diff] [blame] | 86 | } fingerprint_enroll_t; |
| 87 | |
Sasha Levitskiy | c7ffe16 | 2015-10-28 13:58:44 -0700 | [diff] [blame] | 88 | typedef struct fingerprint_enumerated { |
| 89 | fingerprint_finger_id_t finger; |
| 90 | uint32_t remaining_templates; |
| 91 | } fingerprint_enumerated_t; |
| 92 | |
Sasha Levitskiy | 0d1cd3f | 2014-04-30 13:29:43 -0700 | [diff] [blame] | 93 | typedef struct fingerprint_removed { |
Sasha Levitskiy | 3b7402e | 2014-12-11 06:49:36 -0800 | [diff] [blame] | 94 | fingerprint_finger_id_t finger; |
Sasha Levitskiy | 0d1cd3f | 2014-04-30 13:29:43 -0700 | [diff] [blame] | 95 | } fingerprint_removed_t; |
| 96 | |
Sasha Levitskiy | ba45e05 | 2014-06-09 13:19:52 -0700 | [diff] [blame] | 97 | typedef struct fingerprint_acquired { |
Jim Miller | 953524b | 2014-06-16 17:59:40 -0700 | [diff] [blame] | 98 | fingerprint_acquired_info_t acquired_info; /* information about the image */ |
Sasha Levitskiy | ba45e05 | 2014-06-09 13:19:52 -0700 | [diff] [blame] | 99 | } fingerprint_acquired_t; |
| 100 | |
Sasha Levitskiy | 3b7402e | 2014-12-11 06:49:36 -0800 | [diff] [blame] | 101 | typedef struct fingerprint_authenticated { |
Sasha Levitskiy | 6eced70 | 2015-04-12 22:58:21 -0700 | [diff] [blame] | 102 | fingerprint_finger_id_t finger; |
| 103 | hw_auth_token_t hat; |
Sasha Levitskiy | 3b7402e | 2014-12-11 06:49:36 -0800 | [diff] [blame] | 104 | } fingerprint_authenticated_t; |
| 105 | |
Sasha Levitskiy | 7308284 | 2014-04-18 11:14:11 -0700 | [diff] [blame] | 106 | typedef struct fingerprint_msg { |
| 107 | fingerprint_msg_type_t type; |
| 108 | union { |
Sasha Levitskiy | 7308284 | 2014-04-18 11:14:11 -0700 | [diff] [blame] | 109 | fingerprint_error_t error; |
| 110 | fingerprint_enroll_t enroll; |
Sasha Levitskiy | c7ffe16 | 2015-10-28 13:58:44 -0700 | [diff] [blame] | 111 | fingerprint_enumerated_t enumerated; |
Sasha Levitskiy | 0d1cd3f | 2014-04-30 13:29:43 -0700 | [diff] [blame] | 112 | fingerprint_removed_t removed; |
Sasha Levitskiy | ba45e05 | 2014-06-09 13:19:52 -0700 | [diff] [blame] | 113 | fingerprint_acquired_t acquired; |
Sasha Levitskiy | 3b7402e | 2014-12-11 06:49:36 -0800 | [diff] [blame] | 114 | fingerprint_authenticated_t authenticated; |
Sasha Levitskiy | 7308284 | 2014-04-18 11:14:11 -0700 | [diff] [blame] | 115 | } data; |
| 116 | } fingerprint_msg_t; |
| 117 | |
| 118 | /* Callback function type */ |
Sasha Levitskiy | d4331fd | 2015-06-08 13:14:15 -0700 | [diff] [blame] | 119 | typedef void (*fingerprint_notify_t)(const fingerprint_msg_t *msg); |
Sasha Levitskiy | 7308284 | 2014-04-18 11:14:11 -0700 | [diff] [blame] | 120 | |
Sasha Levitskiy | a747c06 | 2014-03-24 16:14:42 -0700 | [diff] [blame] | 121 | /* Synchronous operation */ |
| 122 | typedef struct fingerprint_device { |
Stewart Miles | 84d3549 | 2014-05-01 09:03:27 -0700 | [diff] [blame] | 123 | /** |
Sasha Levitskiy | ba45e05 | 2014-06-09 13:19:52 -0700 | [diff] [blame] | 124 | * Common methods of the fingerprint device. This *must* be the first member |
| 125 | * of fingerprint_device as users of this structure will cast a hw_device_t |
| 126 | * to fingerprint_device pointer in contexts where it's known |
| 127 | * the hw_device_t references a fingerprint_device. |
Stewart Miles | 84d3549 | 2014-05-01 09:03:27 -0700 | [diff] [blame] | 128 | */ |
Sasha Levitskiy | a747c06 | 2014-03-24 16:14:42 -0700 | [diff] [blame] | 129 | struct hw_device_t common; |
| 130 | |
| 131 | /* |
Sasha Levitskiy | a36ffbe | 2015-06-24 16:32:43 -0700 | [diff] [blame] | 132 | * Client provided callback function to receive notifications. |
| 133 | * Do not set by hand, use the function above instead. |
Sasha Levitskiy | a747c06 | 2014-03-24 16:14:42 -0700 | [diff] [blame] | 134 | */ |
Sasha Levitskiy | a36ffbe | 2015-06-24 16:32:43 -0700 | [diff] [blame] | 135 | fingerprint_notify_t notify; |
| 136 | |
| 137 | /* |
| 138 | * Set notification callback: |
| 139 | * Registers a user function that would receive notifications from the HAL |
| 140 | * The call will block if the HAL state machine is in busy state until HAL |
| 141 | * leaves the busy state. |
| 142 | * |
| 143 | * Function return: 0 if callback function is successfuly registered |
| 144 | * or a negative number in case of error, generally from the errno.h set. |
| 145 | */ |
| 146 | int (*set_notify)(struct fingerprint_device *dev, fingerprint_notify_t notify); |
Sasha Levitskiy | a747c06 | 2014-03-24 16:14:42 -0700 | [diff] [blame] | 147 | |
| 148 | /* |
Jim Miller | 1e1f7ba | 2015-04-08 22:55:51 -0700 | [diff] [blame] | 149 | * Fingerprint pre-enroll enroll request: |
| 150 | * Generates a unique token to upper layers to indicate the start of an enrollment transaction. |
| 151 | * This token will be wrapped by security for verification and passed to enroll() for |
| 152 | * verification before enrollment will be allowed. This is to ensure adding a new fingerprint |
| 153 | * template was preceded by some kind of credential confirmation (e.g. device password). |
| 154 | * |
| 155 | * Function return: 0 if function failed |
| 156 | * otherwise, a uint64_t of token |
| 157 | */ |
| 158 | uint64_t (*pre_enroll)(struct fingerprint_device *dev); |
| 159 | |
| 160 | /* |
Sasha Levitskiy | a36ffbe | 2015-06-24 16:32:43 -0700 | [diff] [blame] | 161 | * Fingerprint enroll request: |
| 162 | * Switches the HAL state machine to collect and store a new fingerprint |
| 163 | * template. Switches back as soon as enroll is complete |
| 164 | * (fingerprint_msg.type == FINGERPRINT_TEMPLATE_ENROLLING && |
| 165 | * fingerprint_msg.data.enroll.samples_remaining == 0) |
| 166 | * or after timeout_sec seconds. |
| 167 | * The fingerprint template will be assigned to the group gid. User has a choice |
| 168 | * to supply the gid or set it to 0 in which case a unique group id will be generated. |
| 169 | * |
| 170 | * Function return: 0 if enrollment process can be successfully started |
| 171 | * or a negative number in case of error, generally from the errno.h set. |
| 172 | * A notify() function may be called indicating the error condition. |
| 173 | */ |
| 174 | int (*enroll)(struct fingerprint_device *dev, const hw_auth_token_t *hat, |
| 175 | uint32_t gid, uint32_t timeout_sec); |
| 176 | |
| 177 | /* |
| 178 | * Finishes the enroll operation and invalidates the pre_enroll() generated challenge. |
| 179 | * This will be called at the end of a multi-finger enrollment session to indicate |
| 180 | * that no more fingers will be added. |
| 181 | * |
| 182 | * Function return: 0 if the request is accepted |
| 183 | * or a negative number in case of error, generally from the errno.h set. |
| 184 | */ |
| 185 | int (*post_enroll)(struct fingerprint_device *dev); |
| 186 | |
| 187 | /* |
Sasha Levitskiy | 468b567 | 2015-04-16 14:45:04 -0700 | [diff] [blame] | 188 | * get_authenticator_id: |
| 189 | * Returns a token associated with the current fingerprint set. This value will |
| 190 | * change whenever a new fingerprint is enrolled, thus creating a new fingerprint |
| 191 | * set. |
| 192 | * |
Sasha Levitskiy | a36ffbe | 2015-06-24 16:32:43 -0700 | [diff] [blame] | 193 | * Function return: current authenticator id or 0 if function failed. |
Sasha Levitskiy | 468b567 | 2015-04-16 14:45:04 -0700 | [diff] [blame] | 194 | */ |
| 195 | uint64_t (*get_authenticator_id)(struct fingerprint_device *dev); |
| 196 | |
| 197 | /* |
Jim Miller | 1e1f7ba | 2015-04-08 22:55:51 -0700 | [diff] [blame] | 198 | * Cancel pending enroll or authenticate, sending FINGERPRINT_ERROR_CANCELED |
| 199 | * to all running clients. Switches the HAL state machine back to the idle state. |
Sasha Levitskiy | a36ffbe | 2015-06-24 16:32:43 -0700 | [diff] [blame] | 200 | * Unlike enroll_done() doesn't invalidate the pre_enroll() challenge. |
Sasha Levitskiy | 969466c | 2014-05-07 09:07:11 -0700 | [diff] [blame] | 201 | * |
| 202 | * Function return: 0 if cancel request is accepted |
Sasha Levitskiy | a36ffbe | 2015-06-24 16:32:43 -0700 | [diff] [blame] | 203 | * or a negative number in case of error, generally from the errno.h set. |
Sasha Levitskiy | 969466c | 2014-05-07 09:07:11 -0700 | [diff] [blame] | 204 | */ |
Jim Miller | 1e1f7ba | 2015-04-08 22:55:51 -0700 | [diff] [blame] | 205 | int (*cancel)(struct fingerprint_device *dev); |
Sasha Levitskiy | 969466c | 2014-05-07 09:07:11 -0700 | [diff] [blame] | 206 | |
| 207 | /* |
Sasha Levitskiy | e0a2988 | 2015-04-28 15:49:05 -0700 | [diff] [blame] | 208 | * Enumerate all the fingerprint templates found in the directory set by |
| 209 | * set_active_group() |
Sasha Levitskiy | c7ffe16 | 2015-10-28 13:58:44 -0700 | [diff] [blame] | 210 | * For each template found notify() will be called with: |
| 211 | * fingerprint_msg.type == FINGERPRINT_TEMPLATE_ENUMERATED |
| 212 | * fingerprint_msg.data.enumerated.finger indicating a template id |
| 213 | * fingerprint_msg.data.enumerated.remaining_templates indicating how many more |
| 214 | * enumeration messages to expect. |
Sasha Levitskiy | e0a2988 | 2015-04-28 15:49:05 -0700 | [diff] [blame] | 215 | * |
Sasha Levitskiy | c7ffe16 | 2015-10-28 13:58:44 -0700 | [diff] [blame] | 216 | * Function return: 0 if enumerate request is accepted |
Sasha Levitskiy | a36ffbe | 2015-06-24 16:32:43 -0700 | [diff] [blame] | 217 | * or a negative number in case of error, generally from the errno.h set. |
Sasha Levitskiy | e0a2988 | 2015-04-28 15:49:05 -0700 | [diff] [blame] | 218 | */ |
Sasha Levitskiy | c7ffe16 | 2015-10-28 13:58:44 -0700 | [diff] [blame] | 219 | int (*enumerate)(struct fingerprint_device *dev); |
Sasha Levitskiy | e0a2988 | 2015-04-28 15:49:05 -0700 | [diff] [blame] | 220 | |
| 221 | /* |
Sasha Levitskiy | 3b9ee8d | 2014-04-23 10:04:57 -0700 | [diff] [blame] | 222 | * Fingerprint remove request: |
Sasha Levitskiy | d4331fd | 2015-06-08 13:14:15 -0700 | [diff] [blame] | 223 | * Deletes a fingerprint template. |
Sasha Levitskiy | c7ffe16 | 2015-10-28 13:58:44 -0700 | [diff] [blame] | 224 | * Works only within the path set by set_active_group(). |
Sasha Levitskiy | d4331fd | 2015-06-08 13:14:15 -0700 | [diff] [blame] | 225 | * notify() will be called with details on the template deleted. |
Sasha Levitskiy | 0d1cd3f | 2014-04-30 13:29:43 -0700 | [diff] [blame] | 226 | * fingerprint_msg.type == FINGERPRINT_TEMPLATE_REMOVED and |
Sasha Levitskiy | c7ffe16 | 2015-10-28 13:58:44 -0700 | [diff] [blame] | 227 | * fingerprint_msg.data.removed.finger indicating the template id removed. |
Sasha Levitskiy | a747c06 | 2014-03-24 16:14:42 -0700 | [diff] [blame] | 228 | * |
Sasha Levitskiy | 0d1cd3f | 2014-04-30 13:29:43 -0700 | [diff] [blame] | 229 | * Function return: 0 if fingerprint template(s) can be successfully deleted |
Sasha Levitskiy | a36ffbe | 2015-06-24 16:32:43 -0700 | [diff] [blame] | 230 | * or a negative number in case of error, generally from the errno.h set. |
Sasha Levitskiy | a747c06 | 2014-03-24 16:14:42 -0700 | [diff] [blame] | 231 | */ |
Sasha Levitskiy | d4331fd | 2015-06-08 13:14:15 -0700 | [diff] [blame] | 232 | int (*remove)(struct fingerprint_device *dev, uint32_t gid, uint32_t fid); |
Sasha Levitskiy | 3b7402e | 2014-12-11 06:49:36 -0800 | [diff] [blame] | 233 | |
| 234 | /* |
| 235 | * Restricts the HAL operation to a set of fingerprints belonging to a |
Sasha Levitskiy | 7eb7235 | 2015-05-07 14:40:16 -0700 | [diff] [blame] | 236 | * group provided. |
| 237 | * The caller must provide a path to a storage location within the user's |
| 238 | * data directory. |
Sasha Levitskiy | 3b7402e | 2014-12-11 06:49:36 -0800 | [diff] [blame] | 239 | * |
| 240 | * Function return: 0 on success |
Sasha Levitskiy | a36ffbe | 2015-06-24 16:32:43 -0700 | [diff] [blame] | 241 | * or a negative number in case of error, generally from the errno.h set. |
Sasha Levitskiy | 3b7402e | 2014-12-11 06:49:36 -0800 | [diff] [blame] | 242 | */ |
Sasha Levitskiy | 7eb7235 | 2015-05-07 14:40:16 -0700 | [diff] [blame] | 243 | int (*set_active_group)(struct fingerprint_device *dev, uint32_t gid, |
| 244 | const char *store_path); |
Sasha Levitskiy | 3b7402e | 2014-12-11 06:49:36 -0800 | [diff] [blame] | 245 | |
| 246 | /* |
| 247 | * Authenticates an operation identifed by operation_id |
| 248 | * |
| 249 | * Function return: 0 on success |
Sasha Levitskiy | a36ffbe | 2015-06-24 16:32:43 -0700 | [diff] [blame] | 250 | * or a negative number in case of error, generally from the errno.h set. |
Sasha Levitskiy | 3b7402e | 2014-12-11 06:49:36 -0800 | [diff] [blame] | 251 | */ |
Jim Miller | 1fb1e33 | 2015-03-24 19:25:47 -0700 | [diff] [blame] | 252 | int (*authenticate)(struct fingerprint_device *dev, uint64_t operation_id, uint32_t gid); |
Sasha Levitskiy | a747c06 | 2014-03-24 16:14:42 -0700 | [diff] [blame] | 253 | |
Sasha Levitskiy | 7e9204a | 2016-01-07 14:46:45 -0800 | [diff] [blame] | 254 | /* |
| 255 | * Resets a lockout by providing a valid hardware authentication token. |
| 256 | * |
| 257 | * Function return: 0 on success |
| 258 | * or a negative number in case of error, generally from the errno.h set. |
| 259 | */ |
| 260 | int (*reset_lockout)(struct fingerprint_device *dev, const hw_auth_token_t *hat); |
| 261 | |
Sasha Levitskiy | a36ffbe | 2015-06-24 16:32:43 -0700 | [diff] [blame] | 262 | /* Reserved for backward binary compatibility */ |
Sasha Levitskiy | 7e9204a | 2016-01-07 14:46:45 -0800 | [diff] [blame] | 263 | void *reserved[3]; |
Sasha Levitskiy | a747c06 | 2014-03-24 16:14:42 -0700 | [diff] [blame] | 264 | } fingerprint_device_t; |
| 265 | |
| 266 | typedef struct fingerprint_module { |
Stewart Miles | 84d3549 | 2014-05-01 09:03:27 -0700 | [diff] [blame] | 267 | /** |
Sasha Levitskiy | ba45e05 | 2014-06-09 13:19:52 -0700 | [diff] [blame] | 268 | * Common methods of the fingerprint module. This *must* be the first member |
| 269 | * of fingerprint_module as users of this structure will cast a hw_module_t |
| 270 | * to fingerprint_module pointer in contexts where it's known |
| 271 | * the hw_module_t references a fingerprint_module. |
Stewart Miles | 84d3549 | 2014-05-01 09:03:27 -0700 | [diff] [blame] | 272 | */ |
Sasha Levitskiy | a747c06 | 2014-03-24 16:14:42 -0700 | [diff] [blame] | 273 | struct hw_module_t common; |
| 274 | } fingerprint_module_t; |
| 275 | |
Sasha Levitskiy | a747c06 | 2014-03-24 16:14:42 -0700 | [diff] [blame] | 276 | #endif /* ANDROID_INCLUDE_HARDWARE_FINGERPRINT_H */ |