Updated fp enrollment to have 5 enroll stages.

Test: Verified with multiple devices that there are now
5 stages for UDFPS enrollment.
Fixes: 222587017

Change-Id: I60780553894880f8e5301303f9be6b0cbb84651f
diff --git a/res/raw/udfps_edge_hint_lottie.json b/res/raw/udfps_left_edge_hint_lottie.json
similarity index 100%
rename from res/raw/udfps_edge_hint_lottie.json
rename to res/raw/udfps_left_edge_hint_lottie.json
diff --git a/res/raw/udfps_edge_hint_lottie.json b/res/raw/udfps_right_edge_hint_lottie.json
similarity index 100%
copy from res/raw/udfps_edge_hint_lottie.json
copy to res/raw/udfps_right_edge_hint_lottie.json
diff --git a/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollEnrolling.java b/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollEnrolling.java
index d42e8f1..70140c4 100644
--- a/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollEnrolling.java
+++ b/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollEnrolling.java
@@ -81,9 +81,11 @@
     private static final int STAGE_CENTER = 0;
     private static final int STAGE_GUIDED = 1;
     private static final int STAGE_FINGERTIP = 2;
-    private static final int STAGE_EDGES = 3;
+    private static final int STAGE_LEFT_EDGE = 3;
+    private static final int STAGE_RIGHT_EDGE = 4;
 
-    @IntDef({STAGE_UNKNOWN, STAGE_CENTER, STAGE_GUIDED, STAGE_FINGERTIP, STAGE_EDGES})
+    @IntDef({STAGE_UNKNOWN, STAGE_CENTER, STAGE_GUIDED, STAGE_FINGERTIP, STAGE_LEFT_EDGE,
+            STAGE_RIGHT_EDGE})
     @Retention(RetentionPolicy.SOURCE)
     private @interface EnrollStage {}
 
@@ -132,7 +134,8 @@
     private boolean mIsAccessibilityEnabled;
     private LottieAnimationView mIllustrationLottie;
     private boolean mHaveShownUdfpsTipLottie;
-    private boolean mHaveShownUdfpsSideLottie;
+    private boolean mHaveShownUdfpsLeftEdgeLottie;
+    private boolean mHaveShownUdfpsRightEdgeLottie;
     private boolean mShouldShowLottie;
 
     private OrientationEventListener mOrientationEventListener;
@@ -372,12 +375,31 @@
                 }
                 break;
 
-            case STAGE_EDGES:
+            case STAGE_LEFT_EDGE:
                 setHeaderText(R.string.security_settings_udfps_enroll_edge_title);
-                if (!mHaveShownUdfpsSideLottie && mIllustrationLottie != null) {
-                    mHaveShownUdfpsSideLottie = true;
+                if (!mHaveShownUdfpsLeftEdgeLottie && mIllustrationLottie != null) {
+                    mHaveShownUdfpsLeftEdgeLottie = true;
                     setDescriptionText("");
-                    mIllustrationLottie.setAnimation(R.raw.udfps_edge_hint_lottie);
+                    mIllustrationLottie.setAnimation(R.raw.udfps_left_edge_hint_lottie);
+                    mIllustrationLottie.setVisibility(View.VISIBLE);
+                    mIllustrationLottie.playAnimation();
+                    mIllustrationLottie.setContentDescription(
+                            getString(R.string.security_settings_udfps_side_fingerprint_help));
+                } else if (mIllustrationLottie == null) {
+                    if (isStageHalfCompleted()) {
+                        setDescriptionText(
+                                R.string.security_settings_fingerprint_enroll_repeat_message);
+                    } else {
+                        setDescriptionText(R.string.security_settings_udfps_enroll_edge_message);
+                    }
+                }
+                break;
+            case STAGE_RIGHT_EDGE:
+                setHeaderText(R.string.security_settings_udfps_enroll_edge_title);
+                if (!mHaveShownUdfpsRightEdgeLottie && mIllustrationLottie != null) {
+                    mHaveShownUdfpsRightEdgeLottie = true;
+                    setDescriptionText("");
+                    mIllustrationLottie.setAnimation(R.raw.udfps_right_edge_hint_lottie);
                     mIllustrationLottie.setVisibility(View.VISIBLE);
                     mIllustrationLottie.playAnimation();
                     mIllustrationLottie.setContentDescription(
@@ -422,8 +444,10 @@
             return STAGE_GUIDED;
         } else if (progressSteps < getStageThresholdSteps(2)) {
             return STAGE_FINGERTIP;
+        } else if (progressSteps < getStageThresholdSteps(3)) {
+            return STAGE_LEFT_EDGE;
         } else {
-            return STAGE_EDGES;
+            return STAGE_RIGHT_EDGE;
         }
     }