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

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

Merge changes from topics "fp-revokeChallenge", "new-revokeChallenge" into sc-dev

* changes:
  Consolidate FingerprintManager revokeChallenge
  Consolidate revokeChallenge methods
parents e2a2b618 817be680
Loading
Loading
Loading
Loading
+3 −20
Original line number Diff line number Diff line
@@ -475,28 +475,11 @@ public class FaceManager implements BiometricAuthenticator, BiometricFaceConstan
     * @hide
     */
    @RequiresPermission(MANAGE_BIOMETRIC)
    public void revokeChallenge() {
        final List<FaceSensorPropertiesInternal> faceSensorProperties =
                getSensorPropertiesInternal();
        if (faceSensorProperties.isEmpty()) {
            Slog.e(TAG, "No sensors during revokeChallenge");
        }
        revokeChallenge(faceSensorProperties.get(0).sensorId);
    }

    /**
     * Invalidates the current challenge.
     *
     * TODO(b/171335732): should take userId and challenge
     *
     * @hide
     */
    @RequiresPermission(MANAGE_BIOMETRIC)
    public void revokeChallenge(int sensorId) {
    public void revokeChallenge(int sensorId, int userId, long challenge) {
        if (mService != null) {
            try {
                mService.revokeChallenge(mToken, sensorId, 0 /* userId */,
                        mContext.getOpPackageName(), 0 /* challenge */);
                mService.revokeChallenge(mToken, sensorId, userId,
                        mContext.getOpPackageName(), challenge);
            } catch (RemoteException e) {
                throw e.rethrowFromSystemServer();
            }
+0 −11
Original line number Diff line number Diff line
@@ -685,17 +685,6 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing
        generateChallenge(sensorProps.sensorId, userId, callback);
    }

    /**
     * Revokes the current challenge.
     * @hide
     */
    @RequiresPermission(MANAGE_FINGERPRINT)
    public void revokeChallenge(int userId) {
        // On HALs with only single in-flight challenge such as IBiometricsFingerprint@2.1,
        // this parameter is ignored.
        revokeChallenge(userId, 0L);
    }

    /**
     * Revokes the specified challenge.
     * @hide
+5 −1
Original line number Diff line number Diff line
@@ -135,7 +135,11 @@ public class BiometricDeferredQueue {
            }

            sensorIds.remove(sensorId);
            faceManager.revokeChallenge(sensorId);
            // Challenge is only required for IBiometricsFace@1.0 (and not IFace AIDL). The
            // IBiometricsFace@1.0 HAL does not require userId to revokeChallenge, so passing
            // in 0 is OK.
            final int userId = 0;
            faceManager.revokeChallenge(sensorId, userId, challenge);

            if (sensorIds.isEmpty()) {
                Slog.d(TAG, "Done requesting resetLockout for all face sensors");