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

Commit 1c0d722a authored by Kevin Chyn's avatar Kevin Chyn
Browse files

Add sensorId to biometric sensor proto dumpsys

Test: atest CtsBiometricsTestCases
Change-Id: I418fcfb9948be9693889a69cdbd0df4efe919793
parent 8582eeb8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ interface IBiometricAuthenticator {
    // Retrieve static sensor properties
    SensorPropertiesInternal getSensorProperties(String opPackageName);

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

    // This method prepares the service to start authenticating, but doesn't start authentication.
+2 −2
Original line number Diff line number Diff line
@@ -33,8 +33,8 @@ interface IFaceService {
    // Creates a test session with the specified sensorId
    ITestSession createTestSession(int sensorId, String opPackageName);

    // Requests a proto dump of the service to the specified fd
    byte[] dumpSensorServiceStateProto();
    // Requests a proto dump of the specified sensor
    byte[] dumpSensorServiceStateProto(int sensorId);

    // Retrieve static sensor properties for all face sensors
    List<FaceSensorPropertiesInternal> getSensorPropertiesInternal(String opPackageName);
+2 −2
Original line number Diff line number Diff line
@@ -34,8 +34,8 @@ interface IFingerprintService {
    // Creates a test session with the specified sensorId
    ITestSession createTestSession(int sensorId, String opPackageName);

    // Requests a proto dump of the service to the specified fd
    byte[] dumpSensorServiceStateProto();
    // Requests a proto dump of the specified sensor
    byte[] dumpSensorServiceStateProto(int sensorId);

    // Retrieve static sensor properties for all fingerprint sensors
    List<FingerprintSensorPropertiesInternal> getSensorPropertiesInternal(String opPackageName);
+1 −1
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ public final class FaceAuthenticator extends IBiometricAuthenticator.Stub {

    @Override
    public byte[] dumpSensorServiceStateProto() throws RemoteException {
        return mFaceService.dumpSensorServiceStateProto();
        return mFaceService.dumpSensorServiceStateProto(mSensorId);
    }

    @Override
+4 −5
Original line number Diff line number Diff line
@@ -157,14 +157,13 @@ public class FaceService extends SystemService implements BiometricServiceCallba
        }

        @Override
        public byte[] dumpSensorServiceStateProto() {
        public byte[] dumpSensorServiceStateProto(int sensorId) {
            Utils.checkPermission(getContext(), USE_BIOMETRIC_INTERNAL);

            final ProtoOutputStream proto = new ProtoOutputStream();
            for (ServiceProvider provider : mServiceProviders) {
                for (FaceSensorPropertiesInternal props : provider.getSensorProperties()) {
                    provider.dumpProtoState(props.sensorId, proto);
                }
            final ServiceProvider provider = getProviderForSensor(sensorId);
            if (provider != null) {
                provider.dumpProtoState(sensorId, proto);
            }
            proto.flush();
            return proto.getBytes();
Loading