summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/android/settings/password/BiometricFragment.java8
-rw-r--r--src/com/android/settings/password/ConfirmDeviceCredentialActivity.java5
2 files changed, 12 insertions, 1 deletions
diff --git a/src/com/android/settings/password/BiometricFragment.java b/src/com/android/settings/password/BiometricFragment.java
index bd5a10de46..66b665b337 100644
--- a/src/com/android/settings/password/BiometricFragment.java
+++ b/src/com/android/settings/password/BiometricFragment.java
@@ -58,11 +58,13 @@ public class BiometricFragment extends InstrumentedFragment {
private Bundle mBundle;
private BiometricPrompt mBiometricPrompt;
private CancellationSignal mCancellationSignal;
+ private boolean mAuthenticating;
private AuthenticationCallback mAuthenticationCallback =
new AuthenticationCallback() {
@Override
public void onAuthenticationError(int error, @NonNull CharSequence message) {
+ mAuthenticating = false;
mClientExecutor.execute(() -> {
mClientCallback.onAuthenticationError(error, message);
});
@@ -71,6 +73,7 @@ public class BiometricFragment extends InstrumentedFragment {
@Override
public void onAuthenticationSucceeded(AuthenticationResult result) {
+ mAuthenticating = false;
mClientExecutor.execute(() -> {
mClientCallback.onAuthenticationSucceeded(result);
});
@@ -134,6 +137,10 @@ public class BiometricFragment extends InstrumentedFragment {
}
}
+ boolean isAuthenticating() {
+ return mAuthenticating;
+ }
+
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -180,6 +187,7 @@ public class BiometricFragment extends InstrumentedFragment {
mCancellationSignal = new CancellationSignal();
// TODO: CC doesn't use crypto for now
+ mAuthenticating = true;
mBiometricPrompt.authenticateUser(mCancellationSignal, mClientExecutor,
mAuthenticationCallback, mUserId, mCancelCallback);
}
diff --git a/src/com/android/settings/password/ConfirmDeviceCredentialActivity.java b/src/com/android/settings/password/ConfirmDeviceCredentialActivity.java
index 53841e89be..8476f92429 100644
--- a/src/com/android/settings/password/ConfirmDeviceCredentialActivity.java
+++ b/src/com/android/settings/password/ConfirmDeviceCredentialActivity.java
@@ -251,7 +251,10 @@ public class ConfirmDeviceCredentialActivity extends FragmentActivity {
if (!isChangingConfigurations()) {
mGoingToBackground = true;
if (mBiometricFragment != null) {
- mBiometricFragment.cancel();
+ Log.d(TAG, "Authenticating: " + mBiometricFragment.isAuthenticating());
+ if (mBiometricFragment.isAuthenticating()) {
+ mBiometricFragment.cancel();
+ }
}
if (mIsFallback && !mCCLaunched) {