Loading core/java/android/hardware/biometrics/BiometricPrompt.java +13 −0 Original line number Diff line number Diff line Loading @@ -407,6 +407,19 @@ public class BiometricPrompt implements BiometricAuthenticator, BiometricConstan return this; } /** * Flag to decide if authentication should ignore enrollment state. * Defaults to false (not ignoring enrollment state) * @param ignoreEnrollmentState * @return This builder. * @hide */ @NonNull public Builder setIgnoreEnrollmentState(boolean ignoreEnrollmentState) { mPromptInfo.setIgnoreEnrollmentState(ignoreEnrollmentState); return this; } /** * Creates a {@link BiometricPrompt}. * Loading core/java/android/hardware/biometrics/PromptInfo.java +11 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ public class PromptInfo implements Parcelable { private boolean mReceiveSystemEvents; @NonNull private List<Integer> mAllowedSensorIds = new ArrayList<>(); private boolean mAllowBackgroundAuthentication; private boolean mIgnoreEnrollmentState; public PromptInfo() { Loading @@ -66,6 +67,7 @@ public class PromptInfo implements Parcelable { mReceiveSystemEvents = in.readBoolean(); mAllowedSensorIds = in.readArrayList(Integer.class.getClassLoader()); mAllowBackgroundAuthentication = in.readBoolean(); mIgnoreEnrollmentState = in.readBoolean(); } public static final Creator<PromptInfo> CREATOR = new Creator<PromptInfo>() { Loading Loading @@ -102,6 +104,7 @@ public class PromptInfo implements Parcelable { dest.writeBoolean(mReceiveSystemEvents); dest.writeList(mAllowedSensorIds); dest.writeBoolean(mAllowBackgroundAuthentication); dest.writeBoolean(mIgnoreEnrollmentState); } public boolean containsTestConfigurations() { Loading Loading @@ -192,6 +195,10 @@ public class PromptInfo implements Parcelable { mAllowBackgroundAuthentication = allow; } public void setIgnoreEnrollmentState(boolean ignoreEnrollmentState) { mIgnoreEnrollmentState = ignoreEnrollmentState; } // Getters public CharSequence getTitle() { Loading Loading @@ -261,4 +268,8 @@ public class PromptInfo implements Parcelable { public boolean isAllowBackgroundAuthentication() { return mAllowBackgroundAuthentication; } public boolean isIgnoreEnrollmentState() { return mIgnoreEnrollmentState; } } core/java/android/hardware/fingerprint/FingerprintManager.java +7 −4 Original line number Diff line number Diff line Loading @@ -531,7 +531,7 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing @RequiresPermission(anyOf = {USE_BIOMETRIC, USE_FINGERPRINT}) public void authenticate(@Nullable CryptoObject crypto, @Nullable CancellationSignal cancel, int flags, @NonNull AuthenticationCallback callback, @Nullable Handler handler) { authenticate(crypto, cancel, callback, handler, mContext.getUserId()); authenticate(crypto, cancel, callback, handler, SENSOR_ID_ANY, mContext.getUserId(), flags); } /** Loading @@ -541,7 +541,7 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing @RequiresPermission(anyOf = {USE_BIOMETRIC, USE_FINGERPRINT}) public void authenticate(@Nullable CryptoObject crypto, @Nullable CancellationSignal cancel, @NonNull AuthenticationCallback callback, Handler handler, int userId) { authenticate(crypto, cancel, callback, handler, SENSOR_ID_ANY, userId); authenticate(crypto, cancel, callback, handler, SENSOR_ID_ANY, userId, 0 /* flags */); } /** Loading @@ -550,7 +550,8 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing */ @RequiresPermission(anyOf = {USE_BIOMETRIC, USE_FINGERPRINT}) public void authenticate(@Nullable CryptoObject crypto, @Nullable CancellationSignal cancel, @NonNull AuthenticationCallback callback, Handler handler, int sensorId, int userId) { @NonNull AuthenticationCallback callback, Handler handler, int sensorId, int userId, int flags) { FrameworkStatsLog.write(FrameworkStatsLog.AUTH_DEPRECATED_API_USED, AUTH_DEPRECATED_APIUSED__DEPRECATED_API__API_FINGERPRINT_MANAGER_AUTHENTICATE, Loading @@ -566,6 +567,8 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing return; } final boolean ignoreEnrollmentState = flags == 0 ? false : true; if (mService != null) { try { useHandler(handler); Loading @@ -573,7 +576,7 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing mCryptoObject = crypto; final long operationId = crypto != null ? crypto.getOpId() : 0; final long authId = mService.authenticate(mToken, operationId, sensorId, userId, mServiceReceiver, mContext.getOpPackageName()); mServiceReceiver, mContext.getOpPackageName(), ignoreEnrollmentState); if (cancel != null) { cancel.setOnCancelListener(new OnAuthenticationCancelListener(authId)); } Loading core/java/android/hardware/fingerprint/IFingerprintService.aidl +2 −1 Original line number Diff line number Diff line Loading @@ -52,7 +52,8 @@ interface IFingerprintService { // permission. This is effectively deprecated, since it only comes through FingerprintManager // now. A requestId is returned that can be used to cancel this operation. long authenticate(IBinder token, long operationId, int sensorId, int userId, IFingerprintServiceReceiver receiver, String opPackageName); IFingerprintServiceReceiver receiver, String opPackageName, boolean shouldIgnoreEnrollmentState); // Uses the fingerprint hardware to detect for the presence of a finger, without giving details // about accept/reject/lockout. A requestId is returned that can be used to cancel this Loading packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +1 −1 Original line number Diff line number Diff line Loading @@ -2407,7 +2407,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab } else { mFpm.authenticate(null /* crypto */, mFingerprintCancelSignal, mFingerprintAuthenticationCallback, null /* handler */, FingerprintManager.SENSOR_ID_ANY, userId); FingerprintManager.SENSOR_ID_ANY, userId, 0 /* flags */); } setFingerprintRunningState(BIOMETRIC_STATE_RUNNING); } Loading Loading
core/java/android/hardware/biometrics/BiometricPrompt.java +13 −0 Original line number Diff line number Diff line Loading @@ -407,6 +407,19 @@ public class BiometricPrompt implements BiometricAuthenticator, BiometricConstan return this; } /** * Flag to decide if authentication should ignore enrollment state. * Defaults to false (not ignoring enrollment state) * @param ignoreEnrollmentState * @return This builder. * @hide */ @NonNull public Builder setIgnoreEnrollmentState(boolean ignoreEnrollmentState) { mPromptInfo.setIgnoreEnrollmentState(ignoreEnrollmentState); return this; } /** * Creates a {@link BiometricPrompt}. * Loading
core/java/android/hardware/biometrics/PromptInfo.java +11 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ public class PromptInfo implements Parcelable { private boolean mReceiveSystemEvents; @NonNull private List<Integer> mAllowedSensorIds = new ArrayList<>(); private boolean mAllowBackgroundAuthentication; private boolean mIgnoreEnrollmentState; public PromptInfo() { Loading @@ -66,6 +67,7 @@ public class PromptInfo implements Parcelable { mReceiveSystemEvents = in.readBoolean(); mAllowedSensorIds = in.readArrayList(Integer.class.getClassLoader()); mAllowBackgroundAuthentication = in.readBoolean(); mIgnoreEnrollmentState = in.readBoolean(); } public static final Creator<PromptInfo> CREATOR = new Creator<PromptInfo>() { Loading Loading @@ -102,6 +104,7 @@ public class PromptInfo implements Parcelable { dest.writeBoolean(mReceiveSystemEvents); dest.writeList(mAllowedSensorIds); dest.writeBoolean(mAllowBackgroundAuthentication); dest.writeBoolean(mIgnoreEnrollmentState); } public boolean containsTestConfigurations() { Loading Loading @@ -192,6 +195,10 @@ public class PromptInfo implements Parcelable { mAllowBackgroundAuthentication = allow; } public void setIgnoreEnrollmentState(boolean ignoreEnrollmentState) { mIgnoreEnrollmentState = ignoreEnrollmentState; } // Getters public CharSequence getTitle() { Loading Loading @@ -261,4 +268,8 @@ public class PromptInfo implements Parcelable { public boolean isAllowBackgroundAuthentication() { return mAllowBackgroundAuthentication; } public boolean isIgnoreEnrollmentState() { return mIgnoreEnrollmentState; } }
core/java/android/hardware/fingerprint/FingerprintManager.java +7 −4 Original line number Diff line number Diff line Loading @@ -531,7 +531,7 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing @RequiresPermission(anyOf = {USE_BIOMETRIC, USE_FINGERPRINT}) public void authenticate(@Nullable CryptoObject crypto, @Nullable CancellationSignal cancel, int flags, @NonNull AuthenticationCallback callback, @Nullable Handler handler) { authenticate(crypto, cancel, callback, handler, mContext.getUserId()); authenticate(crypto, cancel, callback, handler, SENSOR_ID_ANY, mContext.getUserId(), flags); } /** Loading @@ -541,7 +541,7 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing @RequiresPermission(anyOf = {USE_BIOMETRIC, USE_FINGERPRINT}) public void authenticate(@Nullable CryptoObject crypto, @Nullable CancellationSignal cancel, @NonNull AuthenticationCallback callback, Handler handler, int userId) { authenticate(crypto, cancel, callback, handler, SENSOR_ID_ANY, userId); authenticate(crypto, cancel, callback, handler, SENSOR_ID_ANY, userId, 0 /* flags */); } /** Loading @@ -550,7 +550,8 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing */ @RequiresPermission(anyOf = {USE_BIOMETRIC, USE_FINGERPRINT}) public void authenticate(@Nullable CryptoObject crypto, @Nullable CancellationSignal cancel, @NonNull AuthenticationCallback callback, Handler handler, int sensorId, int userId) { @NonNull AuthenticationCallback callback, Handler handler, int sensorId, int userId, int flags) { FrameworkStatsLog.write(FrameworkStatsLog.AUTH_DEPRECATED_API_USED, AUTH_DEPRECATED_APIUSED__DEPRECATED_API__API_FINGERPRINT_MANAGER_AUTHENTICATE, Loading @@ -566,6 +567,8 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing return; } final boolean ignoreEnrollmentState = flags == 0 ? false : true; if (mService != null) { try { useHandler(handler); Loading @@ -573,7 +576,7 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing mCryptoObject = crypto; final long operationId = crypto != null ? crypto.getOpId() : 0; final long authId = mService.authenticate(mToken, operationId, sensorId, userId, mServiceReceiver, mContext.getOpPackageName()); mServiceReceiver, mContext.getOpPackageName(), ignoreEnrollmentState); if (cancel != null) { cancel.setOnCancelListener(new OnAuthenticationCancelListener(authId)); } Loading
core/java/android/hardware/fingerprint/IFingerprintService.aidl +2 −1 Original line number Diff line number Diff line Loading @@ -52,7 +52,8 @@ interface IFingerprintService { // permission. This is effectively deprecated, since it only comes through FingerprintManager // now. A requestId is returned that can be used to cancel this operation. long authenticate(IBinder token, long operationId, int sensorId, int userId, IFingerprintServiceReceiver receiver, String opPackageName); IFingerprintServiceReceiver receiver, String opPackageName, boolean shouldIgnoreEnrollmentState); // Uses the fingerprint hardware to detect for the presence of a finger, without giving details // about accept/reject/lockout. A requestId is returned that can be used to cancel this Loading
packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +1 −1 Original line number Diff line number Diff line Loading @@ -2407,7 +2407,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab } else { mFpm.authenticate(null /* crypto */, mFingerprintCancelSignal, mFingerprintAuthenticationCallback, null /* handler */, FingerprintManager.SENSOR_ID_ANY, userId); FingerprintManager.SENSOR_ID_ANY, userId, 0 /* flags */); } setFingerprintRunningState(BIOMETRIC_STATE_RUNNING); } Loading