Do not call credential if authenticators does not allow
Flag: android.hardware.biometrics.flags.mandatory_biometrics Test: N/A Fixes: 358180327 Change-Id: I236fbcc84502602e6e6fb02615f002e02136202e
This commit is contained in:
@@ -104,6 +104,7 @@ public class ConfirmDeviceCredentialActivity extends FragmentActivity {
|
|||||||
private boolean mForceVerifyPath = false;
|
private boolean mForceVerifyPath = false;
|
||||||
private boolean mGoingToBackground;
|
private boolean mGoingToBackground;
|
||||||
private boolean mWaitingForBiometricCallback;
|
private boolean mWaitingForBiometricCallback;
|
||||||
|
private int mBiometricsAuthenticators;
|
||||||
|
|
||||||
private Executor mExecutor = (runnable -> {
|
private Executor mExecutor = (runnable -> {
|
||||||
mHandler.post(runnable);
|
mHandler.post(runnable);
|
||||||
@@ -122,8 +123,14 @@ public class ConfirmDeviceCredentialActivity extends FragmentActivity {
|
|||||||
Log.i(TAG, "Finishing, user no longer valid: " + mUserId);
|
Log.i(TAG, "Finishing, user no longer valid: " + mUserId);
|
||||||
finish();
|
finish();
|
||||||
} else {
|
} else {
|
||||||
// All other errors go to some version of CC
|
if ((mBiometricsAuthenticators
|
||||||
showConfirmCredentials();
|
& BiometricManager.Authenticators.DEVICE_CREDENTIAL) != 0) {
|
||||||
|
// All other errors go to some version of CC
|
||||||
|
showConfirmCredentials();
|
||||||
|
} else {
|
||||||
|
Log.i(TAG, "Finishing, device credential not requested");
|
||||||
|
finish();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (mWaitingForBiometricCallback) { // mGoingToBackground is true
|
} else if (mWaitingForBiometricCallback) { // mGoingToBackground is true
|
||||||
mWaitingForBiometricCallback = false;
|
mWaitingForBiometricCallback = false;
|
||||||
@@ -188,7 +195,7 @@ public class ConfirmDeviceCredentialActivity extends FragmentActivity {
|
|||||||
mDetails = intent.getCharSequenceExtra(KeyguardManager.EXTRA_DESCRIPTION);
|
mDetails = intent.getCharSequenceExtra(KeyguardManager.EXTRA_DESCRIPTION);
|
||||||
String alternateButton = intent.getStringExtra(
|
String alternateButton = intent.getStringExtra(
|
||||||
KeyguardManager.EXTRA_ALTERNATE_BUTTON_LABEL);
|
KeyguardManager.EXTRA_ALTERNATE_BUTTON_LABEL);
|
||||||
final int authenticators = intent.getIntExtra(BIOMETRIC_PROMPT_AUTHENTICATORS,
|
mBiometricsAuthenticators = intent.getIntExtra(BIOMETRIC_PROMPT_AUTHENTICATORS,
|
||||||
BiometricManager.Authenticators.DEVICE_CREDENTIAL
|
BiometricManager.Authenticators.DEVICE_CREDENTIAL
|
||||||
| BiometricManager.Authenticators.BIOMETRIC_WEAK);
|
| BiometricManager.Authenticators.BIOMETRIC_WEAK);
|
||||||
final String negativeButtonText = intent.getStringExtra(
|
final String negativeButtonText = intent.getStringExtra(
|
||||||
@@ -229,7 +236,7 @@ public class ConfirmDeviceCredentialActivity extends FragmentActivity {
|
|||||||
promptInfo.setTitle(mTitle);
|
promptInfo.setTitle(mTitle);
|
||||||
promptInfo.setDescription(mDetails);
|
promptInfo.setDescription(mDetails);
|
||||||
promptInfo.setDisallowBiometricsIfPolicyExists(mCheckDevicePolicyManager);
|
promptInfo.setDisallowBiometricsIfPolicyExists(mCheckDevicePolicyManager);
|
||||||
promptInfo.setAuthenticators(authenticators);
|
promptInfo.setAuthenticators(mBiometricsAuthenticators);
|
||||||
promptInfo.setNegativeButtonText(negativeButtonText);
|
promptInfo.setNegativeButtonText(negativeButtonText);
|
||||||
|
|
||||||
if (android.multiuser.Flags.enablePrivateSpaceFeatures()
|
if (android.multiuser.Flags.enablePrivateSpaceFeatures()
|
||||||
|
Reference in New Issue
Block a user