summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSasha Levitskiy2015-07-10 16:24:30 -0500
committerSasha Levitskiy2015-07-10 18:26:32 -0500
commitdae483764fef7cc8a3c5b48ec5cd73cdbe477a17 (patch)
tree8df7301d833db4dbc0d97746185cb22fb4fb3ff3 /fingerprintd/FingerprintDaemonProxy.cpp
parent787c3764d305168e927c29d5d57ae68e242cd7a9 (diff)
downloadplatform-system-core-dae483764fef7cc8a3c5b48ec5cd73cdbe477a17.tar.gz
platform-system-core-dae483764fef7cc8a3c5b48ec5cd73cdbe477a17.tar.xz
platform-system-core-dae483764fef7cc8a3c5b48ec5cd73cdbe477a17.zip
Fingerprint: Add HAL close() code
Bug 22248856 Bug 22374372 Change-Id: I06a59bc7050a227307c857fc7db0985b84fd293a Signed-off-by: Sasha Levitskiy <sanek@google.com>
Diffstat (limited to 'fingerprintd/FingerprintDaemonProxy.cpp')
-rw-r--r--fingerprintd/FingerprintDaemonProxy.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/fingerprintd/FingerprintDaemonProxy.cpp b/fingerprintd/FingerprintDaemonProxy.cpp
index c310160af..beb95de73 100644
--- a/fingerprintd/FingerprintDaemonProxy.cpp
+++ b/fingerprintd/FingerprintDaemonProxy.cpp
@@ -225,11 +225,26 @@ int64_t FingerprintDaemonProxy::openHal() {
225} 225}
226 226
227int32_t FingerprintDaemonProxy::closeHal() { 227int32_t FingerprintDaemonProxy::closeHal() {
228 return -ENOSYS; // TODO 228 ALOG(LOG_VERBOSE, LOG_TAG, "nativeCloseHal()\n");
229 if (mDevice == NULL) {
230 ALOGE("No valid device");
231 return -ENOSYS;
232 }
233 int err;
234 if (0 != (err = mDevice->common.close(reinterpret_cast<hw_device_t*>(mDevice)))) {
235 ALOGE("Can't close fingerprint module, error: %d", err);
236 return err;
237 }
238 mDevice = NULL;
239 return 0;
229} 240}
230 241
231void FingerprintDaemonProxy::binderDied(const wp<IBinder>& who) { 242void FingerprintDaemonProxy::binderDied(const wp<IBinder>& who) {
232 ALOGD("binder died"); 243 ALOGD("binder died");
244 int err;
245 if (0 != (err = closeHal())) {
246 ALOGE("Can't close fingerprint device, error: %d", err);
247 }
233 if (IInterface::asBinder(mCallback) == who) { 248 if (IInterface::asBinder(mCallback) == who) {
234 mCallback = NULL; 249 mCallback = NULL;
235 } 250 }