Launch Face Settings when device enrolled face

In legacy flow FaceEnrollIntroduction check maxFacesEnrolled()
then update introduction description and prevent user go to next
enroll step, the CUJ was not good to user, instead bring user
to Face Settings and let user decide the next action(Delete face or
change config) is more make sense.

As any applications could broadcast intent(android.settings.FACE_ENROLL)
to bring FaceEnrollIntroduction up, we add a check in onCreate() and check
if device has been enrolled max face, launch FaceSettingsInternalActivity.

In addition, skip to register any posture change callback when
maxFacesEnrolled() during activity onStart().

Test: atest SettingsGoogleUnitTests
Test: m -j SettingsGoogleRoboTests RunSettingsGoogleRoboTests
Test: m RunSettingsRoboTests ROBOTEST_FILTER= \
      "FaceEnrollIntroductionTest"
Test: m RunSettingsRoboTests ROBOTEST_FILTER= \
      "FingerprintEnrollIntroductionTest"
Test: Manual enrolled face, unfold device, launch Tips Security page
and click "Set up Face Unlock", device launch Face Settings insteand of
posture guidance page.

Bug: 263830403
Change-Id: Ied8b92259810f954ce6b2daaa9b87fc996ad752a
This commit is contained in:
lbill
2023-02-04 04:02:35 +00:00
committed by Milton Wu
parent 91eab671d1
commit c7dd729a43
4 changed files with 160 additions and 6 deletions

View File

@@ -183,7 +183,9 @@ public abstract class BiometricEnrollIntroduction extends BiometricEnrollBase
mUserManager = UserManager.get(this);
updatePasswordQuality();
if (!mConfirmingCredentials) {
// Check isFinishing() because FaceEnrollIntroduction may finish self to launch
// FaceSettings during onCreate()
if (!mConfirmingCredentials && !isFinishing()) {
if (!mHasPassword) {
// No password registered, launch into enrollment wizard.
mConfirmingCredentials = true;