diff options
author | Jim Miller <jaggies@google.com> | 2015-05-07 18:52:53 -0700 |
---|---|---|
committer | Jim Miller <jaggies@google.com> | 2015-05-20 14:55:31 -0700 |
commit | a34dc46c360d42d843f5fcba22d35862139bacee (patch) | |
tree | 036a1ecc625111a436b31f3d5b0004a81e7da739 /fingerprintd/IFingerprintDaemonCallback.cpp | |
parent | 7eb3abdb3ba500d3acca82b95705f34128251015 (diff) | |
download | system_core-a34dc46c360d42d843f5fcba22d35862139bacee.zip system_core-a34dc46c360d42d843f5fcba22d35862139bacee.tar.gz system_core-a34dc46c360d42d843f5fcba22d35862139bacee.tar.bz2 |
Move from native FingerprintService implementation to fingerprintd
This adds a new service, fingerprintd, that manages fingerprint
hardware from a separate process. It provides a binder interface that
FingerprintManager uses to talk to the fingerprint HAL.
Change-Id: I64b92589f4d75743ebe96894f07bec515945c61e
Diffstat (limited to 'fingerprintd/IFingerprintDaemonCallback.cpp')
-rw-r--r-- | fingerprintd/IFingerprintDaemonCallback.cpp | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/fingerprintd/IFingerprintDaemonCallback.cpp b/fingerprintd/IFingerprintDaemonCallback.cpp new file mode 100644 index 0000000..44d8020 --- /dev/null +++ b/fingerprintd/IFingerprintDaemonCallback.cpp @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2015 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#define LOG_TAG "IFingerprintDaemonCallback" +#include <stdint.h> +#include <sys/types.h> +#include <utils/Log.h> +#include <binder/Parcel.h> + +#include "IFingerprintDaemonCallback.h" + +namespace android { + +class BpFingerprintDaemonCallback : public BpInterface<IFingerprintDaemonCallback> +{ +public: + BpFingerprintDaemonCallback(const sp<IBinder>& impl) : + BpInterface<IFingerprintDaemonCallback>(impl) { + } + virtual status_t onEnrollResult(int64_t devId, int32_t fpId, int32_t gpId, int32_t rem) { + Parcel data, reply; + data.writeInterfaceToken(IFingerprintDaemonCallback::getInterfaceDescriptor()); + data.writeInt64(devId); + data.writeInt32(fpId); + data.writeInt32(gpId); + data.writeInt32(rem); + return remote()->transact(ON_ENROLL_RESULT, data, &reply, IBinder::FLAG_ONEWAY); + } + + virtual status_t onAcquired(int64_t devId, int32_t acquiredInfo) { + Parcel data, reply; + data.writeInterfaceToken(IFingerprintDaemonCallback::getInterfaceDescriptor()); + data.writeInt64(devId); + data.writeInt32(acquiredInfo); + return remote()->transact(ON_ACQUIRED, data, &reply, IBinder::FLAG_ONEWAY); + } + + virtual status_t onAuthenticated(int64_t devId, int32_t fpId, int32_t gpId) { + Parcel data, reply; + data.writeInterfaceToken(IFingerprintDaemonCallback::getInterfaceDescriptor()); + data.writeInt64(devId); + data.writeInt32(fpId); + data.writeInt32(gpId); + return remote()->transact(ON_AUTHENTICATED, data, &reply, IBinder::FLAG_ONEWAY); + } + + virtual status_t onError(int64_t devId, int32_t error) { + Parcel data, reply; + data.writeInterfaceToken(IFingerprintDaemonCallback::getInterfaceDescriptor()); + data.writeInt64(devId); + data.writeInt32(error); + return remote()->transact(ON_ERROR, data, &reply, IBinder::FLAG_ONEWAY); + } + + virtual status_t onRemoved(int64_t devId, int32_t fpId, int32_t gpId) { + Parcel data, reply; + data.writeInterfaceToken(IFingerprintDaemonCallback::getInterfaceDescriptor()); + data.writeInt64(devId); + data.writeInt32(fpId); + data.writeInt32(gpId); + return remote()->transact(ON_REMOVED, data, &reply, IBinder::FLAG_ONEWAY); + } + + virtual status_t onEnumerate(int64_t devId, const int32_t* fpIds, const int32_t* gpIds, + int32_t sz) { + Parcel data, reply; + data.writeInterfaceToken(IFingerprintDaemonCallback::getInterfaceDescriptor()); + data.writeInt64(devId); + data.writeInt32Array(sz, fpIds); + data.writeInt32Array(sz, gpIds); + return remote()->transact(ON_ENUMERATE, data, &reply, IBinder::FLAG_ONEWAY); + } +}; + +IMPLEMENT_META_INTERFACE(FingerprintDaemonCallback, + "android.hardware.fingerprint.IFingerprintDaemonCallback"); + +}; // namespace android |