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

Commit 44593da2 authored by Joshua Mccloskey's avatar Joshua Mccloskey
Browse files

Add get/set feature implementation

Fixes: 184657294
Test: Verified e2e feature get/set work via settings.
Change-Id: I6e3f598ae35c599df15ea6f69a161758caa53c36
parent 116e4c41
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -133,11 +133,11 @@ public class FaceManager implements BiometricAuthenticator, BiometricFaceConstan
        }

        @Override
        public void onFeatureGet(boolean success, int feature, boolean value) {
        public void onFeatureGet(boolean success, int[] features, boolean[] featureState) {
            SomeArgs args = SomeArgs.obtain();
            args.arg1 = success;
            args.argi1 = feature;
            args.arg2 = value;
            args.arg2 = features;
            args.arg3 = featureState;
            mHandler.obtainMessage(MSG_GET_FEATURE_COMPLETED, args).sendToTarget();
        }

@@ -1088,7 +1088,7 @@ public class FaceManager implements BiometricAuthenticator, BiometricFaceConstan
     * @hide
     */
    public abstract static class GetFeatureCallback {
        public abstract void onCompleted(boolean success, int feature, boolean value);
        public abstract void onCompleted(boolean success, int[] features, boolean[] featureState);
    }

    /**
@@ -1179,8 +1179,8 @@ public class FaceManager implements BiometricAuthenticator, BiometricFaceConstan
                case MSG_GET_FEATURE_COMPLETED:
                    SomeArgs args = (SomeArgs) msg.obj;
                    sendGetFeatureCompleted((boolean) args.arg1 /* success */,
                            args.argi1 /* feature */,
                            (boolean) args.arg2 /* value */);
                            (int[]) args.arg2 /* features */,
                            (boolean[]) args.arg3 /* featureState */);
                    args.recycle();
                    break;
                case MSG_CHALLENGE_GENERATED:
@@ -1216,11 +1216,11 @@ public class FaceManager implements BiometricAuthenticator, BiometricFaceConstan
        mSetFeatureCallback.onCompleted(success, feature);
    }

    private void sendGetFeatureCompleted(boolean success, int feature, boolean value) {
    private void sendGetFeatureCompleted(boolean success, int[] features, boolean[] featureState) {
        if (mGetFeatureCallback == null) {
            return;
        }
        mGetFeatureCallback.onCompleted(success, feature, value);
        mGetFeatureCallback.onCompleted(success, features, featureState);
    }

    private void sendChallengeGenerated(int sensorId, long challenge) {
+2 −1
Original line number Diff line number Diff line
@@ -66,7 +66,8 @@ public class FaceServiceReceiver extends IFaceServiceReceiver.Stub {
    }

    @Override
    public void onFeatureGet(boolean success, int feature, boolean value) throws RemoteException {
    public void onFeatureGet(boolean success, int[] features, boolean[] featureState)
                throws RemoteException {

    }

+1 −1
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ oneway interface IFaceServiceReceiver {
    void onError(int error, int vendorCode);
    void onRemoved(in Face face, int remaining);
    void onFeatureSet(boolean success, int feature);
    void onFeatureGet(boolean success, int feature, boolean value);
    void onFeatureGet(boolean success, in int[] features, in boolean[] featureState);
    void onChallengeGenerated(int sensorId, long challenge);
    void onChallengeInterrupted(int sensorId);
    void onChallengeInterruptFinished(int sensorId);
+3 −2
Original line number Diff line number Diff line
@@ -146,9 +146,10 @@ public class ClientMonitorCallbackConverter {
        }
    }

    public void onFeatureGet(boolean success, int feature, boolean value) throws RemoteException {
    public void onFeatureGet(boolean success, int[] features, boolean[] featureState)
            throws RemoteException {
        if (mFaceServiceReceiver != null) {
            mFaceServiceReceiver.onFeatureGet(success, feature, value);
            mFaceServiceReceiver.onFeatureGet(success, features, featureState);
        }
    }

+1 −1
Original line number Diff line number Diff line
@@ -105,7 +105,7 @@ public class BiometricTestSessionImpl extends ITestSession.Stub {
        }

        @Override
        public void onFeatureGet(boolean success, int feature, boolean value) {
        public void onFeatureGet(boolean success, int[] features, boolean[] featureState) {

        }

Loading