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

Commit 7cedd298 authored by Ilya Matyukhin's avatar Ilya Matyukhin
Browse files

Update face with set and get features

Bug: 174619156
Test: atest CtsBiometricsTestCases
Change-Id: I8b7da315a3c7cc81d3994363a35b371e9b46da78
parent 3cc6d0b3
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -116,9 +116,9 @@ public class FaceEnrollClient extends EnrollClient<ISession> {
        try {
            // TODO(b/172593978): Pass features.
            // TODO(b/174619156): Handle accessibility enrollment.
            mCancellationSignal = getFreshDaemon().enroll(mSequentialId, EnrollmentType.DEFAULT,
            mCancellationSignal = getFreshDaemon().enroll(mSequentialId,
                    HardwareAuthTokenUtils.toHardwareAuthToken(mHardwareAuthToken),
                    mPreviewSurface);
                    EnrollmentType.DEFAULT, new byte[0], mPreviewSurface);
        } catch (RemoteException e) {
            Slog.e(TAG, "Remote exception when requesting enroll", e);
            onError(BiometricFaceConstants.FACE_ERROR_UNABLE_TO_PROCESS, 0 /* vendorCode */);
+10 −0
Original line number Diff line number Diff line
@@ -356,6 +356,16 @@ public class Sensor implements IBinder.DeathRecipient {
            });
        }

        @Override
        public void onFeaturesRetrieved(byte[] features, int enrollmentId) {

        }

        @Override
        public void onFeatureSet(int enrollmentId, byte feature) {

        }

        @Override
        public void onEnrollmentsRemoved(int[] enrollmentIds) {
            mHandler.post(() -> {
+13 −2
Original line number Diff line number Diff line
@@ -49,8 +49,8 @@ public class TestHal extends IFace.Stub {
            }

            @Override
            public ICancellationSignal enroll(int cookie, byte enrollmentType,
                    HardwareAuthToken hat, NativeHandle previewSurface) {
            public ICancellationSignal enroll(int cookie, HardwareAuthToken hat,
                    byte enrollmentType, byte[] features, NativeHandle previewSurface) {
                return null;
            }

@@ -74,6 +74,17 @@ public class TestHal extends IFace.Stub {

            }

            @Override
            public void getFeatures(int cookie, int enrollmentId) {

            }

            @Override
            public void setFeature(int cookie, HardwareAuthToken hat, int enrollmentId,
                    byte feature, boolean enabled) {

            }

            @Override
            public void getAuthenticatorId(int cookie) {

+13 −2
Original line number Diff line number Diff line
@@ -50,8 +50,8 @@ public class TestSession extends ISession.Stub {
    }

    @Override
    public ICancellationSignal enroll(int cookie, byte enrollmentType, HardwareAuthToken hat,
            NativeHandle previewSurface) {
    public ICancellationSignal enroll(int cookie, HardwareAuthToken hat, byte enrollmentType,
            byte[] features, NativeHandle previewSurface) {
        return null;
    }

@@ -85,6 +85,17 @@ public class TestSession extends ISession.Stub {

    }

    @Override
    public void getFeatures(int cookie, int enrollmentId) {

    }

    @Override
    public void setFeature(int cookie, HardwareAuthToken hat, int enrollmentId, byte feature,
            boolean enabled) {

    }

    @Override
    public void getAuthenticatorId(int cookie) {
        Slog.d(TAG, "getAuthenticatorId");