| 1 |
/* |
| 2 |
* Copyright (C) 2019 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 android.hardware.biometrics; |
| 18 |
|
| 19 |
import android.hardware.biometrics.IBiometricSensorReceiver; |
| 20 |
import android.hardware.biometrics.IBiometricServiceLockoutResetCallback; |
| 21 |
import android.hardware.biometrics.IInvalidationCallback; |
| 22 |
import android.hardware.biometrics.ITestSession; |
| 23 |
import android.hardware.biometrics.ITestSessionCallback; |
| 24 |
import android.hardware.biometrics.SensorPropertiesInternal; |
| 25 |
import android.hardware.face.IFaceServiceReceiver; |
| 26 |
import android.hardware.face.Face; |
| 27 |
|
| 28 |
/** |
| 29 |
* This interface encapsulates fingerprint, face, iris, etc. authenticators. |
| 30 |
* Implementations of this interface are meant to be registered with BiometricService. |
| 31 |
* @hide |
| 32 |
*/ |
| 33 |
interface IBiometricAuthenticator { |
| 34 |
|
| 35 |
// Creates a test session |
| 36 |
ITestSession createTestSession(ITestSessionCallback callback, String opPackageName); |
| 37 |
|
| 38 |
// Retrieve static sensor properties |
| 39 |
SensorPropertiesInternal getSensorProperties(String opPackageName); |
| 40 |
|
| 41 |
// Requests a proto dump of the sensor. See biometrics.proto |
| 42 |
byte[] dumpSensorServiceStateProto(boolean clearSchedulerBuffer); |
| 43 |
|
| 44 |
// This method prepares the service to start authenticating, but doesn't start authentication. |
| 45 |
// This is protected by the MANAGE_BIOMETRIC signature permission. This method should only be |
| 46 |
// called from BiometricService. The additional uid, pid, userId arguments should be determined |
| 47 |
// by BiometricService. To start authentication after the clients are ready, use |
| 48 |
// startPreparedClient(). |
| 49 |
void prepareForAuthentication(boolean requireConfirmation, IBinder token, long operationId, |
| 50 |
int userId, IBiometricSensorReceiver sensorReceiver, String opPackageName, |
| 51 |
long requestId, int cookie, boolean allowBackgroundAuthentication); |
| 52 |
|
| 53 |
// Starts authentication with the previously prepared client. |
| 54 |
void startPreparedClient(int cookie); |
| 55 |
|
| 56 |
// Cancels authentication for the given requestId. |
| 57 |
void cancelAuthenticationFromService(IBinder token, String opPackageName, long requestId); |
| 58 |
|
| 59 |
// Determine if HAL is loaded and ready |
| 60 |
boolean isHardwareDetected(String opPackageName); |
| 61 |
|
| 62 |
// Determine if a user has at least one enrolled face |
| 63 |
boolean hasEnrolledTemplates(int userId, String opPackageName); |
| 64 |
|
| 65 |
// Return the LockoutTracker status for the specified user |
| 66 |
int getLockoutModeForUser(int userId); |
| 67 |
|
| 68 |
// Request the authenticatorId to be invalidated for the specified user |
| 69 |
void invalidateAuthenticatorId(int userId, IInvalidationCallback callback); |
| 70 |
|
| 71 |
// Gets the authenticator ID representing the current set of enrolled templates |
| 72 |
long getAuthenticatorId(int callingUserId); |
| 73 |
|
| 74 |
// Requests the sensor to reset its lockout state |
| 75 |
void resetLockout(IBinder token, String opPackageName, int userId, |
| 76 |
in byte[] hardwareAuthToken); |
| 77 |
} |