Remove remainder of generateChallengeBlocking

Test: make -j56 RunSettingsRoboTests

Face Tests:
Test: Open face settings, remove face, add face
Test: Open face settings, but cancel credential confirmation.
      Face settings does not show up
Test: adb shell am start -a android.app.action.SET_NEW_PASSWORD
      Able to enroll face

Fingerprint Tests:
Test: Open fingerprint settings, add button is shown
Test: Open fingerprint settings, but cancel credential confirmation.
      Fingerprint settings does not show up
Test: adb shell am start -a android.app.action.SET_NEW_PASSWORD
      Able to enroll fingerprint

Bug: 162533680
Change-Id: Ie448ed086e73b0b545bd3a2e62437c543f7aad6c
This commit is contained in:
Kevin Chyn
2020-07-30 15:38:54 -07:00
parent 66bfe45f99
commit bee84e2daa
5 changed files with 43 additions and 37 deletions

View File

@@ -61,19 +61,25 @@ public class FingerprintEnrollFindSensor extends BiometricEnrollBase {
setHeaderText(R.string.security_settings_fingerprint_enroll_find_sensor_title);
// This is an entry point for SetNewPasswordController, e.g.
// adb shell am start -a android.app.action.SET_NEW_PASSWORD
if (mToken == null && BiometricUtils.containsGatekeeperPassword(getIntent())) {
final FingerprintManager fpm = getSystemService(FingerprintManager.class);
final long challenge = fpm.generateChallengeBlocking();
mToken = BiometricUtils.requestGatekeeperHat(this, getIntent(), mUserId, challenge);
fpm.generateChallenge(challenge -> {
mToken = BiometricUtils.requestGatekeeperHat(this, getIntent(), mUserId, challenge);
// Put this into the intent. This is really just to work around the fact that the
// enrollment sidecar gets the HAT from the activity's intent, rather than having
// it passed in.
getIntent().putExtra(ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE_TOKEN, mToken);
// Put this into the intent. This is really just to work around the fact that the
// enrollment sidecar gets the HAT from the activity's intent, rather than having
// it passed in.
getIntent().putExtra(ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE_TOKEN, mToken);
startLookingForFingerprint();
});
} else if (mToken != null) {
// HAT passed in from somewhere else, such as FingerprintEnrollIntroduction
startLookingForFingerprint();
}
startLookingForFingerprint(); // already confirmed, so start looking for fingerprint
View animationView = findViewById(R.id.fingerprint_sensor_location_animation);
if (animationView instanceof FingerprintFindSensorAnimation) {
mAnimation = (FingerprintFindSensorAnimation) animationView;