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

@@ -46,19 +46,9 @@ public class FaceEnrollIntroduction extends BiometricEnrollIntroduction {
@Override
protected void onCreate(Bundle savedInstanceState) {
mFaceManager = Utils.getFaceManagerOrNull(this);
// Check if the Gateekeper Password exists. If so, request for a Gatekeeper HAT to be
// created. This needs to be cleaned up, since currently it's not very clear which
// superclass is responsible for what. Doing the check here is the least risky way.
if (mToken == null && BiometricUtils.containsGatekeeperPassword(getIntent())) {
// We either block on generateChallenge, or need to gray out the "next" button until
// the challenge is ready. Let's just do this for now.
final long challenge = mFaceManager.generateChallengeBlocking();
mToken = BiometricUtils.requestGatekeeperHat(this, getIntent(), mUserId, challenge);
}
super.onCreate(savedInstanceState);
mFaceManager = Utils.getFaceManagerOrNull(this);
mFaceFeatureProvider = FeatureFactory.getFactory(getApplicationContext())
.getFaceFeatureProvider();
@@ -106,6 +96,18 @@ public class FaceEnrollIntroduction extends BiometricEnrollIntroduction {
? R.string.security_settings_face_enroll_introduction_footer_part_2
: R.string.security_settings_face_settings_footer_attention_not_supported;
footer2.setText(footer2TextResource);
// This path 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())) {
mFooterBarMixin.getPrimaryButton().setEnabled(false);
// We either block on generateChallenge, or need to gray out the "next" button until
// the challenge is ready. Let's just do this for now.
mFaceManager.generateChallenge(challenge -> {
mToken = BiometricUtils.requestGatekeeperHat(this, getIntent(), mUserId, challenge);
mFooterBarMixin.getPrimaryButton().setEnabled(true);
});
}
}
@Override