Fix face re-enroll stuck for work profile

Call super.onCreate(savedInstanceState) first to pass the correct userId
in maxFacesEnrolled.

Test: Manual - delete face unlock for work and re-enroll and observe
face unlock can be enrolled successfully
Test: atest FaceEnrollIntroductionTest

Fixes: 284819031
Change-Id: Ic1620c0ca3ca9adc61f5281abd34471f0c1b3f97
This commit is contained in:
Wenhui Yang
2023-06-06 22:02:52 +00:00
parent d48ba61155
commit 7e6443e025
2 changed files with 48 additions and 2 deletions

View File

@@ -120,6 +120,8 @@ public class FaceEnrollIntroduction extends BiometricEnrollIntroduction {
protected void onCreate(Bundle savedInstanceState) {
mFaceManager = getFaceManager();
super.onCreate(savedInstanceState);
if (savedInstanceState == null
&& !WizardManagerHelper.isAnySetupWizard(getIntent())
&& !getIntent().getBooleanExtra(EXTRA_FROM_SETTINGS_SUMMARY, false)
@@ -130,8 +132,6 @@ public class FaceEnrollIntroduction extends BiometricEnrollIntroduction {
finish();
}
super.onCreate(savedInstanceState);
// Wait super::onCreated() then return because SuperNotCalledExceptio will be thrown
// if we don't wait for it.
if (isFinishing()) {