Add IFingerprint#reset and ISession#close methods

Bug: 180521746
Test: m android.hardware.biometrics.fingerprint-update-api
Test: build
Change-Id: Ie69ea596dbbaefd4ee360facb2b57a21c8c0a46f
This commit is contained in:
Ilya Matyukhin
2021-02-16 16:03:48 -08:00
parent c9eccc49be
commit 4ae95d73eb
6 changed files with 50 additions and 12 deletions

View File

@@ -35,4 +35,5 @@ package android.hardware.biometrics.fingerprint;
interface IFingerprint {
android.hardware.biometrics.fingerprint.SensorProps[] getSensorProps();
android.hardware.biometrics.fingerprint.ISession createSession(in int sensorId, in int userId, in android.hardware.biometrics.fingerprint.ISessionCallback cb);
void reset();
}

View File

@@ -43,6 +43,7 @@ interface ISession {
void getAuthenticatorId(in int cookie);
void invalidateAuthenticatorId(in int cookie);
void resetLockout(in int cookie, in android.hardware.keymaster.HardwareAuthToken hat);
void close(in int cookie);
void onPointerDown(in int pointerId, in int x, in int y, in float minor, in float major);
void onPointerUp(in int pointerId);
void onUiReady();

View File

@@ -34,14 +34,15 @@ package android.hardware.biometrics.fingerprint;
@Backing(type="byte") @VintfStability
enum SessionState {
IDLING = 0,
GENERATING_CHALLENGE = 1,
REVOKING_CHALLENGE = 2,
ENROLLING = 3,
AUTHENTICATING = 4,
DETECTING_INTERACTION = 5,
ENUMERATING_ENROLLMENTS = 6,
REMOVING_ENROLLMENTS = 7,
GETTING_AUTHENTICATOR_ID = 8,
INVALIDATING_AUTHENTICATOR_ID = 9,
RESETTING_LOCKOUT = 10,
CLOSED = 1,
GENERATING_CHALLENGE = 2,
REVOKING_CHALLENGE = 3,
ENROLLING = 4,
AUTHENTICATING = 5,
DETECTING_INTERACTION = 6,
ENUMERATING_ENROLLMENTS = 7,
REMOVING_ENROLLMENTS = 8,
GETTING_AUTHENTICATOR_ID = 9,
INVALIDATING_AUTHENTICATOR_ID = 10,
RESETTING_LOCKOUT = 11,
}

View File

@@ -35,6 +35,10 @@ interface IFingerprint {
* Creates a session which can then be used by the framework to perform operations such as
* enroll, authenticate, etc for the given sensorId and userId.
*
* Calling this method while there is an active session is considered an error. If the
* framework is in a bad state and for some reason cannot close its session, it should use
* the reset method below.
*
* A physical sensor identified by sensorId typically supports only a single in-flight session
* at a time. As such, if a session is currently in a state other than SessionState::IDLING, the
* HAL MUST finish or cancel the current operation and return to SessionState::IDLING before the
@@ -61,4 +65,14 @@ interface IFingerprint {
* @return A new session
*/
ISession createSession(in int sensorId, in int userId, in ISessionCallback cb);
/**
* Resets the HAL into a clean state, forcing it to cancel all of the pending operations, close
* its current session, and release all of the acquired resources.
*
* This should be used as a last resort to recover the HAL if the current session becomes
* unresponsive. The implementation might choose to restart the HAL process to get back into a
* good state.
*/
void reset();
}

View File

@@ -366,6 +366,24 @@ interface ISession {
*/
void resetLockout(in int cookie, in HardwareAuthToken hat);
/*
* Close this session and allow the HAL to release the resources associated with this session.
*
* A session can only be closed when it's in SessionState::IDLING. Closing a session will
* result in a ISessionCallback#onStateChanged call with SessionState::CLOSED.
*
* If a session is unresponsive or stuck in a state other than SessionState::CLOSED,
* IFingerprint#reset could be used as a last resort to terminate the session and recover the
* HAL from a bad state.
*
* All sessions must be explicitly closed. Calling IFingerprint#createSession while there is an
* active session is considered an error.
*
* @param cookie An identifier used to track subsystem operations related to this call path. The
* client must guarantee that it is unique per ISession.
*/
void close(in int cookie);
/**
* Methods for notifying the under-display fingerprint sensor about external events.
*/
@@ -420,4 +438,3 @@ interface ISession {
*/
void onUiReady();
}

View File

@@ -24,6 +24,11 @@ enum SessionState {
*/
IDLING,
/**
* The session has been closed by the client.
*/
CLOSED,
/**
* The HAL is processing the ISession#generateChallenge request.
*/
@@ -74,4 +79,3 @@ enum SessionState {
*/
RESETTING_LOCKOUT
}