OSDN Git Service

Change cancel button type to skip for SUW
authorjoshmccloskey <joshmccloskey@google.com>
Mon, 9 Sep 2019 23:11:27 +0000 (16:11 -0700)
committerjoshmccloskey <joshmccloskey@google.com>
Mon, 9 Sep 2019 23:46:03 +0000 (16:46 -0700)
Test: Verified in SUW that enrollment will skip after
tapping the cancel button in the Introduction.
Fixes: 140702414

Change-Id: I9d9da0ff6d10b6ee6929cb52ff4a03a684f43d17

src/com/android/settings/biometrics/face/FaceEnrollIntroduction.java

index e092891..965b8ed 100644 (file)
@@ -47,15 +47,25 @@ public class FaceEnrollIntroduction extends BiometricEnrollIntroduction {
         mFaceManager = Utils.getFaceManagerOrNull(this);
 
         mFooterBarMixin = getLayout().getMixin(FooterBarMixin.class);
-
-        mFooterBarMixin.setSecondaryButton(
-                new FooterButton.Builder(this)
-                        .setText(R.string.security_settings_face_enroll_introduction_no_thanks)
-                        .setListener(this::onCancelButtonClick)
-                        .setButtonType(FooterButton.ButtonType.CANCEL)
-                        .setTheme(R.style.SudGlifButton_Secondary)
-                        .build()
-        );
+        if (WizardManagerHelper.isAnySetupWizard(getIntent())) {
+            mFooterBarMixin.setSecondaryButton(
+                    new FooterButton.Builder(this)
+                            .setText(R.string.security_settings_face_enroll_introduction_no_thanks)
+                            .setListener(this::onSkipButtonClick)
+                            .setButtonType(FooterButton.ButtonType.SKIP)
+                            .setTheme(R.style.SudGlifButton_Secondary)
+                            .build()
+            );
+        } else {
+            mFooterBarMixin.setSecondaryButton(
+                    new FooterButton.Builder(this)
+                            .setText(R.string.security_settings_face_enroll_introduction_no_thanks)
+                            .setListener(this::onCancelButtonClick)
+                            .setButtonType(FooterButton.ButtonType.CANCEL)
+                            .setTheme(R.style.SudGlifButton_Secondary)
+                            .build()
+            );
+        }
 
         mFooterBarMixin.setPrimaryButton(
                 new FooterButton.Builder(this)