Delay invoking biometric prompt.
Fix: 169323687 Test: manual Change-Id: Iff00caaace97df6da476fd429ebf24bb6b1e14e1
This commit is contained in:
@@ -47,7 +47,6 @@ public class BiometricFragment extends InstrumentedFragment {
|
||||
private int mUserId;
|
||||
|
||||
// Created/Initialized once and retained
|
||||
private PromptInfo mPromptInfo;
|
||||
private BiometricPrompt mBiometricPrompt;
|
||||
private CancellationSignal mCancellationSignal;
|
||||
|
||||
@@ -127,7 +126,7 @@ public class BiometricFragment extends InstrumentedFragment {
|
||||
final Bundle bundle = getArguments();
|
||||
final PromptInfo promptInfo = bundle.getParcelable(KEY_PROMPT_INFO);
|
||||
|
||||
final BiometricPrompt.Builder builder = new BiometricPrompt.Builder(getContext())
|
||||
mBiometricPrompt = new BiometricPrompt.Builder(getContext())
|
||||
.setTitle(promptInfo.getTitle())
|
||||
.setUseDefaultTitle() // use default title if title is null/empty
|
||||
.setDeviceCredentialAllowed(true)
|
||||
@@ -140,18 +139,23 @@ public class BiometricFragment extends InstrumentedFragment {
|
||||
.setConfirmationRequired(promptInfo.isConfirmationRequested())
|
||||
.setDisallowBiometricsIfPolicyExists(
|
||||
promptInfo.isDisallowBiometricsIfPolicyExists())
|
||||
.setReceiveSystemEvents(true);
|
||||
.setReceiveSystemEvents(true)
|
||||
.build();
|
||||
}
|
||||
|
||||
mBiometricPrompt = builder.build();
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
|
||||
if (mCancellationSignal == null) {
|
||||
mCancellationSignal = new CancellationSignal();
|
||||
|
||||
mBiometricPrompt.authenticateUser(mCancellationSignal, mClientExecutor,
|
||||
mAuthenticationCallback, mUserId);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
return SettingsEnums.BIOMETRIC_FRAGMENT;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -150,17 +150,6 @@ public class ConfirmDeviceCredentialActivity extends FragmentActivity {
|
||||
}
|
||||
};
|
||||
|
||||
private String getStringForError(int errorCode) {
|
||||
switch (errorCode) {
|
||||
case BiometricConstants.BIOMETRIC_ERROR_USER_CANCELED:
|
||||
return getString(com.android.internal.R.string.biometric_error_user_canceled);
|
||||
case BiometricConstants.BIOMETRIC_ERROR_CANCELED:
|
||||
return getString(com.android.internal.R.string.biometric_error_canceled);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
Reference in New Issue
Block a user