diff options
author | Jim Miller <jaggies@google.com> | 2015-05-21 00:57:26 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-05-21 00:57:40 +0000 |
commit | 62de207fcd8b70c0ebf6b11d74330e10a456ac8a (patch) | |
tree | dbae2b8722871ae1eabf9ec336205c4f0a50dd26 /fingerprintd/FingerprintDaemonProxy.h | |
parent | 94a811ab19006ec6c4d8057f3bf81d79308d28f6 (diff) | |
parent | a34dc46c360d42d843f5fcba22d35862139bacee (diff) | |
download | system_core-62de207fcd8b70c0ebf6b11d74330e10a456ac8a.zip system_core-62de207fcd8b70c0ebf6b11d74330e10a456ac8a.tar.gz system_core-62de207fcd8b70c0ebf6b11d74330e10a456ac8a.tar.bz2 |
Merge "Move from native FingerprintService implementation to fingerprintd" into mnc-dev
Diffstat (limited to 'fingerprintd/FingerprintDaemonProxy.h')
-rw-r--r-- | fingerprintd/FingerprintDaemonProxy.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/fingerprintd/FingerprintDaemonProxy.h b/fingerprintd/FingerprintDaemonProxy.h new file mode 100644 index 0000000..95c926b --- /dev/null +++ b/fingerprintd/FingerprintDaemonProxy.h @@ -0,0 +1,62 @@ +/* + * 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. + */ + +#ifndef FINGERPRINT_DAEMON_PROXY_H_ +#define FINGERPRINT_DAEMON_PROXY_H_ + +#include "IFingerprintDaemon.h" +#include "IFingerprintDaemonCallback.h" + +namespace android { + +class FingerprintDaemonProxy : public BnFingerprintDaemon { + public: + static FingerprintDaemonProxy* getInstance() { + if (sInstance == NULL) { + sInstance = new FingerprintDaemonProxy(); + } + return sInstance; + } + + // These reflect binder methods. + virtual void init(const sp<IFingerprintDaemonCallback>& callback); + virtual int32_t enroll(const uint8_t* token, ssize_t tokenLength, int32_t groupId, int32_t timeout); + virtual uint64_t preEnroll(); + virtual int32_t stopEnrollment(); + virtual int32_t authenticate(uint64_t sessionId, uint32_t groupId); + virtual int32_t stopAuthentication(); + virtual int32_t remove(int32_t fingerId, int32_t groupId); + virtual uint64_t getAuthenticatorId(); + virtual int32_t setActiveGroup(int32_t groupId, const uint8_t* path, ssize_t pathLen); + virtual int64_t openHal(); + virtual int32_t closeHal(); + + private: + FingerprintDaemonProxy(); + virtual ~FingerprintDaemonProxy(); + void binderDied(const wp<IBinder>& who); + void notifyKeystore(uint8_t *auth_token, size_t auth_token_length); + static void hal_notify_callback(fingerprint_msg_t msg); + + static FingerprintDaemonProxy* sInstance; + fingerprint_module_t const* mModule; + fingerprint_device_t* mDevice; + sp<IFingerprintDaemonCallback> mCallback; +}; + +} // namespace android + +#endif // FINGERPRINT_DAEMON_PROXY_H_ |