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

Commit 00220617 authored by Kevin Chyn's avatar Kevin Chyn Committed by Android (Google) Code Review
Browse files

Merge changes from topic "face-hidl"

* changes:
  Update framework together with HIDL onRemoved
  Update constants with HIDL
parents e255e671 31ae8d22
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -312,13 +312,18 @@ public interface BiometricFaceConstants {
     */
    public static final int FACE_ACQUIRED_START = 20;

    /**
     * The sensor is dirty. The user should be informed to clean the sensor.
     */
    public static final int SENSOR_DIRTY = 21;

    /**
     * Hardware vendors may extend this list if there are conditions that do not fall under one of
     * the above categories. Vendors are responsible for providing error strings for these errors.
     *
     * @hide
     */
    public static final int FACE_ACQUIRED_VENDOR = 21;
    public static final int FACE_ACQUIRED_VENDOR = 22;

    /**
     * @hide
+12 −4
Original line number Diff line number Diff line
@@ -633,11 +633,19 @@ public class FaceService extends BiometricServiceBase {
        }

        @Override
        public void onRemoved(final long deviceId, final int faceId, final int userId,
                final int remaining) {
        public void onRemoved(final long deviceId, ArrayList<Integer> faceIds, final int userId) {
            mHandler.post(() -> {
                final Face face = new Face("", faceId, deviceId);
                FaceService.super.handleRemoved(face, remaining);
                if (!faceIds.isEmpty()) {
                    for (int i = 0; i < faceIds.size(); i++) {
                        final Face face = new Face("", faceIds.get(i), deviceId);
                        // Convert to old behavior
                        FaceService.super.handleRemoved(face, faceIds.size() - i - 1);
                    }
                } else {
                    final Face face = new Face("", 0 /* identifier */, deviceId);
                    FaceService.super.handleRemoved(face, 0 /* remaining */);
                }

            });
        }