diff options
author | Lukas0610 <mail@lukasberger.at> | 2018-03-07 13:04:55 +0100 |
---|---|---|
committer | Christian Abegg <christian.abegg@gmail.com> | 2018-03-23 01:16:15 +0100 |
commit | 89e134e4f51e6c324d581514adf253dd1b171dcc (patch) | |
tree | 0745d0452a0ac8bd52f81be9e296cdc0184525a9 | |
parent | faa60168cb4ac9d7b3be69d31f143b8eacd7ef71 (diff) | |
download | android_hardware_samsung-89e134e4f51e6c324d581514adf253dd1b171dcc.tar.gz android_hardware_samsung-89e134e4f51e6c324d581514adf253dd1b171dcc.tar.bz2 android_hardware_samsung-89e134e4f51e6c324d581514adf253dd1b171dcc.zip |
fingerprint: send cancel-message to system
Android expects a FINGERPRINT_ERROR_CANCELED error-message if a
fingerprint authentication-requested was cancelled.
As bauth doesn't deliver such a message on its own, we use the
already notify-wrapper to send a message to Android if the
authentication was cancelled by bauth to allow a proper operation
of the fingerprint-service.
Some devices (hero, hero2) with the fingerprint scanner embedded in
the home button need this for the "config_fingerprintWakeAndUnlock"
option to work reliably.
Change-Id: Id5ec866a7608885925687a1927e0e6085e9b6cff
Ref: BUGBASH-1422
-rw-r--r-- | fingerprint/bauth/fingerprint.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/fingerprint/bauth/fingerprint.c b/fingerprint/bauth/fingerprint.c index 6e5ed90..9072a5d 100644 --- a/fingerprint/bauth/fingerprint.c +++ b/fingerprint/bauth/fingerprint.c @@ -19,6 +19,7 @@ #include <dlfcn.h> #include <stdlib.h> #include <errno.h> +#include <string.h> #include <cutils/log.h> @@ -122,7 +123,19 @@ static uint64_t fingerprint_get_auth_id(struct fingerprint_device __unused *dev) static int fingerprint_cancel(struct fingerprint_device __unused *dev) { - return bauth_handle->ss_fingerprint_cancel(); + fingerprint_msg_t *cancel_msg; + int ret = 0; + + ret = bauth_handle->ss_fingerprint_cancel(); + + cancel_msg = (fingerprint_msg_t *)malloc(sizeof(fingerprint_msg_t)); + memset(cancel_msg, 0, sizeof(fingerprint_msg_t)); + + cancel_msg->type = FINGERPRINT_ERROR; + cancel_msg->data.error = FINGERPRINT_ERROR_CANCELED; + + original_notify(cancel_msg); + return ret; } static int fingerprint_remove(struct fingerprint_device __unused *dev, uint32_t gid, uint32_t fid) |