Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7a707810 authored by Kevin Chyn's avatar Kevin Chyn
Browse files

9/n: Add BiometricScheduler proto dump

1) Adds biometrics.proto definition for BaseClientMonitor subtypes
2) Adds BiometricScheduler proto dump

When dumping the scheduler, the caller may request for the recent
operation queue to be cleared after dumping or not.

Note that we don't need BiometricScheduler.Operation#STATE_*
in the dump, since (for now) we just want to know what operations
have been run.

We can always add additional state, success/failure, etc in the
future if needed.

Bug: 159667191
Test: atest com.android.server.biometrics
Test: atest CtsBiometricsTestCases
Change-Id: I7d2350f00aaeef03ab7d74013b476af053240320
parent 6d6a9489
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ interface IBiometricAuthenticator {
    SensorPropertiesInternal getSensorProperties(String opPackageName);

    // Requests a proto dump of the sensor. See biometrics.proto
    byte[] dumpSensorServiceStateProto();
    byte[] dumpSensorServiceStateProto(boolean clearSchedulerBuffer);

    // This method prepares the service to start authenticating, but doesn't start authentication.
    // This is protected by the MANAGE_BIOMETRIC signature permission. This method should only be
+1 −1
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ interface IFaceService {
    ITestSession createTestSession(int sensorId, String opPackageName);

    // Requests a proto dump of the specified sensor
    byte[] dumpSensorServiceStateProto(int sensorId);
    byte[] dumpSensorServiceStateProto(int sensorId, boolean clearSchedulerBuffer);

    // Retrieve static sensor properties for all face sensors
    List<FaceSensorPropertiesInternal> getSensorPropertiesInternal(String opPackageName);
+1 −1
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ interface IFingerprintService {
    ITestSession createTestSession(int sensorId, String opPackageName);

    // Requests a proto dump of the specified sensor
    byte[] dumpSensorServiceStateProto(int sensorId);
    byte[] dumpSensorServiceStateProto(int sensorId, boolean clearSchedulerBuffer);

    // Retrieve static sensor properties for all fingerprint sensors
    List<FingerprintSensorPropertiesInternal> getSensorPropertiesInternal(String opPackageName);
+37 −2
Original line number Diff line number Diff line
@@ -120,8 +120,8 @@ message SensorStateProto {

    optional Modality modality = 2;

    // State of the sensor's scheduler. True if currently handling an operation, false if idle.
    optional bool is_busy = 3;
    // State of the sensor's scheduler.
    optional BiometricSchedulerProto scheduler = 3;

    // User states for this sensor.
    repeated UserStateProto user_states = 4;
@@ -137,3 +137,38 @@ message UserStateProto {
    // Number of fingerprints enrolled
    optional int32 num_enrolled = 2;
}

// BiometricScheduler dump
message BiometricSchedulerProto {
    option (.android.msg_privacy).dest = DEST_AUTOMATIC;

    // Operation currently being handled by the BiometricScheduler
    optional ClientMonitorEnum current_operation = 1;

    // Total number of operations that have been handled, not including the current one if one
    // exists. Kept in FIFO order (most recent at the end of the array)
    optional int32 total_operations = 2;

    // A list of recent past operations in the order which they were handled
    repeated ClientMonitorEnum recent_operations = 3;
}

// BaseClientMonitor subtypes
enum ClientMonitorEnum {
    CM_NONE = 0;
    CM_UPDATE_ACTIVE_USER = 1;
    CM_ENROLL = 2;
    CM_AUTHENTICATE = 3;
    CM_REMOVE = 4;
    CM_GET_AUTHENTICATOR_ID = 5;
    CM_ENUMERATE = 6;
    CM_INTERNAL_CLEANUP = 7;
    CM_SET_FEATURE = 8;
    CM_GET_FEATURE = 9;
    CM_GENERATE_CHALLENGE = 10;
    CM_REVOKE_CHALLENGE = 11;
    CM_RESET_LOCKOUT = 12;
    CM_DETECT_INTERACTION = 13;
    CM_INVALIDATION_REQUESTER = 14;
    CM_INVALIDATE = 15;
}
 No newline at end of file
+0 −3
Original line number Diff line number Diff line
@@ -37,7 +37,6 @@ import android.hardware.biometrics.IBiometricSysuiReceiver;
import android.hardware.biometrics.PromptInfo;
import android.hardware.face.FaceManager;
import android.hardware.fingerprint.FingerprintManager;
import android.hardware.fingerprint.FingerprintSensorProperties;
import android.hardware.fingerprint.FingerprintSensorPropertiesInternal;
import android.os.IBinder;
import android.os.RemoteException;
@@ -62,8 +61,6 @@ public final class AuthSession implements IBinder.DeathRecipient {
    private static final String TAG = "BiometricService/AuthSession";
    private static final boolean DEBUG = false;



    /*
     * Defined in biometrics.proto
     */
Loading