blob: c2934a8bd7572532b262684890fdbdc56a994f0f [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
Kevin Chyne33abd62020-09-18 10:31:50 -070017#include <aidl/android/hardware/biometrics/common/BnCancellationSignal.h>
Ilya Matyukhina9a3c852020-08-18 03:09:41 -070018
19#include "Session.h"
20
21namespace aidl::android::hardware::biometrics::fingerprint {
22
Kevin Chyne33abd62020-09-18 10:31:50 -070023class CancellationSignal : public common::BnCancellationSignal {
Ilya Matyukhina9a3c852020-08-18 03:09:41 -070024 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*/,
Kevin Chyne33abd62020-09-18 10:31:50 -070031 std::shared_ptr<common::ICancellationSignal>* /*return_val*/) {
Ilya Matyukhina9a3c852020-08-18 03:09:41 -070032 return ndk::ScopedAStatus::ok();
33}
34
35ndk::ScopedAStatus Session::authenticate(int32_t /*cookie*/, int64_t /*keystoreOperationId*/,
Kevin Chyne33abd62020-09-18 10:31:50 -070036 std::shared_ptr<common::ICancellationSignal>* return_val) {
Ilya Matyukhina9a3c852020-08-18 03:09:41 -070037 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(
Kevin Chyne33abd62020-09-18 10:31:50 -070045 int32_t /*cookie*/, std::shared_ptr<common::ICancellationSignal>* /*return_val*/) {
Ilya Matyukhina9a3c852020-08-18 03:09:41 -070046 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
Kevin Chyn6e862c32020-09-16 18:27:37 -070062ndk::ScopedAStatus Session::invalidateAuthenticatorId(int32_t /*cookie*/,
63 const keymaster::HardwareAuthToken& /*hat*/) {
64 return ndk::ScopedAStatus::ok();
65}
66
Ilya Matyukhina9a3c852020-08-18 03:09:41 -070067ndk::ScopedAStatus Session::resetLockout(int32_t /*cookie*/,
68 const keymaster::HardwareAuthToken& /*hat*/) {
69 return ndk::ScopedAStatus::ok();
70}
71
72ndk::ScopedAStatus Session::onPointerDown(int32_t /*pointerId*/, int32_t /*x*/, int32_t /*y*/,
73 float /*minor*/, float /*major*/) {
74 return ndk::ScopedAStatus::ok();
75}
76
77ndk::ScopedAStatus Session::onPointerUp(int32_t /*pointerId*/) {
78 return ndk::ScopedAStatus::ok();
79}
80
81ndk::ScopedAStatus Session::onUiReady() {
82 return ndk::ScopedAStatus::ok();
83}
84
85} // namespace aidl::android::hardware::biometrics::fingerprint