Merge "Rename BiometricDialog to BiometricPrompt." into pi-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
5ab3cf8bec
@@ -145,7 +145,7 @@ java_library {
|
||||
":libcamera_client_framework_aidl",
|
||||
"core/java/android/hardware/IConsumerIrService.aidl",
|
||||
"core/java/android/hardware/ISerialManager.aidl",
|
||||
"core/java/android/hardware/biometrics/IBiometricDialogReceiver.aidl",
|
||||
"core/java/android/hardware/biometrics/IBiometricPromptReceiver.aidl",
|
||||
"core/java/android/hardware/display/IDisplayManager.aidl",
|
||||
"core/java/android/hardware/display/IDisplayManagerCallback.aidl",
|
||||
"core/java/android/hardware/display/IVirtualDisplayCallback.aidl",
|
||||
|
||||
@@ -15758,9 +15758,9 @@ package android.hardware {
|
||||
|
||||
package android.hardware.biometrics {
|
||||
|
||||
public class BiometricDialog {
|
||||
method public void authenticate(android.hardware.biometrics.BiometricDialog.CryptoObject, android.os.CancellationSignal, java.util.concurrent.Executor, android.hardware.biometrics.BiometricDialog.AuthenticationCallback);
|
||||
method public void authenticate(android.os.CancellationSignal, java.util.concurrent.Executor, android.hardware.biometrics.BiometricDialog.AuthenticationCallback);
|
||||
public class BiometricPrompt {
|
||||
method public void authenticate(android.hardware.biometrics.BiometricPrompt.CryptoObject, android.os.CancellationSignal, java.util.concurrent.Executor, android.hardware.biometrics.BiometricPrompt.AuthenticationCallback);
|
||||
method public void authenticate(android.os.CancellationSignal, java.util.concurrent.Executor, android.hardware.biometrics.BiometricPrompt.AuthenticationCallback);
|
||||
field public static final int BIOMETRIC_ACQUIRED_GOOD = 0; // 0x0
|
||||
field public static final int BIOMETRIC_ACQUIRED_IMAGER_DIRTY = 3; // 0x3
|
||||
field public static final int BIOMETRIC_ACQUIRED_INSUFFICIENT = 2; // 0x2
|
||||
@@ -15780,31 +15780,31 @@ package android.hardware.biometrics {
|
||||
field public static final int BIOMETRIC_ERROR_VENDOR = 8; // 0x8
|
||||
}
|
||||
|
||||
public static abstract class BiometricDialog.AuthenticationCallback {
|
||||
ctor public BiometricDialog.AuthenticationCallback();
|
||||
public static abstract class BiometricPrompt.AuthenticationCallback {
|
||||
ctor public BiometricPrompt.AuthenticationCallback();
|
||||
method public void onAuthenticationError(int, java.lang.CharSequence);
|
||||
method public void onAuthenticationFailed();
|
||||
method public void onAuthenticationHelp(int, java.lang.CharSequence);
|
||||
method public void onAuthenticationSucceeded(android.hardware.biometrics.BiometricDialog.AuthenticationResult);
|
||||
method public void onAuthenticationSucceeded(android.hardware.biometrics.BiometricPrompt.AuthenticationResult);
|
||||
}
|
||||
|
||||
public static class BiometricDialog.AuthenticationResult {
|
||||
method public android.hardware.biometrics.BiometricDialog.CryptoObject getCryptoObject();
|
||||
public static class BiometricPrompt.AuthenticationResult {
|
||||
method public android.hardware.biometrics.BiometricPrompt.CryptoObject getCryptoObject();
|
||||
}
|
||||
|
||||
public static class BiometricDialog.Builder {
|
||||
ctor public BiometricDialog.Builder(android.content.Context);
|
||||
method public android.hardware.biometrics.BiometricDialog build();
|
||||
method public android.hardware.biometrics.BiometricDialog.Builder setDescription(java.lang.CharSequence);
|
||||
method public android.hardware.biometrics.BiometricDialog.Builder setNegativeButton(java.lang.CharSequence, java.util.concurrent.Executor, android.content.DialogInterface.OnClickListener);
|
||||
method public android.hardware.biometrics.BiometricDialog.Builder setSubtitle(java.lang.CharSequence);
|
||||
method public android.hardware.biometrics.BiometricDialog.Builder setTitle(java.lang.CharSequence);
|
||||
public static class BiometricPrompt.Builder {
|
||||
ctor public BiometricPrompt.Builder(android.content.Context);
|
||||
method public android.hardware.biometrics.BiometricPrompt build();
|
||||
method public android.hardware.biometrics.BiometricPrompt.Builder setDescription(java.lang.CharSequence);
|
||||
method public android.hardware.biometrics.BiometricPrompt.Builder setNegativeButton(java.lang.CharSequence, java.util.concurrent.Executor, android.content.DialogInterface.OnClickListener);
|
||||
method public android.hardware.biometrics.BiometricPrompt.Builder setSubtitle(java.lang.CharSequence);
|
||||
method public android.hardware.biometrics.BiometricPrompt.Builder setTitle(java.lang.CharSequence);
|
||||
}
|
||||
|
||||
public static final class BiometricDialog.CryptoObject {
|
||||
ctor public BiometricDialog.CryptoObject(java.security.Signature);
|
||||
ctor public BiometricDialog.CryptoObject(javax.crypto.Cipher);
|
||||
ctor public BiometricDialog.CryptoObject(javax.crypto.Mac);
|
||||
public static final class BiometricPrompt.CryptoObject {
|
||||
ctor public BiometricPrompt.CryptoObject(java.security.Signature);
|
||||
ctor public BiometricPrompt.CryptoObject(javax.crypto.Cipher);
|
||||
ctor public BiometricPrompt.CryptoObject(javax.crypto.Mac);
|
||||
method public javax.crypto.Cipher getCipher();
|
||||
method public javax.crypto.Mac getMac();
|
||||
method public java.security.Signature getSignature();
|
||||
|
||||
@@ -38,7 +38,7 @@ import javax.crypto.Mac;
|
||||
/**
|
||||
* A class that manages a system-provided biometric dialog.
|
||||
*/
|
||||
public class BiometricDialog implements BiometricAuthenticator, BiometricConstants {
|
||||
public class BiometricPrompt implements BiometricAuthenticator, BiometricConstants {
|
||||
|
||||
/**
|
||||
* @hide
|
||||
@@ -190,11 +190,11 @@ public class BiometricDialog implements BiometricAuthenticator, BiometricConstan
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a {@link BiometricDialog}.
|
||||
* @return a {@link BiometricDialog}
|
||||
* Creates a {@link BiometricPrompt}.
|
||||
* @return a {@link BiometricPrompt}
|
||||
* @throws IllegalArgumentException if any of the required fields are not set.
|
||||
*/
|
||||
public BiometricDialog build() {
|
||||
public BiometricPrompt build() {
|
||||
final CharSequence title = mBundle.getCharSequence(KEY_TITLE);
|
||||
final CharSequence negative = mBundle.getCharSequence(KEY_NEGATIVE_TEXT);
|
||||
|
||||
@@ -203,7 +203,7 @@ public class BiometricDialog implements BiometricAuthenticator, BiometricConstan
|
||||
} else if (TextUtils.isEmpty(negative)) {
|
||||
throw new IllegalArgumentException("Negative text must be set and non-empty");
|
||||
}
|
||||
return new BiometricDialog(mContext, mBundle, mPositiveButtonInfo, mNegativeButtonInfo);
|
||||
return new BiometricPrompt(mContext, mBundle, mPositiveButtonInfo, mNegativeButtonInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,7 +213,7 @@ public class BiometricDialog implements BiometricAuthenticator, BiometricConstan
|
||||
private ButtonInfo mPositiveButtonInfo;
|
||||
private ButtonInfo mNegativeButtonInfo;
|
||||
|
||||
IBiometricDialogReceiver mDialogReceiver = new IBiometricDialogReceiver.Stub() {
|
||||
IBiometricPromptReceiver mDialogReceiver = new IBiometricPromptReceiver.Stub() {
|
||||
@Override
|
||||
public void onDialogDismissed(int reason) {
|
||||
// Check the reason and invoke OnClickListener(s) if necessary
|
||||
@@ -229,7 +229,7 @@ public class BiometricDialog implements BiometricAuthenticator, BiometricConstan
|
||||
}
|
||||
};
|
||||
|
||||
private BiometricDialog(Context context, Bundle bundle,
|
||||
private BiometricPrompt(Context context, Bundle bundle,
|
||||
ButtonInfo positiveButtonInfo, ButtonInfo negativeButtonInfo) {
|
||||
mBundle = bundle;
|
||||
mPositiveButtonInfo = positiveButtonInfo;
|
||||
@@ -239,7 +239,7 @@ public class BiometricDialog implements BiometricAuthenticator, BiometricConstan
|
||||
}
|
||||
|
||||
/**
|
||||
* A wrapper class for the crypto objects supported by BiometricDialog. Currently the framework
|
||||
* A wrapper class for the crypto objects supported by BiometricPrompt. Currently the framework
|
||||
* supports {@link Signature}, {@link Cipher} and {@link Mac} objects.
|
||||
*/
|
||||
public static final class CryptoObject extends android.hardware.biometrics.CryptoObject {
|
||||
@@ -308,8 +308,8 @@ public class BiometricDialog implements BiometricAuthenticator, BiometricConstan
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback structure provided to {@link BiometricDialog#authenticate(CancellationSignal,
|
||||
* Executor, AuthenticationCallback)} or {@link BiometricDialog#authenticate(CryptoObject,
|
||||
* Callback structure provided to {@link BiometricPrompt#authenticate(CancellationSignal,
|
||||
* Executor, AuthenticationCallback)} or {@link BiometricPrompt#authenticate(CryptoObject,
|
||||
* CancellationSignal, Executor, AuthenticationCallback)}. Users must provide an implementation
|
||||
* of this for listening to authentication events.
|
||||
*/
|
||||
@@ -378,7 +378,7 @@ public class BiometricDialog implements BiometricAuthenticator, BiometricConstan
|
||||
@NonNull CancellationSignal cancel,
|
||||
@NonNull @CallbackExecutor Executor executor,
|
||||
@NonNull BiometricAuthenticator.AuthenticationCallback callback) {
|
||||
if (!(callback instanceof BiometricDialog.AuthenticationCallback)) {
|
||||
if (!(callback instanceof BiometricPrompt.AuthenticationCallback)) {
|
||||
throw new IllegalArgumentException("Callback cannot be casted");
|
||||
}
|
||||
authenticate(crypto, cancel, executor, (AuthenticationCallback) callback);
|
||||
@@ -395,7 +395,7 @@ public class BiometricDialog implements BiometricAuthenticator, BiometricConstan
|
||||
public void authenticate(@NonNull CancellationSignal cancel,
|
||||
@NonNull @CallbackExecutor Executor executor,
|
||||
@NonNull BiometricAuthenticator.AuthenticationCallback callback) {
|
||||
if (!(callback instanceof BiometricDialog.AuthenticationCallback)) {
|
||||
if (!(callback instanceof BiometricPrompt.AuthenticationCallback)) {
|
||||
throw new IllegalArgumentException("Callback cannot be casted");
|
||||
}
|
||||
authenticate(cancel, executor, (AuthenticationCallback) callback);
|
||||
@@ -410,8 +410,8 @@ public class BiometricDialog implements BiometricAuthenticator, BiometricConstan
|
||||
* operation can be canceled by using the provided cancel object. The application will receive
|
||||
* authentication errors through {@link AuthenticationCallback}, and button events through the
|
||||
* corresponding callback set in {@link Builder#setNegativeButton(CharSequence, Executor,
|
||||
* DialogInterface.OnClickListener)}. It is safe to reuse the {@link BiometricDialog} object,
|
||||
* and calling {@link BiometricDialog#authenticate( CancellationSignal, Executor,
|
||||
* DialogInterface.OnClickListener)}. It is safe to reuse the {@link BiometricPrompt} object,
|
||||
* and calling {@link BiometricPrompt#authenticate( CancellationSignal, Executor,
|
||||
* AuthenticationCallback)} while an existing authentication attempt is occurring will stop the
|
||||
* previous client and start a new authentication. The interrupted client will receive a
|
||||
* cancelled notification through {@link AuthenticationCallback#onAuthenticationError(int,
|
||||
@@ -445,8 +445,8 @@ public class BiometricDialog implements BiometricAuthenticator, BiometricConstan
|
||||
* provided cancel object. The application will receive authentication errors through {@link
|
||||
* AuthenticationCallback}, and button events through the corresponding callback set in {@link
|
||||
* Builder#setNegativeButton(CharSequence, Executor, DialogInterface.OnClickListener)}. It is
|
||||
* safe to reuse the {@link BiometricDialog} object, and calling {@link
|
||||
* BiometricDialog#authenticate(CancellationSignal, Executor, AuthenticationCallback)} while
|
||||
* safe to reuse the {@link BiometricPrompt} object, and calling {@link
|
||||
* BiometricPrompt#authenticate(CancellationSignal, Executor, AuthenticationCallback)} while
|
||||
* an existing authentication attempt is occurring will stop the previous client and start a new
|
||||
* authentication. The interrupted client will receive a cancelled notification through {@link
|
||||
* AuthenticationCallback#onAuthenticationError(int, CharSequence)}.
|
||||
@@ -470,15 +470,15 @@ public class BiometricDialog implements BiometricAuthenticator, BiometricConstan
|
||||
private boolean handlePreAuthenticationErrors(AuthenticationCallback callback,
|
||||
Executor executor) {
|
||||
if (!mPackageManager.hasSystemFeature(PackageManager.FEATURE_FINGERPRINT)) {
|
||||
sendError(BiometricDialog.BIOMETRIC_ERROR_HW_NOT_PRESENT, callback,
|
||||
sendError(BiometricPrompt.BIOMETRIC_ERROR_HW_NOT_PRESENT, callback,
|
||||
executor);
|
||||
return true;
|
||||
} else if (!mFingerprintManager.isHardwareDetected()) {
|
||||
sendError(BiometricDialog.BIOMETRIC_ERROR_HW_UNAVAILABLE, callback,
|
||||
sendError(BiometricPrompt.BIOMETRIC_ERROR_HW_UNAVAILABLE, callback,
|
||||
executor);
|
||||
return true;
|
||||
} else if (!mFingerprintManager.hasEnrolledFingerprints()) {
|
||||
sendError(BiometricDialog.BIOMETRIC_ERROR_NO_BIOMETRICS, callback,
|
||||
sendError(BiometricPrompt.BIOMETRIC_ERROR_NO_BIOMETRICS, callback,
|
||||
executor);
|
||||
return true;
|
||||
}
|
||||
@@ -19,9 +19,9 @@ import android.os.Bundle;
|
||||
import android.os.UserHandle;
|
||||
|
||||
/**
|
||||
* Communication channel from the BiometricDialog (SysUI) back to AuthenticationClient.
|
||||
* Communication channel from the BiometricPrompt (SysUI) back to AuthenticationClient.
|
||||
* @hide
|
||||
*/
|
||||
oneway interface IBiometricDialogReceiver {
|
||||
oneway interface IBiometricPromptReceiver {
|
||||
void onDialogDismissed(int reason);
|
||||
}
|
||||
@@ -31,9 +31,9 @@ import android.app.ActivityManager;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.hardware.biometrics.BiometricAuthenticator;
|
||||
import android.hardware.biometrics.BiometricDialog;
|
||||
import android.hardware.biometrics.BiometricFingerprintConstants;
|
||||
import android.hardware.biometrics.IBiometricDialogReceiver;
|
||||
import android.hardware.biometrics.BiometricPrompt;
|
||||
import android.hardware.biometrics.IBiometricPromptReceiver;
|
||||
import android.os.Binder;
|
||||
import android.os.Bundle;
|
||||
import android.os.CancellationSignal;
|
||||
@@ -57,7 +57,7 @@ import javax.crypto.Mac;
|
||||
|
||||
/**
|
||||
* A class that coordinates access to the fingerprint hardware.
|
||||
* @deprecated See {@link BiometricDialog} which shows a system-provided dialog upon starting
|
||||
* @deprecated See {@link BiometricPrompt} which shows a system-provided dialog upon starting
|
||||
* authentication. In a world where devices may have different types of biometric authentication,
|
||||
* it's much more realistic to have a system-provided authentication dialog since the method may
|
||||
* vary by vendor/device.
|
||||
@@ -111,7 +111,7 @@ public class FingerprintManager implements BiometricFingerprintConstants {
|
||||
/**
|
||||
* A wrapper class for the crypto objects supported by FingerprintManager. Currently the
|
||||
* framework supports {@link Signature}, {@link Cipher} and {@link Mac} objects.
|
||||
* @deprecated See {@link android.hardware.biometrics.BiometricDialog.CryptoObject}
|
||||
* @deprecated See {@link android.hardware.biometrics.BiometricPrompt.CryptoObject}
|
||||
*/
|
||||
@Deprecated
|
||||
public static final class CryptoObject extends android.hardware.biometrics.CryptoObject {
|
||||
@@ -155,7 +155,7 @@ public class FingerprintManager implements BiometricFingerprintConstants {
|
||||
/**
|
||||
* Container for callback data from {@link FingerprintManager#authenticate(CryptoObject,
|
||||
* CancellationSignal, int, AuthenticationCallback, Handler)}.
|
||||
* @deprecated See {@link android.hardware.biometrics.BiometricDialog.AuthenticationResult}
|
||||
* @deprecated See {@link android.hardware.biometrics.BiometricPrompt.AuthenticationResult}
|
||||
*/
|
||||
@Deprecated
|
||||
public static class AuthenticationResult {
|
||||
@@ -204,7 +204,7 @@ public class FingerprintManager implements BiometricFingerprintConstants {
|
||||
* FingerprintManager#authenticate(CryptoObject, CancellationSignal,
|
||||
* int, AuthenticationCallback, Handler) } must provide an implementation of this for listening to
|
||||
* fingerprint events.
|
||||
* @deprecated See {@link android.hardware.biometrics.BiometricDialog.AuthenticationCallback}
|
||||
* @deprecated See {@link android.hardware.biometrics.BiometricPrompt.AuthenticationCallback}
|
||||
*/
|
||||
@Deprecated
|
||||
public static abstract class AuthenticationCallback
|
||||
@@ -378,10 +378,10 @@ public class FingerprintManager implements BiometricFingerprintConstants {
|
||||
* by <a href="{@docRoot}training/articles/keystore.html">Android Keystore
|
||||
* facility</a>.
|
||||
* @throws IllegalStateException if the crypto primitive is not initialized.
|
||||
* @deprecated See {@link BiometricDialog#authenticate(CancellationSignal, Executor,
|
||||
* BiometricDialog.AuthenticationCallback)} and {@link BiometricDialog#authenticate(
|
||||
* BiometricDialog.CryptoObject, CancellationSignal, Executor,
|
||||
* BiometricDialog.AuthenticationCallback)}
|
||||
* @deprecated See {@link BiometricPrompt#authenticate(CancellationSignal, Executor,
|
||||
* BiometricPrompt.AuthenticationCallback)} and {@link BiometricPrompt#authenticate(
|
||||
* BiometricPrompt.CryptoObject, CancellationSignal, Executor,
|
||||
* BiometricPrompt.AuthenticationCallback)}
|
||||
*/
|
||||
@Deprecated
|
||||
@RequiresPermission(anyOf = {USE_BIOMETRIC, USE_FINGERPRINT})
|
||||
@@ -444,7 +444,7 @@ public class FingerprintManager implements BiometricFingerprintConstants {
|
||||
|
||||
/**
|
||||
* Per-user version, see {@link FingerprintManager#authenticate(CryptoObject,
|
||||
* CancellationSignal, Bundle, Executor, IBiometricDialogReceiver, AuthenticationCallback)}
|
||||
* CancellationSignal, Bundle, Executor, IBiometricPromptReceiver, AuthenticationCallback)}
|
||||
* @param userId the user ID that the fingerprint hardware will authenticate for.
|
||||
*/
|
||||
private void authenticate(int userId,
|
||||
@@ -452,7 +452,7 @@ public class FingerprintManager implements BiometricFingerprintConstants {
|
||||
@NonNull CancellationSignal cancel,
|
||||
@NonNull Bundle bundle,
|
||||
@NonNull @CallbackExecutor Executor executor,
|
||||
@NonNull IBiometricDialogReceiver receiver,
|
||||
@NonNull IBiometricPromptReceiver receiver,
|
||||
@NonNull BiometricAuthenticator.AuthenticationCallback callback) {
|
||||
mCryptoObject = crypto;
|
||||
if (cancel.isCanceled()) {
|
||||
@@ -480,8 +480,8 @@ public class FingerprintManager implements BiometricFingerprintConstants {
|
||||
}
|
||||
|
||||
/**
|
||||
* Private method, see {@link BiometricDialog#authenticate(CancellationSignal, Executor,
|
||||
* BiometricDialog.AuthenticationCallback)}
|
||||
* Private method, see {@link BiometricPrompt#authenticate(CancellationSignal, Executor,
|
||||
* BiometricPrompt.AuthenticationCallback)}
|
||||
* @param cancel
|
||||
* @param executor
|
||||
* @param callback
|
||||
@@ -491,7 +491,7 @@ public class FingerprintManager implements BiometricFingerprintConstants {
|
||||
@NonNull CancellationSignal cancel,
|
||||
@NonNull Bundle bundle,
|
||||
@NonNull @CallbackExecutor Executor executor,
|
||||
@NonNull IBiometricDialogReceiver receiver,
|
||||
@NonNull IBiometricPromptReceiver receiver,
|
||||
@NonNull BiometricAuthenticator.AuthenticationCallback callback) {
|
||||
if (cancel == null) {
|
||||
throw new IllegalArgumentException("Must supply a cancellation signal");
|
||||
@@ -512,8 +512,8 @@ public class FingerprintManager implements BiometricFingerprintConstants {
|
||||
}
|
||||
|
||||
/**
|
||||
* Private method, see {@link BiometricDialog#authenticate(BiometricDialog.CryptoObject,
|
||||
* CancellationSignal, Executor, BiometricDialog.AuthenticationCallback)}
|
||||
* Private method, see {@link BiometricPrompt#authenticate(BiometricPrompt.CryptoObject,
|
||||
* CancellationSignal, Executor, BiometricPrompt.AuthenticationCallback)}
|
||||
* @param crypto
|
||||
* @param cancel
|
||||
* @param executor
|
||||
@@ -524,7 +524,7 @@ public class FingerprintManager implements BiometricFingerprintConstants {
|
||||
@NonNull CancellationSignal cancel,
|
||||
@NonNull Bundle bundle,
|
||||
@NonNull @CallbackExecutor Executor executor,
|
||||
@NonNull IBiometricDialogReceiver receiver,
|
||||
@NonNull IBiometricPromptReceiver receiver,
|
||||
@NonNull BiometricAuthenticator.AuthenticationCallback callback) {
|
||||
if (crypto == null) {
|
||||
throw new IllegalArgumentException("Must supply a crypto object");
|
||||
@@ -743,7 +743,7 @@ public class FingerprintManager implements BiometricFingerprintConstants {
|
||||
* Determine if there is at least one fingerprint enrolled.
|
||||
*
|
||||
* @return true if at least one fingerprint is enrolled, false otherwise
|
||||
* @deprecated See {@link BiometricDialog} and
|
||||
* @deprecated See {@link BiometricPrompt} and
|
||||
* {@link FingerprintManager#FINGERPRINT_ERROR_NO_FINGERPRINTS}
|
||||
*/
|
||||
@Deprecated
|
||||
@@ -777,7 +777,7 @@ public class FingerprintManager implements BiometricFingerprintConstants {
|
||||
* Determine if fingerprint hardware is present and functional.
|
||||
*
|
||||
* @return true if hardware is present and functional, false otherwise.
|
||||
* @deprecated See {@link BiometricDialog} and
|
||||
* @deprecated See {@link BiometricPrompt} and
|
||||
* {@link FingerprintManager#FINGERPRINT_ERROR_HW_UNAVAILABLE}
|
||||
*/
|
||||
@Deprecated
|
||||
@@ -1158,7 +1158,7 @@ public class FingerprintManager implements BiometricFingerprintConstants {
|
||||
@Override // binder call
|
||||
public void onError(long deviceId, int error, int vendorCode) {
|
||||
if (mExecutor != null) {
|
||||
// BiometricDialog case
|
||||
// BiometricPrompt case
|
||||
if (error == FingerprintManager.FINGERPRINT_ERROR_USER_CANCELED) {
|
||||
// User tapped somewhere to cancel, the biometric dialog is already dismissed.
|
||||
mExecutor.execute(() -> {
|
||||
@@ -1172,7 +1172,7 @@ public class FingerprintManager implements BiometricFingerprintConstants {
|
||||
mExecutor.execute(() -> {
|
||||
sendErrorResult(deviceId, error, vendorCode);
|
||||
});
|
||||
}, BiometricDialog.HIDE_DIALOG_DELAY);
|
||||
}, BiometricPrompt.HIDE_DIALOG_DELAY);
|
||||
}
|
||||
} else {
|
||||
mHandler.obtainMessage(MSG_ERROR, error, vendorCode, deviceId).sendToTarget();
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
package android.hardware.fingerprint;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.hardware.biometrics.IBiometricDialogReceiver;
|
||||
import android.hardware.biometrics.IBiometricPromptReceiver;
|
||||
import android.hardware.fingerprint.IFingerprintClientActiveCallback;
|
||||
import android.hardware.fingerprint.IFingerprintServiceReceiver;
|
||||
import android.hardware.fingerprint.IFingerprintServiceLockoutResetCallback;
|
||||
@@ -31,7 +31,7 @@ interface IFingerprintService {
|
||||
// Authenticate the given sessionId with a fingerprint
|
||||
void authenticate(IBinder token, long sessionId, int userId,
|
||||
IFingerprintServiceReceiver receiver, int flags, String opPackageName,
|
||||
in Bundle bundle, IBiometricDialogReceiver dialogReceiver);
|
||||
in Bundle bundle, IBiometricPromptReceiver dialogReceiver);
|
||||
|
||||
// Cancel authentication for the given sessionId
|
||||
void cancelAuthentication(IBinder token, String opPackageName);
|
||||
|
||||
@@ -18,7 +18,7 @@ package com.android.internal.statusbar;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.graphics.Rect;
|
||||
import android.hardware.biometrics.IBiometricDialogReceiver;
|
||||
import android.hardware.biometrics.IBiometricPromptReceiver;
|
||||
import android.os.Bundle;
|
||||
import android.service.notification.StatusBarNotification;
|
||||
|
||||
@@ -141,7 +141,7 @@ oneway interface IStatusBar
|
||||
void showShutdownUi(boolean isReboot, String reason);
|
||||
|
||||
// Used to show the dialog when FingerprintService starts authentication
|
||||
void showFingerprintDialog(in Bundle bundle, IBiometricDialogReceiver receiver);
|
||||
void showFingerprintDialog(in Bundle bundle, IBiometricPromptReceiver receiver);
|
||||
// Used to hide the dialog when a finger is authenticated
|
||||
void onFingerprintAuthenticated();
|
||||
// Used to set a temporary message, e.g. fingerprint not recognized, finger moved too fast, etc
|
||||
|
||||
@@ -20,7 +20,7 @@ import android.content.ComponentName;
|
||||
import android.graphics.Rect;
|
||||
import android.os.Bundle;
|
||||
import android.service.notification.StatusBarNotification;
|
||||
import android.hardware.biometrics.IBiometricDialogReceiver;
|
||||
import android.hardware.biometrics.IBiometricPromptReceiver;
|
||||
|
||||
import com.android.internal.statusbar.IStatusBar;
|
||||
import com.android.internal.statusbar.StatusBarIcon;
|
||||
@@ -88,7 +88,7 @@ interface IStatusBarService
|
||||
void showPinningEscapeToast();
|
||||
|
||||
// Used to show the dialog when FingerprintService starts authentication
|
||||
void showFingerprintDialog(in Bundle bundle, IBiometricDialogReceiver receiver);
|
||||
void showFingerprintDialog(in Bundle bundle, IBiometricPromptReceiver receiver);
|
||||
// Used to hide the dialog when a finger is authenticated
|
||||
void onFingerprintAuthenticated();
|
||||
// Used to set a temporary message, e.g. fingerprint not recognized, finger moved too fast, etc
|
||||
|
||||
@@ -18,8 +18,8 @@ package com.android.systemui.fingerprint;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.hardware.biometrics.BiometricDialog;
|
||||
import android.hardware.biometrics.IBiometricDialogReceiver;
|
||||
import android.hardware.biometrics.BiometricPrompt;
|
||||
import android.hardware.biometrics.IBiometricPromptReceiver;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
@@ -48,7 +48,7 @@ public class FingerprintDialogImpl extends SystemUI implements CommandQueue.Call
|
||||
|
||||
private FingerprintDialogView mDialogView;
|
||||
private WindowManager mWindowManager;
|
||||
private IBiometricDialogReceiver mReceiver;
|
||||
private IBiometricPromptReceiver mReceiver;
|
||||
private boolean mDialogShowing;
|
||||
|
||||
private Handler mHandler = new Handler() {
|
||||
@@ -97,7 +97,7 @@ public class FingerprintDialogImpl extends SystemUI implements CommandQueue.Call
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showFingerprintDialog(Bundle bundle, IBiometricDialogReceiver receiver) {
|
||||
public void showFingerprintDialog(Bundle bundle, IBiometricPromptReceiver receiver) {
|
||||
if (DEBUG) Log.d(TAG, "showFingerprintDialog");
|
||||
// Remove these messages as they are part of the previous client
|
||||
mHandler.removeMessages(MSG_FINGERPRINT_ERROR);
|
||||
@@ -139,7 +139,7 @@ public class FingerprintDialogImpl extends SystemUI implements CommandQueue.Call
|
||||
Log.w(TAG, "Dialog already showing");
|
||||
return;
|
||||
}
|
||||
mReceiver = (IBiometricDialogReceiver) args.arg2;
|
||||
mReceiver = (IBiometricPromptReceiver) args.arg2;
|
||||
mDialogView.setBundle((Bundle)args.arg1);
|
||||
mWindowManager.addView(mDialogView, mDialogView.getLayoutParams());
|
||||
mDialogShowing = true;
|
||||
@@ -177,7 +177,7 @@ public class FingerprintDialogImpl extends SystemUI implements CommandQueue.Call
|
||||
}
|
||||
if (userCanceled) {
|
||||
try {
|
||||
mReceiver.onDialogDismissed(BiometricDialog.DISMISSED_REASON_USER_CANCEL);
|
||||
mReceiver.onDialogDismissed(BiometricPrompt.DISMISSED_REASON_USER_CANCEL);
|
||||
} catch (RemoteException e) {
|
||||
Log.e(TAG, "RemoteException when hiding dialog", e);
|
||||
}
|
||||
@@ -193,7 +193,7 @@ public class FingerprintDialogImpl extends SystemUI implements CommandQueue.Call
|
||||
return;
|
||||
}
|
||||
try {
|
||||
mReceiver.onDialogDismissed(BiometricDialog.DISMISSED_REASON_NEGATIVE);
|
||||
mReceiver.onDialogDismissed(BiometricPrompt.DISMISSED_REASON_NEGATIVE);
|
||||
} catch (RemoteException e) {
|
||||
Log.e(TAG, "Remote exception when handling negative button", e);
|
||||
}
|
||||
@@ -206,7 +206,7 @@ public class FingerprintDialogImpl extends SystemUI implements CommandQueue.Call
|
||||
return;
|
||||
}
|
||||
try {
|
||||
mReceiver.onDialogDismissed(BiometricDialog.DISMISSED_REASON_POSITIVE);
|
||||
mReceiver.onDialogDismissed(BiometricPrompt.DISMISSED_REASON_POSITIVE);
|
||||
} catch (RemoteException e) {
|
||||
Log.e(TAG, "Remote exception when handling positive button", e);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ import android.graphics.PixelFormat;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.drawable.AnimatedVectorDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.hardware.biometrics.BiometricDialog;
|
||||
import android.hardware.biometrics.BiometricPrompt;
|
||||
import android.os.Binder;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
@@ -161,10 +161,10 @@ public class FingerprintDialogView extends LinearLayout {
|
||||
mLastState = STATE_NONE;
|
||||
updateFingerprintIcon(STATE_FINGERPRINT);
|
||||
|
||||
title.setText(mBundle.getCharSequence(BiometricDialog.KEY_TITLE));
|
||||
title.setText(mBundle.getCharSequence(BiometricPrompt.KEY_TITLE));
|
||||
title.setSelected(true);
|
||||
|
||||
final CharSequence subtitleText = mBundle.getCharSequence(BiometricDialog.KEY_SUBTITLE);
|
||||
final CharSequence subtitleText = mBundle.getCharSequence(BiometricPrompt.KEY_SUBTITLE);
|
||||
if (subtitleText == null) {
|
||||
subtitle.setVisibility(View.GONE);
|
||||
} else {
|
||||
@@ -172,18 +172,18 @@ public class FingerprintDialogView extends LinearLayout {
|
||||
subtitle.setText(subtitleText);
|
||||
}
|
||||
|
||||
final CharSequence descriptionText = mBundle.getCharSequence(BiometricDialog.KEY_DESCRIPTION);
|
||||
final CharSequence descriptionText = mBundle.getCharSequence(BiometricPrompt.KEY_DESCRIPTION);
|
||||
if (descriptionText == null) {
|
||||
subtitle.setVisibility(View.VISIBLE);
|
||||
description.setVisibility(View.GONE);
|
||||
} else {
|
||||
description.setText(mBundle.getCharSequence(BiometricDialog.KEY_DESCRIPTION));
|
||||
description.setText(mBundle.getCharSequence(BiometricPrompt.KEY_DESCRIPTION));
|
||||
}
|
||||
|
||||
negative.setText(mBundle.getCharSequence(BiometricDialog.KEY_NEGATIVE_TEXT));
|
||||
negative.setText(mBundle.getCharSequence(BiometricPrompt.KEY_NEGATIVE_TEXT));
|
||||
|
||||
final CharSequence positiveText =
|
||||
mBundle.getCharSequence(BiometricDialog.KEY_POSITIVE_TEXT);
|
||||
mBundle.getCharSequence(BiometricPrompt.KEY_POSITIVE_TEXT);
|
||||
positive.setText(positiveText); // needs to be set for marquee to work
|
||||
if (positiveText != null) {
|
||||
positive.setVisibility(View.VISIBLE);
|
||||
@@ -269,7 +269,7 @@ public class FingerprintDialogView extends LinearLayout {
|
||||
mErrorText.setTextColor(mErrorColor);
|
||||
mErrorText.setContentDescription(message);
|
||||
mHandler.sendMessageDelayed(mHandler.obtainMessage(FingerprintDialogImpl.MSG_CLEAR_MESSAGE),
|
||||
BiometricDialog.HIDE_DIALOG_DELAY);
|
||||
BiometricPrompt.HIDE_DIALOG_DELAY);
|
||||
}
|
||||
|
||||
public void showHelpMessage(String message) {
|
||||
@@ -279,7 +279,7 @@ public class FingerprintDialogView extends LinearLayout {
|
||||
public void showErrorMessage(String error) {
|
||||
showTemporaryMessage(error);
|
||||
mHandler.sendMessageDelayed(mHandler.obtainMessage(FingerprintDialogImpl.MSG_HIDE_DIALOG,
|
||||
false /* userCanceled */), BiometricDialog.HIDE_DIALOG_DELAY);
|
||||
false /* userCanceled */), BiometricPrompt.HIDE_DIALOG_DELAY);
|
||||
}
|
||||
|
||||
private void updateFingerprintIcon(int newState) {
|
||||
|
||||
@@ -18,7 +18,7 @@ package com.android.systemui.statusbar;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.graphics.Rect;
|
||||
import android.hardware.biometrics.IBiometricDialogReceiver;
|
||||
import android.hardware.biometrics.IBiometricPromptReceiver;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.IBinder;
|
||||
@@ -160,7 +160,7 @@ public class CommandQueue extends IStatusBar.Stub {
|
||||
|
||||
default void onRotationProposal(int rotation, boolean isValid) { }
|
||||
|
||||
default void showFingerprintDialog(Bundle bundle, IBiometricDialogReceiver receiver) { }
|
||||
default void showFingerprintDialog(Bundle bundle, IBiometricPromptReceiver receiver) { }
|
||||
default void onFingerprintAuthenticated() { }
|
||||
default void onFingerprintHelp(String message) { }
|
||||
default void onFingerprintError(String error) { }
|
||||
@@ -513,7 +513,7 @@ public class CommandQueue extends IStatusBar.Stub {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showFingerprintDialog(Bundle bundle, IBiometricDialogReceiver receiver) {
|
||||
public void showFingerprintDialog(Bundle bundle, IBiometricPromptReceiver receiver) {
|
||||
synchronized (mLock) {
|
||||
SomeArgs args = SomeArgs.obtain();
|
||||
args.arg1 = bundle;
|
||||
@@ -759,7 +759,7 @@ public class CommandQueue extends IStatusBar.Stub {
|
||||
for (int i = 0; i < mCallbacks.size(); i++) {
|
||||
mCallbacks.get(i).showFingerprintDialog(
|
||||
(Bundle)((SomeArgs)msg.obj).arg1,
|
||||
(IBiometricDialogReceiver)((SomeArgs)msg.obj).arg2);
|
||||
(IBiometricPromptReceiver)((SomeArgs)msg.obj).arg2);
|
||||
}
|
||||
break;
|
||||
case MSG_FINGERPRINT_AUTHENTICATED:
|
||||
|
||||
@@ -18,8 +18,8 @@ package com.android.server.fingerprint;
|
||||
|
||||
import android.content.Context;
|
||||
import android.hardware.biometrics.fingerprint.V2_1.IBiometricsFingerprint;
|
||||
import android.hardware.biometrics.BiometricDialog;
|
||||
import android.hardware.biometrics.IBiometricDialogReceiver;
|
||||
import android.hardware.biometrics.BiometricPrompt;
|
||||
import android.hardware.biometrics.IBiometricPromptReceiver;
|
||||
import android.hardware.fingerprint.Fingerprint;
|
||||
import android.hardware.fingerprint.FingerprintManager;
|
||||
import android.hardware.fingerprint.IFingerprintServiceReceiver;
|
||||
@@ -46,8 +46,8 @@ public abstract class AuthenticationClient extends ClientMonitor {
|
||||
public static final int LOCKOUT_PERMANENT = 2;
|
||||
|
||||
// Callback mechanism received from the client
|
||||
// (BiometricDialog -> FingerprintManager -> FingerprintService -> AuthenticationClient)
|
||||
private IBiometricDialogReceiver mDialogReceiverFromClient;
|
||||
// (BiometricPrompt -> FingerprintManager -> FingerprintService -> AuthenticationClient)
|
||||
private IBiometricPromptReceiver mDialogReceiverFromClient;
|
||||
private Bundle mBundle;
|
||||
private IStatusBarService mStatusBarService;
|
||||
private boolean mInLockout;
|
||||
@@ -55,13 +55,13 @@ public abstract class AuthenticationClient extends ClientMonitor {
|
||||
protected boolean mDialogDismissed;
|
||||
|
||||
// Receives events from SystemUI and handles them before forwarding them to FingerprintDialog
|
||||
protected IBiometricDialogReceiver mDialogReceiver = new IBiometricDialogReceiver.Stub() {
|
||||
protected IBiometricPromptReceiver mDialogReceiver = new IBiometricPromptReceiver.Stub() {
|
||||
@Override // binder call
|
||||
public void onDialogDismissed(int reason) {
|
||||
if (mBundle != null && mDialogReceiverFromClient != null) {
|
||||
try {
|
||||
mDialogReceiverFromClient.onDialogDismissed(reason);
|
||||
if (reason == BiometricDialog.DISMISSED_REASON_USER_CANCEL) {
|
||||
if (reason == BiometricPrompt.DISMISSED_REASON_USER_CANCEL) {
|
||||
onError(FingerprintManager.FINGERPRINT_ERROR_USER_CANCELED,
|
||||
0 /* vendorCode */);
|
||||
}
|
||||
@@ -88,7 +88,7 @@ public abstract class AuthenticationClient extends ClientMonitor {
|
||||
public AuthenticationClient(Context context, long halDeviceId, IBinder token,
|
||||
IFingerprintServiceReceiver receiver, int targetUserId, int groupId, long opId,
|
||||
boolean restricted, String owner, Bundle bundle,
|
||||
IBiometricDialogReceiver dialogReceiver, IStatusBarService statusBarService) {
|
||||
IBiometricPromptReceiver dialogReceiver, IStatusBarService statusBarService) {
|
||||
super(context, halDeviceId, token, receiver, targetUserId, groupId, restricted, owner);
|
||||
mOpId = opId;
|
||||
mBundle = bundle;
|
||||
@@ -299,7 +299,7 @@ public abstract class AuthenticationClient extends ClientMonitor {
|
||||
// If the user already cancelled authentication (via some interaction with the
|
||||
// dialog, we do not need to hide it since it's already hidden.
|
||||
// If the device is in lockout, don't hide the dialog - it will automatically hide
|
||||
// after BiometricDialog.HIDE_DIALOG_DELAY
|
||||
// after BiometricPrompt.HIDE_DIALOG_DELAY
|
||||
if (mBundle != null && !mDialogDismissed && !mInLockout) {
|
||||
try {
|
||||
mStatusBarService.hideFingerprintDialog();
|
||||
|
||||
@@ -38,7 +38,7 @@ import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.UserInfo;
|
||||
import android.hardware.biometrics.IBiometricDialogReceiver;
|
||||
import android.hardware.biometrics.IBiometricPromptReceiver;
|
||||
import android.hardware.biometrics.fingerprint.V2_1.IBiometricsFingerprint;
|
||||
import android.hardware.biometrics.fingerprint.V2_1.IBiometricsFingerprintClientCallback;
|
||||
import android.hardware.fingerprint.Fingerprint;
|
||||
@@ -849,7 +849,7 @@ public class FingerprintService extends SystemService implements IHwBinder.Death
|
||||
|
||||
private void startAuthentication(IBinder token, long opId, int callingUserId, int groupId,
|
||||
IFingerprintServiceReceiver receiver, int flags, boolean restricted,
|
||||
String opPackageName, Bundle bundle, IBiometricDialogReceiver dialogReceiver) {
|
||||
String opPackageName, Bundle bundle, IBiometricPromptReceiver dialogReceiver) {
|
||||
updateActiveGroup(groupId, opPackageName);
|
||||
|
||||
if (DEBUG) Slog.v(TAG, "startAuthentication(" + opPackageName + ")");
|
||||
@@ -1160,7 +1160,7 @@ public class FingerprintService extends SystemService implements IHwBinder.Death
|
||||
public void authenticate(final IBinder token, final long opId, final int groupId,
|
||||
final IFingerprintServiceReceiver receiver, final int flags,
|
||||
final String opPackageName, final Bundle bundle,
|
||||
final IBiometricDialogReceiver dialogReceiver) {
|
||||
final IBiometricPromptReceiver dialogReceiver) {
|
||||
final int callingUid = Binder.getCallingUid();
|
||||
final int callingPid = Binder.getCallingPid();
|
||||
final int callingUserId = UserHandle.getCallingUserId();
|
||||
|
||||
@@ -23,7 +23,7 @@ import android.app.StatusBarManager;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.graphics.Rect;
|
||||
import android.hardware.biometrics.IBiometricDialogReceiver;
|
||||
import android.hardware.biometrics.IBiometricPromptReceiver;
|
||||
import android.os.Binder;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
@@ -547,7 +547,7 @@ public class StatusBarManagerService extends IStatusBarService.Stub {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showFingerprintDialog(Bundle bundle, IBiometricDialogReceiver receiver) {
|
||||
public void showFingerprintDialog(Bundle bundle, IBiometricPromptReceiver receiver) {
|
||||
if (mBar != null) {
|
||||
try {
|
||||
mBar.showFingerprintDialog(bundle, receiver);
|
||||
|
||||
Reference in New Issue
Block a user