blob: 50d30efd156240eda71cd8937fe3282b0ff2a89f [file] [log] [blame]
Jim Millera34dc462015-05-07 18:52:53 -07001/*
2 * Copyright (C) 2015 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef FINGERPRINT_DAEMON_PROXY_H_
18#define FINGERPRINT_DAEMON_PROXY_H_
19
20#include "IFingerprintDaemon.h"
21#include "IFingerprintDaemonCallback.h"
22
23namespace android {
24
25class FingerprintDaemonProxy : public BnFingerprintDaemon {
26 public:
27 static FingerprintDaemonProxy* getInstance() {
28 if (sInstance == NULL) {
29 sInstance = new FingerprintDaemonProxy();
30 }
31 return sInstance;
32 }
33
34 // These reflect binder methods.
35 virtual void init(const sp<IFingerprintDaemonCallback>& callback);
36 virtual int32_t enroll(const uint8_t* token, ssize_t tokenLength, int32_t groupId, int32_t timeout);
37 virtual uint64_t preEnroll();
38 virtual int32_t stopEnrollment();
39 virtual int32_t authenticate(uint64_t sessionId, uint32_t groupId);
40 virtual int32_t stopAuthentication();
41 virtual int32_t remove(int32_t fingerId, int32_t groupId);
42 virtual uint64_t getAuthenticatorId();
43 virtual int32_t setActiveGroup(int32_t groupId, const uint8_t* path, ssize_t pathLen);
44 virtual int64_t openHal();
45 virtual int32_t closeHal();
46
47 private:
48 FingerprintDaemonProxy();
49 virtual ~FingerprintDaemonProxy();
50 void binderDied(const wp<IBinder>& who);
Sasha Levitskiy53afac02015-06-09 16:47:09 -070051 void notifyKeystore(const uint8_t *auth_token, const size_t auth_token_length);
52 static void hal_notify_callback(const fingerprint_msg_t *msg);
Jim Millera34dc462015-05-07 18:52:53 -070053
54 static FingerprintDaemonProxy* sInstance;
55 fingerprint_module_t const* mModule;
56 fingerprint_device_t* mDevice;
57 sp<IFingerprintDaemonCallback> mCallback;
58};
59
60} // namespace android
61
62#endif // FINGERPRINT_DAEMON_PROXY_H_