am 1ee9d9a8: Merge "Fingerprint: Add HAL close() code" into mnc-dev

* commit '1ee9d9a8b36894b62394829c8c020e3ae5ad24c5':
  Fingerprint: Add HAL close() code
This commit is contained in:
Jim Miller 2015-07-13 22:29:59 +00:00 committed by Android Git Automerger
commit c2da0bd045
1 changed files with 16 additions and 1 deletions

View File

@ -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;
}