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

* changes:
  Consolidate FingerprintManager revokeChallenge
  Consolidate revokeChallenge methods
This commit is contained in:
Kevin Chyn
2021-03-11 01:14:15 +00:00
committed by Android (Google) Code Review
3 changed files with 8 additions and 32 deletions

View File

@@ -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();
}

View File

@@ -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

View File

@@ -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");