blob: 372066d2d70f857e5a9997e4af232356c2d2e3b8 [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
Ilya Matyukhin3d54f452020-10-15 17:32:09 -070030ndk::ScopedAStatus Session::generateChallenge(int32_t /*cookie*/, int32_t /*timeoutSec*/) {
31 return ndk::ScopedAStatus::ok();
32}
33
34ndk::ScopedAStatus Session::revokeChallenge(int32_t /*cookie*/, int64_t /*challenge*/) {
35 return ndk::ScopedAStatus::ok();
36}
37
Ilya Matyukhina9a3c852020-08-18 03:09:41 -070038ndk::ScopedAStatus Session::enroll(int32_t /*cookie*/, const keymaster::HardwareAuthToken& /*hat*/,
Kevin Chyne33abd62020-09-18 10:31:50 -070039 std::shared_ptr<common::ICancellationSignal>* /*return_val*/) {
Ilya Matyukhina9a3c852020-08-18 03:09:41 -070040 return ndk::ScopedAStatus::ok();
41}
42
43ndk::ScopedAStatus Session::authenticate(int32_t /*cookie*/, int64_t /*keystoreOperationId*/,
Kevin Chyne33abd62020-09-18 10:31:50 -070044 std::shared_ptr<common::ICancellationSignal>* return_val) {
Ilya Matyukhina9a3c852020-08-18 03:09:41 -070045 if (cb_) {
46 cb_->onStateChanged(0, SessionState::AUTHENTICATING);
47 }
48 *return_val = SharedRefBase::make<CancellationSignal>();
49 return ndk::ScopedAStatus::ok();
50}
51
52ndk::ScopedAStatus Session::detectInteraction(
Kevin Chyne33abd62020-09-18 10:31:50 -070053 int32_t /*cookie*/, std::shared_ptr<common::ICancellationSignal>* /*return_val*/) {
Ilya Matyukhina9a3c852020-08-18 03:09:41 -070054 return ndk::ScopedAStatus::ok();
55}
56
57ndk::ScopedAStatus Session::enumerateEnrollments(int32_t /*cookie*/) {
58 return ndk::ScopedAStatus::ok();
59}
60
61ndk::ScopedAStatus Session::removeEnrollments(int32_t /*cookie*/,
62 const std::vector<int32_t>& /*enrollmentIds*/) {
63 return ndk::ScopedAStatus::ok();
64}
65
66ndk::ScopedAStatus Session::getAuthenticatorId(int32_t /*cookie*/) {
67 return ndk::ScopedAStatus::ok();
68}
69
Kevin Chyn6e862c32020-09-16 18:27:37 -070070ndk::ScopedAStatus Session::invalidateAuthenticatorId(int32_t /*cookie*/,
Ilya Matyukhin3d54f452020-10-15 17:32:09 -070071 const keymaster::HardwareAuthToken& /*hat*/) {
Kevin Chyn6e862c32020-09-16 18:27:37 -070072 return ndk::ScopedAStatus::ok();
73}
74
Ilya Matyukhina9a3c852020-08-18 03:09:41 -070075ndk::ScopedAStatus Session::resetLockout(int32_t /*cookie*/,
76 const keymaster::HardwareAuthToken& /*hat*/) {
77 return ndk::ScopedAStatus::ok();
78}
79
80ndk::ScopedAStatus Session::onPointerDown(int32_t /*pointerId*/, int32_t /*x*/, int32_t /*y*/,
81 float /*minor*/, float /*major*/) {
82 return ndk::ScopedAStatus::ok();
83}
84
85ndk::ScopedAStatus Session::onPointerUp(int32_t /*pointerId*/) {
86 return ndk::ScopedAStatus::ok();
87}
88
89ndk::ScopedAStatus Session::onUiReady() {
90 return ndk::ScopedAStatus::ok();
91}
Ilya Matyukhina9a3c852020-08-18 03:09:41 -070092} // namespace aidl::android::hardware::biometrics::fingerprint