blob: 4cc01f6d580acb9a75d8bbd23902cf43db7f0f64 [file] [log] [blame]
Steven Moreland9f8b5c72016-11-29 15:03:38 -08001/*
2 * Copyright (C) 2016 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 */
Steven Morelandd6e4f032016-11-28 18:37:07 -080016#ifndef ANDROID_HARDWARE_GATEKEEPER_V1_0_GATEKEEPER_H
17#define ANDROID_HARDWARE_GATEKEEPER_V1_0_GATEKEEPER_H
Alexey Polyudov586a32f2016-08-29 12:08:44 -070018
19#include <android/hardware/gatekeeper/1.0/IGatekeeper.h>
20#include <hidl/Status.h>
21
22#include <hidl/MQDescriptor.h>
23
24#include <hardware/hardware.h>
25#include <hardware/gatekeeper.h>
26
27namespace android {
28namespace hardware {
29namespace gatekeeper {
30namespace V1_0 {
31namespace implementation {
32
33using ::android::hardware::gatekeeper::V1_0::GatekeeperResponse;
34using ::android::hardware::gatekeeper::V1_0::IGatekeeper;
35using ::android::hardware::Return;
36using ::android::hardware::Void;
37using ::android::hardware::hidl_vec;
38using ::android::hardware::hidl_string;
39using ::android::sp;
40
41class Gatekeeper : public IGatekeeper {
42public:
43 Gatekeeper();
44 ~Gatekeeper();
45
46 // Methods from ::android::hardware::gatekeeper::V1_0::IGatekeeper follow.
47 Return<void> enroll(uint32_t uid,
48 const hidl_vec<uint8_t>& currentPasswordHandle,
49 const hidl_vec<uint8_t>& currentPassword,
50 const hidl_vec<uint8_t>& desiredPassword,
51 enroll_cb _hidl_cb) override;
52 Return<void> verify(uint32_t uid,
53 uint64_t challenge,
54 const hidl_vec<uint8_t>& enrolledPasswordHandle,
55 const hidl_vec<uint8_t>& providedPassword,
56 verify_cb _hidl_cb) override;
57 Return<void> deleteUser(uint32_t uid, deleteUser_cb _hidl_cb) override;
58 Return<void> deleteAllUsers(deleteAllUsers_cb _hidl_cb) override;
59private:
60 gatekeeper_device_t *device;
61 const hw_module_t *module;
62};
63
64extern "C" IGatekeeper* HIDL_FETCH_IGatekeeper(const char* name);
65
66} // namespace implementation
67} // namespace V1_0
68} // namespace gatekeeper
69} // namespace hardware
70} // namespace android
71
Steven Morelandd6e4f032016-11-28 18:37:07 -080072#endif // ANDROID_HARDWARE_GATEKEEPER_V1_0_GATEKEEPER_H