diff options
author | Jim Miller <jaggies@google.com> | 2015-07-10 23:42:08 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-07-10 23:42:13 +0000 |
commit | 1ee9d9a8b36894b62394829c8c020e3ae5ad24c5 (patch) | |
tree | d3f609f719b57eae00923d1a7cc1f77f633eeaf8 | |
parent | 8703bea1807326fef9835bc474e7a7288c725925 (diff) | |
parent | dae483764fef7cc8a3c5b48ec5cd73cdbe477a17 (diff) | |
download | system_core-1ee9d9a8b36894b62394829c8c020e3ae5ad24c5.zip system_core-1ee9d9a8b36894b62394829c8c020e3ae5ad24c5.tar.gz system_core-1ee9d9a8b36894b62394829c8c020e3ae5ad24c5.tar.bz2 |
Merge "Fingerprint: Add HAL close() code" into mnc-dev
-rw-r--r-- | fingerprintd/FingerprintDaemonProxy.cpp | 17 |
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; } |