/* * Copyright 2020 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include #include #include #include namespace android::hardware::biometrics::face::implementation { using ::android::sp; using ::android::hardware::hidl_array; using ::android::hardware::hidl_memory; using ::android::hardware::hidl_string; using ::android::hardware::hidl_vec; using ::android::hardware::Return; using ::android::hardware::Void; using ::android::hardware::biometrics::face::V1_0::Feature; using ::android::hardware::biometrics::face::V1_0::IBiometricsFaceClientCallback; using ::android::hardware::biometrics::face::V1_0::Status; class BiometricsFace : public V1_0::IBiometricsFace { public: BiometricsFace(); // Methods from ::android::hardware::biometrics::face::V1_0::IBiometricsFace follow. Return setCallback(const sp& clientCallback, setCallback_cb _hidl_cb) override; Return setActiveUser(int32_t userId, const hidl_string& storePath) override; Return generateChallenge(uint32_t challengeTimeoutSec, generateChallenge_cb _hidl_cb) override; Return enroll(const hidl_vec& hat, uint32_t timeoutSec, const hidl_vec& disabledFeatures) override; Return revokeChallenge() override; Return setFeature(Feature feature, bool enabled, const hidl_vec& hat, uint32_t faceId) override; Return getFeature(Feature feature, uint32_t faceId, getFeature_cb _hidl_cb) override; Return getAuthenticatorId(getAuthenticatorId_cb _hidl_cb) override; Return cancel() override; Return enumerate() override; Return remove(uint32_t faceId) override; Return authenticate(uint64_t operationId) override; Return userActivity() override; Return resetLockout(const hidl_vec& hat) override; private: std::mt19937 mRandom; int32_t mUserId; sp mClientCallback; }; } // namespace android::hardware::biometrics::face::implementation