blob: 5eb3134ec16e141df5279e771db6526f1fa8d6ed [file] [log] [blame]
Ilya Matyukhina9a3c852020-08-18 03:09:41 -07001/*
2 * Copyright (C) 2020 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#include <aidl/android/hardware/biometrics/fingerprint/BnCancellationSignal.h>
18
19#include "Session.h"
20
21namespace aidl::android::hardware::biometrics::fingerprint {
22
23class CancellationSignal : public BnCancellationSignal {
24 public:
25 ndk::ScopedAStatus cancel() override { return ndk::ScopedAStatus::ok(); }
26};
27
28Session::Session(std::shared_ptr<ISessionCallback> cb) : cb_(std::move(cb)) {}
29
30ndk::ScopedAStatus Session::enroll(int32_t /*cookie*/, const keymaster::HardwareAuthToken& /*hat*/,
31 std::shared_ptr<ICancellationSignal>* /*return_val*/) {
32 return ndk::ScopedAStatus::ok();
33}
34
35ndk::ScopedAStatus Session::authenticate(int32_t /*cookie*/, int64_t /*keystoreOperationId*/,
36 std::shared_ptr<ICancellationSignal>* return_val) {
37 if (cb_) {
38 cb_->onStateChanged(0, SessionState::AUTHENTICATING);
39 }
40 *return_val = SharedRefBase::make<CancellationSignal>();
41 return ndk::ScopedAStatus::ok();
42}
43
44ndk::ScopedAStatus Session::detectInteraction(
45 int32_t /*cookie*/, std::shared_ptr<ICancellationSignal>* /*return_val*/) {
46 return ndk::ScopedAStatus::ok();
47}
48
49ndk::ScopedAStatus Session::enumerateEnrollments(int32_t /*cookie*/) {
50 return ndk::ScopedAStatus::ok();
51}
52
53ndk::ScopedAStatus Session::removeEnrollments(int32_t /*cookie*/,
54 const std::vector<int32_t>& /*enrollmentIds*/) {
55 return ndk::ScopedAStatus::ok();
56}
57
58ndk::ScopedAStatus Session::getAuthenticatorId(int32_t /*cookie*/) {
59 return ndk::ScopedAStatus::ok();
60}
61
62ndk::ScopedAStatus Session::resetLockout(int32_t /*cookie*/,
63 const keymaster::HardwareAuthToken& /*hat*/) {
64 return ndk::ScopedAStatus::ok();
65}
66
67ndk::ScopedAStatus Session::onPointerDown(int32_t /*pointerId*/, int32_t /*x*/, int32_t /*y*/,
68 float /*minor*/, float /*major*/) {
69 return ndk::ScopedAStatus::ok();
70}
71
72ndk::ScopedAStatus Session::onPointerUp(int32_t /*pointerId*/) {
73 return ndk::ScopedAStatus::ok();
74}
75
76ndk::ScopedAStatus Session::onUiReady() {
77 return ndk::ScopedAStatus::ok();
78}
79
80} // namespace aidl::android::hardware::biometrics::fingerprint