Fixed face enroll intro button issue

Fixed an issue where sometimes after completing face authentication the
more & agree buttons would display instead of the done button.

1. Enter SUW
2. Complete face authentication flow
3. Go to next step (finishing the Biometric flow)
4. Press the back button
5. Observe that the text now says "Done"

Fixes: 205203673
Test: Verified button text is changed as expected during SUW.
Change-Id: I5cfad265f9b27669dcad64e5872750695b1b5bdc
diff --git a/src/com/android/settings/biometrics/BiometricEnrollIntroduction.java b/src/com/android/settings/biometrics/BiometricEnrollIntroduction.java
index f80b01f..7f3bc87 100644
--- a/src/com/android/settings/biometrics/BiometricEnrollIntroduction.java
+++ b/src/com/android/settings/biometrics/BiometricEnrollIntroduction.java
@@ -203,11 +203,15 @@
                 getMoreButtonTextRes(), this::onNextButtonClick);
         requireScrollMixin.setOnRequireScrollStateChangedListener(
                 scrollNeeded -> {
-                    // Update text of primary button from "More" to "Agree".
-                    final int primaryButtonTextRes = scrollNeeded
-                            ? getMoreButtonTextRes()
-                            : getAgreeButtonTextRes();
-                    getPrimaryFooterButton().setText(this, primaryButtonTextRes);
+
+                    boolean enrollmentCompleted = checkMaxEnrolled() != 0;
+                    if (!enrollmentCompleted) {
+                        // Update text of primary button from "More" to "Agree".
+                        final int primaryButtonTextRes = scrollNeeded
+                                ? getMoreButtonTextRes()
+                                : getAgreeButtonTextRes();
+                        getPrimaryFooterButton().setText(this, primaryButtonTextRes);
+                    }
 
                     // Show secondary button once scroll is completed.
                     if (!scrollNeeded) {