/*
 * Copyright (C) 2017 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.
 */

package android.hardware.biometrics.fingerprint@2.1;

/* This HAL interface communicates asynchronous results from the
   fingerprint driver in response to user actions on the fingerprint sensor
*/
interface IBiometricsFingerprintClientCallback {
    /**
     * Sent when one enrollment step is complete.
     * @param deviceId the instance of this fingerprint device
     * @param fingerId the fingerprint templetate being enrolled
     * @param groupId the groupid for the template being enrolled
     * @param remaining the number of remaining steps before enrolllment is complete
     */
    oneway onEnrollResult(uint64_t deviceId, uint32_t fingerId, uint32_t groupId, uint32_t remaining);

    /**
     * Sent when a fingerprint image is acquired by the sensor
     * @param deviceId the instance of this fingerprint device
     * @param acquiredInfo a message about the quality of the acquired image
     * @param vendorCode a vendor-specific message about the quality of the image. Only
     *        valid when acquiredInfo == ACQUIRED_VENDOR
     */
    oneway onAcquired(uint64_t deviceId, FingerprintAcquiredInfo acquiredInfo, int32_t vendorCode);

    /**
     * Sent when a fingerprint is authenticated
     * @param deviceId the instance of this fingerprint device
     * @param fingerId the fingerprint templetate that was authenticated
     * @param groupId the groupid for the template that was authenticated
     * @param token the hardware authentication token to pass to Keystore.addAuthToken()
     */
    oneway onAuthenticated(uint64_t deviceId, uint32_t fingerId, uint32_t groupId, vec<uint8_t> token);

    /**
     * Sent when a fingerprint error occurs
     * @param deviceId the instance of this fingerprint device
     * @param error a message about the error that occurred
     * @param vendorCode a vendor-speicifc error message. Only valid
     *        when error == ERROR_VENDOR
     */
    oneway onError(uint64_t deviceId, FingerprintError error, int32_t vendorCode);

    /**
     * Sent when one template is removed
     * @param deviceId the instance of this fingerprint device
     * @param fingerId the fingerprint templetate being removed
     * @param groupId the groupid for the template being removed
     * @param remaining the number of remaining templates that will be removed.
     */
    oneway onRemoved(uint64_t deviceId, uint32_t fingerId, uint32_t groupId, uint32_t remaining);

    /**
     * Sent when one fingerprint template is enumerated
     * @param deviceId the instance of this fingerprint device
     * @param fingerId the fingerprint for this templetate
     * @param groupId the groupid for this template
     * @param remaining the number of remaining steps before enumeration is complete
     */
    oneway onEnumerate(uint64_t deviceId, uint32_t fingerId, uint32_t groupId, uint32_t remaining);
};