1 /*
2  * Copyright (C) 2022 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 package com.android.server.biometrics.sensors;
18 
19 import android.hardware.biometrics.BiometricManager.Authenticators;
20 
21 /**
22  * An interface that listens to authentication events.
23  */
24 interface AuthSessionListener {
25     /**
26      * Indicates an auth operation has started for a given user and sensor.
27      */
authStartedFor(int userId, int sensorId, long requestId)28     void authStartedFor(int userId, int sensorId, long requestId);
29 
30     /**
31      * Indicates authentication ended for a sensor of a given strength.
32      */
authEndedFor(int userId, @Authenticators.Types int biometricStrength, int sensorId, long requestId, boolean wasSuccessful)33     void authEndedFor(int userId, @Authenticators.Types int biometricStrength, int sensorId,
34             long requestId, boolean wasSuccessful);
35 
36     /**
37      * Indicates a lockout occurred for a sensor of a given strength.
38      */
lockedOutFor(int userId, @Authenticators.Types int biometricStrength, int sensorId, long requestId)39     void lockedOutFor(int userId, @Authenticators.Types int biometricStrength, int sensorId,
40             long requestId);
41 
42     /**
43      * Indicates a timed lockout occurred for a sensor of a given strength.
44      */
lockOutTimed(int userId, @Authenticators.Types int biometricStrength, int sensorId, long duration, long requestId)45     void lockOutTimed(int userId, @Authenticators.Types int biometricStrength, int sensorId,
46             long duration, long requestId);
47 
48     /**
49      * Indicates that a reset lockout has happened for a given strength.
50      */
resetLockoutFor(int uerId, @Authenticators.Types int biometricStrength, long requestId)51     void resetLockoutFor(int uerId, @Authenticators.Types int biometricStrength, long requestId);
52 }
53