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

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

Merge changes from topic "face-enumerate"

* changes:
  Finish authentication client when rejected
  Actually use HardwareAuthToken to resetLockout where applicable
  Add enumerate functionality for FaceService
parents f01ac39f 56d6b079
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -156,21 +156,21 @@ public class BiometricManager {
    }

    /**
     * Reset the timeout when user authenticates with strong auth (e.g. PIN, pattern or password)
     * Reset the lockout when user authenticates with strong auth (e.g. PIN, pattern or password)
     *
     * @param token an opaque token returned by password confirmation.
     * @hide
     */
    @RequiresPermission(USE_BIOMETRIC_INTERNAL)
    public void resetTimeout(byte[] token) {
    public void resetLockout(byte[] token) {
        if (mService != null) {
            try {
                mService.resetTimeout(token);
                mService.resetLockout(token);
            } catch (RemoteException e) {
                throw e.rethrowFromSystemServer();
            }
        } else {
            Slog.w(TAG, "resetTimeout(): Service not connected");
            Slog.w(TAG, "resetLockout(): Service not connected");
        }
    }

+2 −2
Original line number Diff line number Diff line
@@ -49,8 +49,8 @@ interface IBiometricService {
    // Client lifecycle is still managed in <Biometric>Service.
    void onReadyForAuthentication(int cookie, boolean requireConfirmation, int userId);

    // Reset the timeout when user authenticates with strong auth (e.g. PIN, pattern or password)
    void resetTimeout(in byte [] token);
    // Reset the lockout when user authenticates with strong auth (e.g. PIN, pattern or password)
    void resetLockout(in byte [] token);

    // TODO(b/123378871): Remove when moved.
    // CDCA needs to send results to BiometricService if it was invoked using BiometricPrompt's
+5 −19
Original line number Diff line number Diff line
@@ -107,6 +107,11 @@ public class FaceManager implements BiometricAuthenticator, BiometricFaceConstan
            mHandler.obtainMessage(MSG_REMOVED, remaining, 0,
                    new Face(null, faceId, deviceId)).sendToTarget();
        }

        @Override
        public void onEnumerated(long deviceId, int faceId, int remaining) {
            // TODO: Finish. Low priority since it's not used.
        }
    };

    /**
@@ -473,25 +478,6 @@ public class FaceManager implements BiometricAuthenticator, BiometricFaceConstan
        return 0;
    }

    /**
     * Reset the lockout timer when asked to do so by keyguard.
     *
     * @param token an opaque token returned by password confirmation.
     * @hide
     */
    @RequiresPermission(MANAGE_BIOMETRIC)
    public void resetTimeout(byte[] token) {
        if (mService != null) {
            try {
                mService.resetTimeout(token);
            } catch (RemoteException e) {
                throw e.rethrowFromSystemServer();
            }
        } else {
            Log.w(TAG, "resetTimeout(): Service not connected!");
        }
    }

    /**
     * @hide
     */
+2 −2
Original line number Diff line number Diff line
@@ -86,8 +86,8 @@ interface IFaceService {
    // Gets the authenticator ID for face
    long getAuthenticatorId(String opPackageName);

    // Reset the timeout when user authenticates with strong auth (e.g. PIN, pattern or password)
    void resetTimeout(in byte [] cryptoToken);
    // Reset the lockout when user authenticates with strong auth (e.g. PIN, pattern or password)
    void resetLockout(in byte [] token);

    // Add a callback which gets notified when the face lockout period expired.
    void addLockoutResetCallback(IBiometricServiceLockoutResetCallback callback);
+1 −0
Original line number Diff line number Diff line
@@ -28,4 +28,5 @@ oneway interface IFaceServiceReceiver {
    void onAuthenticationFailed(long deviceId);
    void onError(long deviceId, int error, int vendorCode);
    void onRemoved(long deviceId, int faceId, int remaining);
    void onEnumerated(long deviceId, int faceId, int remaining);
}
Loading