Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c976efa3 authored by Kevin Chyn's avatar Kevin Chyn
Browse files

Do not stay on education page if user has enrolled max templates

Fixes: 134769754

Test: Enroll max templates, go back, intro screen is seen instead
Change-Id: I4a5f8d71abff88688f7c77860bb44caa95d17d61
parent dc29b325
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -169,6 +169,15 @@ public class FaceEnrollEducation extends BiometricEnrollBase {
        super.onResume();
        mSwitchDiversityListener.onCheckedChanged(mSwitchDiversity.getSwitch(),
                mSwitchDiversity.isChecked());

        // If the user goes back after enrollment, we should send them back to the intro page
        // if they've met the max limit.
        final int max = getResources().getInteger(
                com.android.internal.R.integer.config_faceMaxTemplatesPerUser);
        final int numEnrolledFaces = mFaceManager.getEnrolledFaces(mUserId).size();
        if (numEnrolledFaces >= max) {
            finish();
        }
    }

    @Override