Fingerprint: Add HAL close() code

Bug 22248856
Bug 22374372

Change-Id: I06a59bc7050a227307c857fc7db0985b84fd293a
Signed-off-by: Sasha Levitskiy <sanek@google.com>
This commit is contained in:
Sasha Levitskiy 2015-07-10 14:24:30 -07:00
parent 787c3764d3
commit dae483764f

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