Propagate intent extras and finish activity properly
Bug: 131861430 Test: Builds Change-Id: I7e831f74f1e55026b9343a4c4f47c9f5adc316e6
This commit is contained in:
@@ -57,6 +57,7 @@ public class FaceEnrollEducation extends BiometricEnrollBase {
|
|||||||
private IllustrationVideoView mIllustrationNormal;
|
private IllustrationVideoView mIllustrationNormal;
|
||||||
private View mIllustrationAccessibility;
|
private View mIllustrationAccessibility;
|
||||||
private Handler mHandler;
|
private Handler mHandler;
|
||||||
|
private Intent mResultIntent;
|
||||||
|
|
||||||
private CompoundButton.OnCheckedChangeListener mSwitchDiversityListener =
|
private CompoundButton.OnCheckedChangeListener mSwitchDiversityListener =
|
||||||
new CompoundButton.OnCheckedChangeListener() {
|
new CompoundButton.OnCheckedChangeListener() {
|
||||||
@@ -151,6 +152,9 @@ public class FaceEnrollEducation extends BiometricEnrollBase {
|
|||||||
intent.setClass(this, FaceEnrollEnrolling.class);
|
intent.setClass(this, FaceEnrollEnrolling.class);
|
||||||
}
|
}
|
||||||
intent.putExtra(EXTRA_KEY_REQUIRE_DIVERSITY, !mSwitchDiversity.isChecked());
|
intent.putExtra(EXTRA_KEY_REQUIRE_DIVERSITY, !mSwitchDiversity.isChecked());
|
||||||
|
if (mResultIntent != null) {
|
||||||
|
intent.putExtras(mResultIntent);
|
||||||
|
}
|
||||||
WizardManagerHelper.copyWizardManagerExtras(getIntent(), intent);
|
WizardManagerHelper.copyWizardManagerExtras(getIntent(), intent);
|
||||||
startActivityForResult(intent, BIOMETRIC_FIND_SENSOR_REQUEST);
|
startActivityForResult(intent, BIOMETRIC_FIND_SENSOR_REQUEST);
|
||||||
}
|
}
|
||||||
@@ -162,9 +166,13 @@ public class FaceEnrollEducation extends BiometricEnrollBase {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
|
mResultIntent = data;
|
||||||
if (requestCode == BIOMETRIC_FIND_SENSOR_REQUEST) {
|
if (requestCode == BIOMETRIC_FIND_SENSOR_REQUEST) {
|
||||||
setResult(resultCode);
|
// If the user finished or skipped enrollment, finish this activity
|
||||||
finish();
|
if (resultCode == RESULT_SKIP || resultCode == RESULT_FINISHED) {
|
||||||
|
setResult(resultCode);
|
||||||
|
finish();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user