summaryrefslogtreecommitdiff
path: root/core/java/android/hardware/biometrics/BiometricPrompt.java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/android/hardware/biometrics/BiometricPrompt.java')
-rw-r--r--core/java/android/hardware/biometrics/BiometricPrompt.java38
1 files changed, 9 insertions, 29 deletions
diff --git a/core/java/android/hardware/biometrics/BiometricPrompt.java b/core/java/android/hardware/biometrics/BiometricPrompt.java
index 520234bcf050..6b5bec99e674 100644
--- a/core/java/android/hardware/biometrics/BiometricPrompt.java
+++ b/core/java/android/hardware/biometrics/BiometricPrompt.java
@@ -421,18 +421,6 @@ public class BiometricPrompt implements BiometricAuthenticator, BiometricConstan
}
/**
- * Set if BiometricPrompt is being used by the legacy fingerprint manager API.
- * @param sensorId sensor id
- * @return This builder.
- * @hide
- */
- @NonNull
- public Builder setIsForLegacyFingerprintManager(int sensorId) {
- mPromptInfo.setIsForLegacyFingerprintManager(sensorId);
- return this;
- }
-
- /**
* Creates a {@link BiometricPrompt}.
*
* @return An instance of {@link BiometricPrompt}.
@@ -873,36 +861,28 @@ public class BiometricPrompt implements BiometricAuthenticator, BiometricConstan
@NonNull @CallbackExecutor Executor executor,
@NonNull AuthenticationCallback callback,
int userId) {
- if (cancel == null) {
- throw new IllegalArgumentException("Must supply a cancellation signal");
- }
- if (executor == null) {
- throw new IllegalArgumentException("Must supply an executor");
- }
- if (callback == null) {
- throw new IllegalArgumentException("Must supply a callback");
- }
-
- authenticateInternal(0 /* operationId */, cancel, executor, callback, userId);
+ authenticateUserForOperation(cancel, executor, callback, userId, 0 /* operationId */);
}
/**
- * Authenticates for the given keystore operation.
+ * Authenticates for the given user and keystore operation.
*
* @param cancel An object that can be used to cancel authentication
* @param executor An executor to handle callback events
* @param callback An object to receive authentication events
+ * @param userId The user to authenticate
* @param operationId The keystore operation associated with authentication
*
* @return A requestId that can be used to cancel this operation.
*
* @hide
*/
- @RequiresPermission(USE_BIOMETRIC)
- public long authenticateForOperation(
+ @RequiresPermission(USE_BIOMETRIC_INTERNAL)
+ public long authenticateUserForOperation(
@NonNull CancellationSignal cancel,
@NonNull @CallbackExecutor Executor executor,
@NonNull AuthenticationCallback callback,
+ int userId,
long operationId) {
if (cancel == null) {
throw new IllegalArgumentException("Must supply a cancellation signal");
@@ -914,7 +894,7 @@ public class BiometricPrompt implements BiometricAuthenticator, BiometricConstan
throw new IllegalArgumentException("Must supply a callback");
}
- return authenticateInternal(operationId, cancel, executor, callback, mContext.getUserId());
+ return authenticateInternal(operationId, cancel, executor, callback, userId);
}
/**
@@ -1048,7 +1028,7 @@ public class BiometricPrompt implements BiometricAuthenticator, BiometricConstan
private void cancelAuthentication(long requestId) {
if (mService != null) {
try {
- mService.cancelAuthentication(mToken, mContext.getPackageName(), requestId);
+ mService.cancelAuthentication(mToken, mContext.getOpPackageName(), requestId);
} catch (RemoteException e) {
Log.e(TAG, "Unable to cancel authentication", e);
}
@@ -1107,7 +1087,7 @@ public class BiometricPrompt implements BiometricAuthenticator, BiometricConstan
}
final long authId = mService.authenticate(mToken, operationId, userId,
- mBiometricServiceReceiver, mContext.getPackageName(), promptInfo);
+ mBiometricServiceReceiver, mContext.getOpPackageName(), promptInfo);
cancel.setOnCancelListener(new OnAuthenticationCancelListener(authId));
return authId;
} catch (RemoteException e) {