[Fingerprint] Add fingerprint enroll in setup wizard
Make a subclass for each enrolling screen that setup wizard uses, and in override the corresponding get*Intent methods to always use the setup wizard versions of the next screens. On minor change made to the original flow is that it will now return RESULT_OK if it is finished, as opposed to RESULT_CANCELED. Bug: 21695577 Change-Id: Id666826e8027272ede6a5426967d66fb291670a4
This commit is contained in:
@@ -47,22 +47,29 @@ public class FingerprintEnrollIntroduction extends FingerprintEnrollBase {
|
||||
|
||||
@Override
|
||||
protected void onNextButtonClick() {
|
||||
Intent intent = new Intent();
|
||||
final String clazz;
|
||||
Intent intent;
|
||||
if (!mHasPassword) {
|
||||
// No fingerprints registered, launch into enrollment wizard.
|
||||
clazz = FingerprintEnrollOnboard.class.getName();
|
||||
intent = getOnboardIntent();
|
||||
} else {
|
||||
// Lock thingy is already set up, launch directly into find sensor step from wizard.
|
||||
clazz = FingerprintEnrollFindSensor.class.getName();
|
||||
intent = getFindSensorIntent();
|
||||
}
|
||||
intent.setClassName("com.android.settings", clazz);
|
||||
startActivityForResult(intent, 0);
|
||||
}
|
||||
|
||||
protected Intent getOnboardIntent() {
|
||||
return new Intent(this, FingerprintEnrollOnboard.class);
|
||||
}
|
||||
|
||||
protected Intent getFindSensorIntent() {
|
||||
return new Intent(this, FingerprintEnrollFindSensor.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
if (resultCode == RESULT_FINISHED) {
|
||||
setResult(RESULT_OK);
|
||||
finish();
|
||||
} else {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
|
Reference in New Issue
Block a user