blob: bb895b76baf1550119218d5935ca9d99c2f6019b [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
30ndk::ScopedAStatus Session::generateChallenge(int32_t /*cookie*/, int32_t /*sensorId*/,
31 int32_t /*userId*/, int32_t /*timeoutSec*/) {
32 return ndk::ScopedAStatus::ok();
33}
34
35ndk::ScopedAStatus Session::revokeChallenge(int32_t /*cookie*/, int32_t /*sensorId*/,
36 int32_t /*userId*/, int64_t /*challenge*/) {
37 return ndk::ScopedAStatus::ok();
38}
39
40ndk::ScopedAStatus Session::enroll(int32_t /*cookie*/, const keymaster::HardwareAuthToken& /*hat*/,
41 const NativeHandle& /*previewSurface*/,
42 std::shared_ptr<biometrics::common::ICancellationSignal>*
43 /*returnVal*/) {
44 return ndk::ScopedAStatus::ok();
45}
46
47ndk::ScopedAStatus Session::authenticate(int32_t /*cookie*/, int64_t /*keystoreOperationId*/,
48 std::shared_ptr<common::ICancellationSignal>* return_val) {
49 if (cb_) {
50 cb_->onStateChanged(0, SessionState::AUTHENTICATING);
51 }
52 *return_val = SharedRefBase::make<CancellationSignal>();
53 return ndk::ScopedAStatus::ok();
54}
55
56ndk::ScopedAStatus Session::detectInteraction(
57 int32_t /*cookie*/, std::shared_ptr<common::ICancellationSignal>* /*return_val*/) {
58 return ndk::ScopedAStatus::ok();
59}
60
61ndk::ScopedAStatus Session::enumerateEnrollments(int32_t /*cookie*/) {
62 return ndk::ScopedAStatus::ok();
63}
64
65ndk::ScopedAStatus Session::removeEnrollments(int32_t /*cookie*/,
66 const std::vector<int32_t>& /*enrollmentIds*/) {
67 return ndk::ScopedAStatus::ok();
68}
69
70ndk::ScopedAStatus Session::getAuthenticatorId(int32_t /*cookie*/) {
71 return ndk::ScopedAStatus::ok();
72}
73
74ndk::ScopedAStatus Session::invalidateAuthenticatorId(int32_t /*cookie*/) {
75 return ndk::ScopedAStatus::ok();
76}
77
78ndk::ScopedAStatus Session::resetLockout(int32_t /*cookie*/,
79 const keymaster::HardwareAuthToken& /*hat*/) {
80 return ndk::ScopedAStatus::ok();
81}
82} // namespace aidl::android::hardware::biometrics::face