Refactor BiometricEnrollBase::onStop()

During BiometricEnrollBase::onStop(), it judeges activity result and
determine finishing self or not by a common rule. And it causes some
problems.
1. It may override original setResult() which was set by its child
   activity.
2. If we change the judgmental rule in BiometricEnollBase, we need to
   manully test all override class cases to make sure everything works
   well. It makes us hard to change the criteria here.

Move code in BiometricEnrollBase::onStop() to its extended class to have
more flexiable.

Bug: 197717071
Test: Run ROBOTEST for SetupFingerprintEnrollIntroductionTest
      SetupFingerprintEnrollFinishTest FingerprintEnrollEnrollingTest
      FingerprintEnrollFindSensorTest FingerprintEnrollIntroductionTest
      SetupFingerprintEnrollFindSensorTest
Test: Manully test fingerprint/faceauth flow in settings or SUW

Change-Id: I5d6c63cf537c0146bc03bd2b36ee3e1d68918a19
This commit is contained in:
Milton Wu
2022-07-28 09:11:17 +00:00
parent efbb071933
commit 6b6d8c0d6d
8 changed files with 63 additions and 12 deletions

View File

@@ -181,16 +181,6 @@ public abstract class BiometricEnrollBase extends InstrumentedActivity {
getWindow().setStatusBarColor(getBackgroundColor());
}
@Override
protected void onStop() {
super.onStop();
if (!isChangingConfigurations() && shouldFinishWhenBackgrounded()
&& !BiometricUtils.isAnyMultiBiometricFlow(this)) {
setResult(RESULT_TIMEOUT);
finish();
}
}
protected boolean shouldFinishWhenBackgrounded() {
return !WizardManagerHelper.isAnySetupWizard(getIntent());
}