summaryrefslogtreecommitdiffstats
path: root/fingerprintd
diff options
context:
space:
mode:
authorSasha Levitskiy <sanek@google.com>2015-07-10 14:24:30 -0700
committerSasha Levitskiy <sanek@google.com>2015-07-10 16:26:32 -0700
commitdae483764fef7cc8a3c5b48ec5cd73cdbe477a17 (patch)
tree8df7301d833db4dbc0d97746185cb22fb4fb3ff3 /fingerprintd
parent787c3764d305168e927c29d5d57ae68e242cd7a9 (diff)
downloadsystem_core-dae483764fef7cc8a3c5b48ec5cd73cdbe477a17.zip
system_core-dae483764fef7cc8a3c5b48ec5cd73cdbe477a17.tar.gz
system_core-dae483764fef7cc8a3c5b48ec5cd73cdbe477a17.tar.bz2
Fingerprint: Add HAL close() code
Bug 22248856 Bug 22374372 Change-Id: I06a59bc7050a227307c857fc7db0985b84fd293a Signed-off-by: Sasha Levitskiy <sanek@google.com>
Diffstat (limited to 'fingerprintd')
-rw-r--r--fingerprintd/FingerprintDaemonProxy.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/fingerprintd/FingerprintDaemonProxy.cpp b/fingerprintd/FingerprintDaemonProxy.cpp
index c310160..beb95de 100644
--- a/fingerprintd/FingerprintDaemonProxy.cpp
+++ b/fingerprintd/FingerprintDaemonProxy.cpp
@@ -225,11 +225,26 @@ int64_t FingerprintDaemonProxy::openHal() {
}
int32_t FingerprintDaemonProxy::closeHal() {
- return -ENOSYS; // TODO
+ ALOG(LOG_VERBOSE, LOG_TAG, "nativeCloseHal()\n");
+ if (mDevice == NULL) {
+ ALOGE("No valid device");
+ return -ENOSYS;
+ }
+ int err;
+ if (0 != (err = mDevice->common.close(reinterpret_cast<hw_device_t*>(mDevice)))) {
+ ALOGE("Can't close fingerprint module, error: %d", err);
+ return err;
+ }
+ mDevice = NULL;
+ return 0;
}
void FingerprintDaemonProxy::binderDied(const wp<IBinder>& who) {
ALOGD("binder died");
+ int err;
+ if (0 != (err = closeHal())) {
+ ALOGE("Can't close fingerprint device, error: %d", err);
+ }
if (IInterface::asBinder(mCallback) == who) {
mCallback = NULL;
}