blob: 2b1d4a7637b66f1dc52fc133afa2f3c40812402b [file] [log] [blame]
Ilya Matyukhin09166982020-10-12 13:41:03 -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/common/BnCancellationSignal.h>
18
19#include "Session.h"
20
21namespace aidl::android::hardware::biometrics::face {
22
23class CancellationSignal : public common::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
Ilya Matyukhine5034812020-10-15 21:45:56 -070030ndk::ScopedAStatus Session::generateChallenge(int32_t /*cookie*/, int32_t /*timeoutSec*/) {
Ilya Matyukhin09166982020-10-12 13:41:03 -070031 return ndk::ScopedAStatus::ok();
32}
33
Ilya Matyukhine5034812020-10-15 21:45:56 -070034ndk::ScopedAStatus Session::revokeChallenge(int32_t /*cookie*/, int64_t /*challenge*/) {
Ilya Matyukhin09166982020-10-12 13:41:03 -070035 return ndk::ScopedAStatus::ok();
36}
37
38ndk::ScopedAStatus Session::enroll(int32_t /*cookie*/, const keymaster::HardwareAuthToken& /*hat*/,
39 const NativeHandle& /*previewSurface*/,
40 std::shared_ptr<biometrics::common::ICancellationSignal>*
41 /*returnVal*/) {
42 return ndk::ScopedAStatus::ok();
43}
44
45ndk::ScopedAStatus Session::authenticate(int32_t /*cookie*/, int64_t /*keystoreOperationId*/,
46 std::shared_ptr<common::ICancellationSignal>* return_val) {
47 if (cb_) {
48 cb_->onStateChanged(0, SessionState::AUTHENTICATING);
49 }
50 *return_val = SharedRefBase::make<CancellationSignal>();
51 return ndk::ScopedAStatus::ok();
52}
53
54ndk::ScopedAStatus Session::detectInteraction(
55 int32_t /*cookie*/, std::shared_ptr<common::ICancellationSignal>* /*return_val*/) {
56 return ndk::ScopedAStatus::ok();
57}
58
59ndk::ScopedAStatus Session::enumerateEnrollments(int32_t /*cookie*/) {
60 return ndk::ScopedAStatus::ok();
61}
62
63ndk::ScopedAStatus Session::removeEnrollments(int32_t /*cookie*/,
64 const std::vector<int32_t>& /*enrollmentIds*/) {
65 return ndk::ScopedAStatus::ok();
66}
67
68ndk::ScopedAStatus Session::getAuthenticatorId(int32_t /*cookie*/) {
69 return ndk::ScopedAStatus::ok();
70}
71
72ndk::ScopedAStatus Session::invalidateAuthenticatorId(int32_t /*cookie*/) {
73 return ndk::ScopedAStatus::ok();
74}
75
76ndk::ScopedAStatus Session::resetLockout(int32_t /*cookie*/,
77 const keymaster::HardwareAuthToken& /*hat*/) {
78 return ndk::ScopedAStatus::ok();
79}
80} // namespace aidl::android::hardware::biometrics::face