Show "Done" button to prevent user from getting stuck

When the user has already reached max enrollments, we should show a done
button. It's possible to get to the introduction page (back button during
SUW, or launching android.settings.BIOMETRIC_ENROLL).

Bug: 111548033
Test: Done button is shown and works as expected when max enrollments
Change-Id: Ia70c21f63606393116e222ca940ee93bcfb25995
This commit is contained in:
Kevin Chyn
2018-12-27 13:38:35 -08:00
parent 28ac88a736
commit 71724ae03c

View File

@@ -150,7 +150,8 @@ public abstract class BiometricEnrollIntroduction extends BiometricEnrollBase
getNextButton().setVisibility(View.VISIBLE); getNextButton().setVisibility(View.VISIBLE);
} else { } else {
mErrorText.setText(errorMsg); mErrorText.setText(errorMsg);
getNextButton().setVisibility(View.GONE); getNextButton().setText(getResources().getString(R.string.done));
getNextButton().setVisibility(View.VISIBLE);
} }
} }
@@ -162,8 +163,13 @@ public abstract class BiometricEnrollIntroduction extends BiometricEnrollBase
@Override @Override
protected void onNextButtonClick(View view) { protected void onNextButtonClick(View view) {
// Lock thingy is already set up, launch directly to the next page if (checkMaxEnrolled() == 0) {
launchNextEnrollingActivity(mToken); // Lock thingy is already set up, launch directly to the next page
launchNextEnrollingActivity(mToken);
} else {
setResult(RESULT_FINISHED);
finish();
}
} }
private void launchChooseLock() { private void launchChooseLock() {