diff options
Diffstat (limited to 'fingerprintd')
-rw-r--r-- | fingerprintd/FingerprintDaemonProxy.cpp | 55 | ||||
-rw-r--r-- | fingerprintd/FingerprintDaemonProxy.h | 4 | ||||
-rw-r--r-- | fingerprintd/IFingerprintDaemon.h | 2 |
3 files changed, 29 insertions, 32 deletions
diff --git a/fingerprintd/FingerprintDaemonProxy.cpp b/fingerprintd/FingerprintDaemonProxy.cpp index a8a4024ea..a55f30a2d 100644 --- a/fingerprintd/FingerprintDaemonProxy.cpp +++ b/fingerprintd/FingerprintDaemonProxy.cpp | |||
@@ -41,7 +41,7 @@ FingerprintDaemonProxy::~FingerprintDaemonProxy() { | |||
41 | closeHal(); | 41 | closeHal(); |
42 | } | 42 | } |
43 | 43 | ||
44 | void FingerprintDaemonProxy::hal_notify_callback(fingerprint_msg_t msg) { | 44 | void FingerprintDaemonProxy::hal_notify_callback(const fingerprint_msg_t *msg) { |
45 | FingerprintDaemonProxy* instance = FingerprintDaemonProxy::getInstance(); | 45 | FingerprintDaemonProxy* instance = FingerprintDaemonProxy::getInstance(); |
46 | const sp<IFingerprintDaemonCallback> callback = instance->mCallback; | 46 | const sp<IFingerprintDaemonCallback> callback = instance->mCallback; |
47 | if (callback == NULL) { | 47 | if (callback == NULL) { |
@@ -49,52 +49,52 @@ void FingerprintDaemonProxy::hal_notify_callback(fingerprint_msg_t msg) { | |||
49 | return; | 49 | return; |
50 | } | 50 | } |
51 | const int64_t device = (int64_t) instance->mDevice; | 51 | const int64_t device = (int64_t) instance->mDevice; |
52 | switch (msg.type) { | 52 | switch (msg->type) { |
53 | case FINGERPRINT_ERROR: | 53 | case FINGERPRINT_ERROR: |
54 | ALOGD("onError(%d)", msg.data.error); | 54 | ALOGD("onError(%d)", msg->data.error); |
55 | callback->onError(device, msg.data.error); | 55 | callback->onError(device, msg->data.error); |
56 | break; | 56 | break; |
57 | case FINGERPRINT_ACQUIRED: | 57 | case FINGERPRINT_ACQUIRED: |
58 | ALOGD("onAcquired(%d)", msg.data.acquired.acquired_info); | 58 | ALOGD("onAcquired(%d)", msg->data.acquired.acquired_info); |
59 | callback->onAcquired(device, msg.data.acquired.acquired_info); | 59 | callback->onAcquired(device, msg->data.acquired.acquired_info); |
60 | break; | 60 | break; |
61 | case FINGERPRINT_AUTHENTICATED: | 61 | case FINGERPRINT_AUTHENTICATED: |
62 | ALOGD("onAuthenticated(fid=%d, gid=%d)", | 62 | ALOGD("onAuthenticated(fid=%d, gid=%d)", |
63 | msg.data.authenticated.finger.fid, | 63 | msg->data.authenticated.finger.fid, |
64 | msg.data.authenticated.finger.gid); | 64 | msg->data.authenticated.finger.gid); |
65 | if (msg.data.authenticated.finger.fid != 0) { | 65 | if (msg->data.authenticated.finger.fid != 0) { |
66 | uint8_t* hat = reinterpret_cast<uint8_t *>(&msg.data.authenticated.hat); | 66 | const uint8_t* hat = reinterpret_cast<const uint8_t *>(&msg->data.authenticated.hat); |
67 | instance->notifyKeystore(hat, sizeof(msg.data.authenticated.hat)); | 67 | instance->notifyKeystore(hat, sizeof(msg->data.authenticated.hat)); |
68 | } | 68 | } |
69 | callback->onAuthenticated(device, | 69 | callback->onAuthenticated(device, |
70 | msg.data.authenticated.finger.fid, | 70 | msg->data.authenticated.finger.fid, |
71 | msg.data.authenticated.finger.gid); | 71 | msg->data.authenticated.finger.gid); |
72 | break; | 72 | break; |
73 | case FINGERPRINT_TEMPLATE_ENROLLING: | 73 | case FINGERPRINT_TEMPLATE_ENROLLING: |
74 | ALOGD("onEnrollResult(fid=%d, gid=%d, rem=%d)", | 74 | ALOGD("onEnrollResult(fid=%d, gid=%d, rem=%d)", |
75 | msg.data.enroll.finger.fid, | 75 | msg->data.enroll.finger.fid, |
76 | msg.data.enroll.finger.gid, | 76 | msg->data.enroll.finger.gid, |
77 | msg.data.enroll.samples_remaining); | 77 | msg->data.enroll.samples_remaining); |
78 | callback->onEnrollResult(device, | 78 | callback->onEnrollResult(device, |
79 | msg.data.enroll.finger.fid, | 79 | msg->data.enroll.finger.fid, |
80 | msg.data.enroll.finger.gid, | 80 | msg->data.enroll.finger.gid, |
81 | msg.data.enroll.samples_remaining); | 81 | msg->data.enroll.samples_remaining); |
82 | break; | 82 | break; |
83 | case FINGERPRINT_TEMPLATE_REMOVED: | 83 | case FINGERPRINT_TEMPLATE_REMOVED: |
84 | ALOGD("onRemove(fid=%d, gid=%d)", | 84 | ALOGD("onRemove(fid=%d, gid=%d)", |
85 | msg.data.removed.finger.fid, | 85 | msg->data.removed.finger.fid, |
86 | msg.data.removed.finger.gid); | 86 | msg->data.removed.finger.gid); |
87 | callback->onRemoved(device, | 87 | callback->onRemoved(device, |
88 | msg.data.removed.finger.fid, | 88 | msg->data.removed.finger.fid, |
89 | msg.data.removed.finger.gid); | 89 | msg->data.removed.finger.gid); |
90 | break; | 90 | break; |
91 | default: | 91 | default: |
92 | ALOGE("invalid msg: %d", msg.type); | 92 | ALOGE("invalid msg type: %d", msg->type); |
93 | return; | 93 | return; |
94 | } | 94 | } |
95 | } | 95 | } |
96 | 96 | ||
97 | void FingerprintDaemonProxy::notifyKeystore(uint8_t *auth_token, size_t auth_token_length) { | 97 | void FingerprintDaemonProxy::notifyKeystore(const uint8_t *auth_token, const size_t auth_token_length) { |
98 | if (auth_token != NULL && auth_token_length > 0) { | 98 | if (auth_token != NULL && auth_token_length > 0) { |
99 | // TODO: cache service? | 99 | // TODO: cache service? |
100 | sp < IServiceManager > sm = defaultServiceManager(); | 100 | sp < IServiceManager > sm = defaultServiceManager(); |
@@ -151,10 +151,7 @@ int32_t FingerprintDaemonProxy::stopAuthentication() { | |||
151 | 151 | ||
152 | int32_t FingerprintDaemonProxy::remove(int32_t fingerId, int32_t groupId) { | 152 | int32_t FingerprintDaemonProxy::remove(int32_t fingerId, int32_t groupId) { |
153 | ALOG(LOG_VERBOSE, LOG_TAG, "remove(fid=%d, gid=%d)\n", fingerId, groupId); | 153 | ALOG(LOG_VERBOSE, LOG_TAG, "remove(fid=%d, gid=%d)\n", fingerId, groupId); |
154 | fingerprint_finger_id_t finger; | 154 | return mDevice->remove(mDevice, groupId, fingerId); |
155 | finger.fid = fingerId; | ||
156 | finger.gid = groupId; | ||
157 | return mDevice->remove(mDevice, finger); | ||
158 | } | 155 | } |
159 | 156 | ||
160 | uint64_t FingerprintDaemonProxy::getAuthenticatorId() { | 157 | uint64_t FingerprintDaemonProxy::getAuthenticatorId() { |
diff --git a/fingerprintd/FingerprintDaemonProxy.h b/fingerprintd/FingerprintDaemonProxy.h index 95c926bda..50d30efd1 100644 --- a/fingerprintd/FingerprintDaemonProxy.h +++ b/fingerprintd/FingerprintDaemonProxy.h | |||
@@ -48,8 +48,8 @@ class FingerprintDaemonProxy : public BnFingerprintDaemon { | |||
48 | FingerprintDaemonProxy(); | 48 | FingerprintDaemonProxy(); |
49 | virtual ~FingerprintDaemonProxy(); | 49 | virtual ~FingerprintDaemonProxy(); |
50 | void binderDied(const wp<IBinder>& who); | 50 | void binderDied(const wp<IBinder>& who); |
51 | void notifyKeystore(uint8_t *auth_token, size_t auth_token_length); | 51 | void notifyKeystore(const uint8_t *auth_token, const size_t auth_token_length); |
52 | static void hal_notify_callback(fingerprint_msg_t msg); | 52 | static void hal_notify_callback(const fingerprint_msg_t *msg); |
53 | 53 | ||
54 | static FingerprintDaemonProxy* sInstance; | 54 | static FingerprintDaemonProxy* sInstance; |
55 | fingerprint_module_t const* mModule; | 55 | fingerprint_module_t const* mModule; |
diff --git a/fingerprintd/IFingerprintDaemon.h b/fingerprintd/IFingerprintDaemon.h index fe3f64b93..08cb00857 100644 --- a/fingerprintd/IFingerprintDaemon.h +++ b/fingerprintd/IFingerprintDaemon.h | |||
@@ -65,7 +65,7 @@ class IFingerprintDaemon : public IInterface, public IBinder::DeathRecipient { | |||
65 | 65 | ||
66 | // DECLARE_META_INTERFACE - C++ client interface not needed | 66 | // DECLARE_META_INTERFACE - C++ client interface not needed |
67 | static const android::String16 descriptor; | 67 | static const android::String16 descriptor; |
68 | static void hal_notify_callback(fingerprint_msg_t msg); | 68 | static void hal_notify_callback(const fingerprint_msg_t *msg); |
69 | }; | 69 | }; |
70 | 70 | ||
71 | // ---------------------------------------------------------------------------- | 71 | // ---------------------------------------------------------------------------- |