Loading src/com/android/settings/biometrics/BiometricEnrollIntroduction.java +17 −16 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ import com.google.android.setupdesign.GlifLayout; import com.google.android.setupdesign.span.LinkSpan; import com.google.android.setupdesign.template.RequireScrollMixin; import com.google.android.setupdesign.util.DynamicColorPalette; import com.google.android.setupdesign.util.ThemeHelper; import java.util.List; Loading Loading @@ -159,15 +160,14 @@ public abstract class BiometricEnrollIntroduction extends BiometricEnrollBase @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); final boolean isExpressiveStyle = BiometricUtils.isExpressiveStyle( getBaseContext(), false); final boolean isSuw = WizardManagerHelper.isAnySetupWizard(getIntent()); if (shouldShowSplitScreenDialog()) { final BiometricsSplitScreenDialog splitDialog = BiometricsSplitScreenDialog .newInstance(getModality(), !WizardManagerHelper.isAnySetupWizard(getIntent())); .newInstance(getModality(), !isSuw); splitDialog.setPositiveButtonListener((dialog, which) -> { dialog.dismiss(); if (!WizardManagerHelper.isAnySetupWizard(getIntent())) { if (!isSuw) { updateOnboardingScreenInfoActions( BiometricsOnboardingProto.OnboardingAction.ACTION_SKIP_VALUE); Intent resultData = newResultIntent(); Loading Loading @@ -230,15 +230,16 @@ public abstract class BiometricEnrollIntroduction extends BiometricEnrollBase mFooterBarMixin = layout.getMixin(FooterBarMixin.class); mFooterBarMixin.setPrimaryButton(getPrimaryFooterButton()); mFooterBarMixin.setSecondaryButton(getSecondaryFooterButton(), true /* usePrimaryStyle */); if (!isExpressiveStyle) { mFooterBarMixin.getSecondaryButton().setVisibility( mHasScrolledToBottom ? View.VISIBLE : View.INVISIBLE); } final RequireScrollMixin requireScrollMixin = layout.getMixin(RequireScrollMixin.class); requireScrollMixin.requireScrollWithButton(this, getPrimaryFooterButton(), getMoreButtonTextRes(), this::onNextButtonClick); if (!isExpressiveStyle) { requireScrollMixin.requireScrollWithButton(this, getPrimaryFooterButton(), getSecondaryFooterButton(), getMoreButtonTextRes(), this::onNextButtonClick); if (!ThemeHelper.shouldApplyGlifExpressiveStyle(layout.getContext())) { mFooterBarMixin.getSecondaryButton().setVisibility( mHasScrolledToBottom ? View.VISIBLE : View.INVISIBLE); requireScrollMixin.setOnRequireScrollStateChangedListener( scrollNeeded -> { boolean enrollmentCompleted = checkMaxEnrolled() != 0; Loading @@ -256,13 +257,13 @@ public abstract class BiometricEnrollIntroduction extends BiometricEnrollBase : View.INVISIBLE); mHasScrolledToBottom = !scrollNeeded; }); } final boolean isScrollNeeded = requireScrollMixin.isScrollingRequired(); final boolean enrollmentCompleted = checkMaxEnrolled() != 0; getSecondaryFooterButton().setVisibility( !isScrollNeeded && !enrollmentCompleted ? View.VISIBLE : View.INVISIBLE); } } @Override protected void onStart() { Loading src/com/android/settings/biometrics/BiometricUtils.java +7 −0 Original line number Diff line number Diff line Loading @@ -541,7 +541,10 @@ public class BiometricUtils { * @param context that for applying Expressive Style * @param isSettingsPreference Apply Expressive style on Settings Preference or not. * @return true if device using Expressive Style theme, otherwise false. * * @deprecated Use useExpressiveStyle(context, intent) instead */ @Deprecated public static boolean isExpressiveStyle(@NonNull Context context, boolean isSettingsPreference) { return isSettingsPreference ? SettingsThemeHelper.isExpressiveTheme(context) : Loading @@ -554,7 +557,11 @@ public class BiometricUtils { * @param intent intent The original intent that was used to start the step, usually * via {@link Activity#getIntent()}, Null will assume calling from Settings Flow. * @return true if device using Expressive Style theme, otherwise false. * * @deprecated Using either ThemeHelper.shouldApplyGlifExpressiveStyle() * or SettingsThemeHelper.isExpressiveTheme() is more practical. */ @Deprecated public static boolean useExpressiveStyle(@NonNull Context context, @Nullable Intent intent) { if (WizardManagerHelper.isAnySetupWizard(intent)) { return ThemeHelper.shouldApplyGlifExpressiveStyle(context); Loading src/com/android/settings/biometrics/face/FaceEnrollEducation.java +3 −2 Original line number Diff line number Diff line Loading @@ -63,6 +63,7 @@ import com.google.android.setupcompat.template.FooterBarMixin; import com.google.android.setupcompat.template.FooterButton; import com.google.android.setupcompat.util.WizardManagerHelper; import com.google.android.setupdesign.util.LottieAnimationHelper; import com.google.android.setupdesign.util.ThemeHelper; import com.google.android.setupdesign.view.IllustrationVideoView; import java.util.Arrays; Loading Loading @@ -141,8 +142,6 @@ public class FaceEnrollEducation extends BiometricEnrollBase { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mIsUsingExpressiveStyle = BiometricUtils.useExpressiveStyle(getApplicationContext(), getIntent()); setContentView(R.layout.face_enroll_education); Loading @@ -154,6 +153,8 @@ public class FaceEnrollEducation extends BiometricEnrollBase { mIllustrationDefault = findViewById(R.id.illustration_default); mIllustrationLottie = findViewById(R.id.illustration_lottie); mIllustrationAccessibility = findViewById(R.id.illustration_accessibility); mIsUsingExpressiveStyle = ThemeHelper.shouldApplyGlifExpressiveStyle( getApplicationContext()); if (mIsUsingExpressiveStyle && mIllustrationAccessibility instanceof ImageView) { ((ImageView) mIllustrationAccessibility).setImageResource( R.drawable.face_enroll_icon_large_expressive); Loading src/com/android/settings/password/ChooseLockGeneric.java +2 −1 Original line number Diff line number Diff line Loading @@ -102,6 +102,7 @@ import com.android.settingslib.core.AbstractPreferenceController; import com.android.settingslib.widget.FooterPreference; import com.google.android.setupcompat.util.WizardManagerHelper; import com.google.android.setupdesign.util.ThemeHelper; import java.util.ArrayList; Loading Loading @@ -457,7 +458,7 @@ public class ChooseLockGeneric extends SettingsActivity { } } else { textView.setText(""); if (BiometricUtils.useExpressiveStyle(getContext(), getIntent())) { if (ThemeHelper.shouldApplyGlifExpressiveStyle(getContext())) { textView.setVisibility(View.GONE); } } Loading tests/robotests/src/com/android/settings/biometrics/face/FaceEnrollIntroductionTest.java +64 −11 Original line number Diff line number Diff line Loading @@ -76,6 +76,7 @@ import com.android.settings.testutils.shadow.ShadowLockPatternUtils; import com.android.settings.testutils.shadow.ShadowSensorPrivacyManager; import com.android.settings.testutils.shadow.ShadowUserManager; import com.android.settings.testutils.shadow.ShadowUtils; import com.android.settingslib.widget.SettingsThemeHelper; import com.google.android.setupcompat.template.FooterBarMixin; import com.google.android.setupcompat.template.FooterButton; Loading @@ -99,6 +100,8 @@ import org.robolectric.RobolectricTestRunner; import org.robolectric.Shadows; import org.robolectric.android.controller.ActivityController; import org.robolectric.annotation.Config; import org.robolectric.annotation.Implementation; import org.robolectric.annotation.Implements; import org.robolectric.shadows.ShadowActivity; import java.util.ArrayList; Loading @@ -112,7 +115,8 @@ import java.util.List; ShadowDevicePolicyManager.class, ShadowSensorPrivacyManager.class, SettingsShadowResources.class, ShadowAlertDialogCompat.class ShadowAlertDialogCompat.class, FaceEnrollIntroductionTest.ShadowSettingsThemeHelper.class, }) public class FaceEnrollIntroductionTest { Loading Loading @@ -202,6 +206,15 @@ public class FaceEnrollIntroductionTest { ShadowAlertDialogCompat.reset(); } private void setupNonExpressiveActivity() { ShadowSettingsThemeHelper.setExpressiveTheme(false); setupActivity(); } private void setupExpressiveActivity() { ShadowSettingsThemeHelper.setExpressiveTheme(true); setupActivity(); } private void setupActivity() { final Intent testIntent = new Intent(); // Set the challenge token so the confirm screen will not be shown Loading Loading @@ -233,6 +246,7 @@ public class FaceEnrollIntroductionTest { } private void setupActivityForPosture() { ShadowSettingsThemeHelper.setExpressiveTheme(false); final Intent testIntent = new Intent(); // Set the challenge token so the confirm screen will not be shown testIntent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE_TOKEN, new byte[0]); Loading Loading @@ -288,6 +302,21 @@ public class FaceEnrollIntroductionTest { when(mFaceManager.getEnrolledFaces(userId)).thenReturn(faces); } @Implements(SettingsThemeHelper.class) public static class ShadowSettingsThemeHelper { private static boolean sIsExpressiveTheme; /** Shadow implementation of isExpressiveTheme */ @Implementation public static boolean isExpressiveTheme(@NonNull Context context) { return sIsExpressiveTheme; } static void setExpressiveTheme(boolean isExpressiveTheme) { sIsExpressiveTheme = isExpressiveTheme; } } @Test public void intro_CheckCanEnroll() { setFaceManagerToHave(0 /* numEnrollments */); Loading Loading @@ -347,16 +376,40 @@ public class FaceEnrollIntroductionTest { @Test public void testFaceEnrollIntroduction_hasHeader() { setupActivity(); setupNonExpressiveActivity(); TextView headerTextView = getGlifLayout(mActivity).findViewById(R.id.suc_layout_title); assertThat(headerTextView).isNotNull(); assertThat(headerTextView.getText().toString()).isNotEmpty(); } @Test public void testFaceEnrollIntroduction_hasFooterBar_hasFooterButtons() { setupNonExpressiveActivity(); FooterBarMixin footer = getGlifLayout(mActivity).getMixin(FooterBarMixin.class); assertThat(footer).isNotNull(); assertThat(footer.getPrimaryButton()).isNotNull(); assertThat(footer.getPrimaryButton().getVisibility()).isEqualTo(View.VISIBLE); assertThat(footer.getSecondaryButton()).isNotNull(); assertThat(footer.getSecondaryButton().getVisibility()).isEqualTo(View.VISIBLE); } @Test public void testFaceEnrollIntroduction_isExpressiveStyle_hasFooterBar_hasFooterButtons() { setupExpressiveActivity(); FooterBarMixin footer = getGlifLayout(mActivity).getMixin(FooterBarMixin.class); assertThat(footer).isNotNull(); assertThat(footer.getPrimaryButton()).isNotNull(); assertThat(footer.getPrimaryButton().getVisibility()).isEqualTo(View.VISIBLE); assertThat(footer.getSecondaryButton()).isNotNull(); assertThat(footer.getSecondaryButton().getVisibility()).isEqualTo(View.VISIBLE); } @Test public void testFaceEnrollIntroduction_hasDescription_weakFace() throws Exception { setupActivity(); setupNonExpressiveActivity(); SettingsShadowResources.overrideResource( R.bool.config_face_intro_show_less_secure, true); Loading Loading @@ -387,7 +440,7 @@ public class FaceEnrollIntroductionTest { @Test public void testFaceEnrollIntroduction_hasDescriptionNoLessSecure_strongFace() throws Exception { setupActivity(); setupNonExpressiveActivity(); SettingsShadowResources.overrideResource( R.bool.config_face_intro_show_less_secure, true); Loading Loading @@ -418,7 +471,7 @@ public class FaceEnrollIntroductionTest { @Test public void testFaceEnrollIntroduction_hasBottomScrollView() { setupActivity(); setupNonExpressiveActivity(); BottomScrollView scrollView = getGlifLayout(mActivity) .findViewById(com.google.android.setupdesign.R.id.sud_scroll_view); Loading @@ -428,7 +481,7 @@ public class FaceEnrollIntroductionTest { @Test public void testFaceEnrollIntroduction_showFooterPrimaryButton() { setupActivity(); setupNonExpressiveActivity(); FooterBarMixin footer = getGlifLayout(mActivity).getMixin(FooterBarMixin.class); FooterButton footerButton = footer.getPrimaryButton(); Loading @@ -440,7 +493,7 @@ public class FaceEnrollIntroductionTest { @Test public void testFaceEnrollIntroduction_footerSecondaryButtonWhenCanEnroll() { setupActivity(); setupNonExpressiveActivity(); FooterBarMixin footer = getGlifLayout(mActivity).getMixin(FooterBarMixin.class); FooterButton footerButton = footer.getSecondaryButton(); Loading Loading @@ -477,7 +530,7 @@ public class FaceEnrollIntroductionTest { @Test public void testFaceEnrollIntroduction_defaultNeverLaunchPostureGuidance() { setupActivity(); setupNonExpressiveActivity(); assertThat(mActivity.launchPostureGuidance()).isFalse(); assertThat(mActivity.getDevicePostureState()).isEqualTo(DEVICE_POSTURE_UNKNOWN); Loading @@ -485,7 +538,7 @@ public class FaceEnrollIntroductionTest { @Test public void testFaceEnrollIntroduction_onStartNeverRegisterPostureChangeCallback() { setupActivity(); setupNonExpressiveActivity(); mActivity.onStart(); assertThat(mActivity.getPostureGuidanceIntent()).isNull(); Loading Loading @@ -692,7 +745,7 @@ public class FaceEnrollIntroductionTest { @Test public void testFaceEnrollIntroduction_forwardsEnrollOptions() { setupActivity(); setupNonExpressiveActivity(); final Intent intent = mActivity.getEnrollingIntent(); assertThat(intent.getIntExtra(BiometricUtils.EXTRA_ENROLL_REASON, -1)) Loading @@ -701,7 +754,7 @@ public class FaceEnrollIntroductionTest { @Test public void drops_pendingIntents() { setupActivity(); setupNonExpressiveActivity(); mController.start(); Shadows.shadowOf(Looper.getMainLooper()).idle(); Loading Loading
src/com/android/settings/biometrics/BiometricEnrollIntroduction.java +17 −16 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ import com.google.android.setupdesign.GlifLayout; import com.google.android.setupdesign.span.LinkSpan; import com.google.android.setupdesign.template.RequireScrollMixin; import com.google.android.setupdesign.util.DynamicColorPalette; import com.google.android.setupdesign.util.ThemeHelper; import java.util.List; Loading Loading @@ -159,15 +160,14 @@ public abstract class BiometricEnrollIntroduction extends BiometricEnrollBase @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); final boolean isExpressiveStyle = BiometricUtils.isExpressiveStyle( getBaseContext(), false); final boolean isSuw = WizardManagerHelper.isAnySetupWizard(getIntent()); if (shouldShowSplitScreenDialog()) { final BiometricsSplitScreenDialog splitDialog = BiometricsSplitScreenDialog .newInstance(getModality(), !WizardManagerHelper.isAnySetupWizard(getIntent())); .newInstance(getModality(), !isSuw); splitDialog.setPositiveButtonListener((dialog, which) -> { dialog.dismiss(); if (!WizardManagerHelper.isAnySetupWizard(getIntent())) { if (!isSuw) { updateOnboardingScreenInfoActions( BiometricsOnboardingProto.OnboardingAction.ACTION_SKIP_VALUE); Intent resultData = newResultIntent(); Loading Loading @@ -230,15 +230,16 @@ public abstract class BiometricEnrollIntroduction extends BiometricEnrollBase mFooterBarMixin = layout.getMixin(FooterBarMixin.class); mFooterBarMixin.setPrimaryButton(getPrimaryFooterButton()); mFooterBarMixin.setSecondaryButton(getSecondaryFooterButton(), true /* usePrimaryStyle */); if (!isExpressiveStyle) { mFooterBarMixin.getSecondaryButton().setVisibility( mHasScrolledToBottom ? View.VISIBLE : View.INVISIBLE); } final RequireScrollMixin requireScrollMixin = layout.getMixin(RequireScrollMixin.class); requireScrollMixin.requireScrollWithButton(this, getPrimaryFooterButton(), getMoreButtonTextRes(), this::onNextButtonClick); if (!isExpressiveStyle) { requireScrollMixin.requireScrollWithButton(this, getPrimaryFooterButton(), getSecondaryFooterButton(), getMoreButtonTextRes(), this::onNextButtonClick); if (!ThemeHelper.shouldApplyGlifExpressiveStyle(layout.getContext())) { mFooterBarMixin.getSecondaryButton().setVisibility( mHasScrolledToBottom ? View.VISIBLE : View.INVISIBLE); requireScrollMixin.setOnRequireScrollStateChangedListener( scrollNeeded -> { boolean enrollmentCompleted = checkMaxEnrolled() != 0; Loading @@ -256,13 +257,13 @@ public abstract class BiometricEnrollIntroduction extends BiometricEnrollBase : View.INVISIBLE); mHasScrolledToBottom = !scrollNeeded; }); } final boolean isScrollNeeded = requireScrollMixin.isScrollingRequired(); final boolean enrollmentCompleted = checkMaxEnrolled() != 0; getSecondaryFooterButton().setVisibility( !isScrollNeeded && !enrollmentCompleted ? View.VISIBLE : View.INVISIBLE); } } @Override protected void onStart() { Loading
src/com/android/settings/biometrics/BiometricUtils.java +7 −0 Original line number Diff line number Diff line Loading @@ -541,7 +541,10 @@ public class BiometricUtils { * @param context that for applying Expressive Style * @param isSettingsPreference Apply Expressive style on Settings Preference or not. * @return true if device using Expressive Style theme, otherwise false. * * @deprecated Use useExpressiveStyle(context, intent) instead */ @Deprecated public static boolean isExpressiveStyle(@NonNull Context context, boolean isSettingsPreference) { return isSettingsPreference ? SettingsThemeHelper.isExpressiveTheme(context) : Loading @@ -554,7 +557,11 @@ public class BiometricUtils { * @param intent intent The original intent that was used to start the step, usually * via {@link Activity#getIntent()}, Null will assume calling from Settings Flow. * @return true if device using Expressive Style theme, otherwise false. * * @deprecated Using either ThemeHelper.shouldApplyGlifExpressiveStyle() * or SettingsThemeHelper.isExpressiveTheme() is more practical. */ @Deprecated public static boolean useExpressiveStyle(@NonNull Context context, @Nullable Intent intent) { if (WizardManagerHelper.isAnySetupWizard(intent)) { return ThemeHelper.shouldApplyGlifExpressiveStyle(context); Loading
src/com/android/settings/biometrics/face/FaceEnrollEducation.java +3 −2 Original line number Diff line number Diff line Loading @@ -63,6 +63,7 @@ import com.google.android.setupcompat.template.FooterBarMixin; import com.google.android.setupcompat.template.FooterButton; import com.google.android.setupcompat.util.WizardManagerHelper; import com.google.android.setupdesign.util.LottieAnimationHelper; import com.google.android.setupdesign.util.ThemeHelper; import com.google.android.setupdesign.view.IllustrationVideoView; import java.util.Arrays; Loading Loading @@ -141,8 +142,6 @@ public class FaceEnrollEducation extends BiometricEnrollBase { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mIsUsingExpressiveStyle = BiometricUtils.useExpressiveStyle(getApplicationContext(), getIntent()); setContentView(R.layout.face_enroll_education); Loading @@ -154,6 +153,8 @@ public class FaceEnrollEducation extends BiometricEnrollBase { mIllustrationDefault = findViewById(R.id.illustration_default); mIllustrationLottie = findViewById(R.id.illustration_lottie); mIllustrationAccessibility = findViewById(R.id.illustration_accessibility); mIsUsingExpressiveStyle = ThemeHelper.shouldApplyGlifExpressiveStyle( getApplicationContext()); if (mIsUsingExpressiveStyle && mIllustrationAccessibility instanceof ImageView) { ((ImageView) mIllustrationAccessibility).setImageResource( R.drawable.face_enroll_icon_large_expressive); Loading
src/com/android/settings/password/ChooseLockGeneric.java +2 −1 Original line number Diff line number Diff line Loading @@ -102,6 +102,7 @@ import com.android.settingslib.core.AbstractPreferenceController; import com.android.settingslib.widget.FooterPreference; import com.google.android.setupcompat.util.WizardManagerHelper; import com.google.android.setupdesign.util.ThemeHelper; import java.util.ArrayList; Loading Loading @@ -457,7 +458,7 @@ public class ChooseLockGeneric extends SettingsActivity { } } else { textView.setText(""); if (BiometricUtils.useExpressiveStyle(getContext(), getIntent())) { if (ThemeHelper.shouldApplyGlifExpressiveStyle(getContext())) { textView.setVisibility(View.GONE); } } Loading
tests/robotests/src/com/android/settings/biometrics/face/FaceEnrollIntroductionTest.java +64 −11 Original line number Diff line number Diff line Loading @@ -76,6 +76,7 @@ import com.android.settings.testutils.shadow.ShadowLockPatternUtils; import com.android.settings.testutils.shadow.ShadowSensorPrivacyManager; import com.android.settings.testutils.shadow.ShadowUserManager; import com.android.settings.testutils.shadow.ShadowUtils; import com.android.settingslib.widget.SettingsThemeHelper; import com.google.android.setupcompat.template.FooterBarMixin; import com.google.android.setupcompat.template.FooterButton; Loading @@ -99,6 +100,8 @@ import org.robolectric.RobolectricTestRunner; import org.robolectric.Shadows; import org.robolectric.android.controller.ActivityController; import org.robolectric.annotation.Config; import org.robolectric.annotation.Implementation; import org.robolectric.annotation.Implements; import org.robolectric.shadows.ShadowActivity; import java.util.ArrayList; Loading @@ -112,7 +115,8 @@ import java.util.List; ShadowDevicePolicyManager.class, ShadowSensorPrivacyManager.class, SettingsShadowResources.class, ShadowAlertDialogCompat.class ShadowAlertDialogCompat.class, FaceEnrollIntroductionTest.ShadowSettingsThemeHelper.class, }) public class FaceEnrollIntroductionTest { Loading Loading @@ -202,6 +206,15 @@ public class FaceEnrollIntroductionTest { ShadowAlertDialogCompat.reset(); } private void setupNonExpressiveActivity() { ShadowSettingsThemeHelper.setExpressiveTheme(false); setupActivity(); } private void setupExpressiveActivity() { ShadowSettingsThemeHelper.setExpressiveTheme(true); setupActivity(); } private void setupActivity() { final Intent testIntent = new Intent(); // Set the challenge token so the confirm screen will not be shown Loading Loading @@ -233,6 +246,7 @@ public class FaceEnrollIntroductionTest { } private void setupActivityForPosture() { ShadowSettingsThemeHelper.setExpressiveTheme(false); final Intent testIntent = new Intent(); // Set the challenge token so the confirm screen will not be shown testIntent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE_TOKEN, new byte[0]); Loading Loading @@ -288,6 +302,21 @@ public class FaceEnrollIntroductionTest { when(mFaceManager.getEnrolledFaces(userId)).thenReturn(faces); } @Implements(SettingsThemeHelper.class) public static class ShadowSettingsThemeHelper { private static boolean sIsExpressiveTheme; /** Shadow implementation of isExpressiveTheme */ @Implementation public static boolean isExpressiveTheme(@NonNull Context context) { return sIsExpressiveTheme; } static void setExpressiveTheme(boolean isExpressiveTheme) { sIsExpressiveTheme = isExpressiveTheme; } } @Test public void intro_CheckCanEnroll() { setFaceManagerToHave(0 /* numEnrollments */); Loading Loading @@ -347,16 +376,40 @@ public class FaceEnrollIntroductionTest { @Test public void testFaceEnrollIntroduction_hasHeader() { setupActivity(); setupNonExpressiveActivity(); TextView headerTextView = getGlifLayout(mActivity).findViewById(R.id.suc_layout_title); assertThat(headerTextView).isNotNull(); assertThat(headerTextView.getText().toString()).isNotEmpty(); } @Test public void testFaceEnrollIntroduction_hasFooterBar_hasFooterButtons() { setupNonExpressiveActivity(); FooterBarMixin footer = getGlifLayout(mActivity).getMixin(FooterBarMixin.class); assertThat(footer).isNotNull(); assertThat(footer.getPrimaryButton()).isNotNull(); assertThat(footer.getPrimaryButton().getVisibility()).isEqualTo(View.VISIBLE); assertThat(footer.getSecondaryButton()).isNotNull(); assertThat(footer.getSecondaryButton().getVisibility()).isEqualTo(View.VISIBLE); } @Test public void testFaceEnrollIntroduction_isExpressiveStyle_hasFooterBar_hasFooterButtons() { setupExpressiveActivity(); FooterBarMixin footer = getGlifLayout(mActivity).getMixin(FooterBarMixin.class); assertThat(footer).isNotNull(); assertThat(footer.getPrimaryButton()).isNotNull(); assertThat(footer.getPrimaryButton().getVisibility()).isEqualTo(View.VISIBLE); assertThat(footer.getSecondaryButton()).isNotNull(); assertThat(footer.getSecondaryButton().getVisibility()).isEqualTo(View.VISIBLE); } @Test public void testFaceEnrollIntroduction_hasDescription_weakFace() throws Exception { setupActivity(); setupNonExpressiveActivity(); SettingsShadowResources.overrideResource( R.bool.config_face_intro_show_less_secure, true); Loading Loading @@ -387,7 +440,7 @@ public class FaceEnrollIntroductionTest { @Test public void testFaceEnrollIntroduction_hasDescriptionNoLessSecure_strongFace() throws Exception { setupActivity(); setupNonExpressiveActivity(); SettingsShadowResources.overrideResource( R.bool.config_face_intro_show_less_secure, true); Loading Loading @@ -418,7 +471,7 @@ public class FaceEnrollIntroductionTest { @Test public void testFaceEnrollIntroduction_hasBottomScrollView() { setupActivity(); setupNonExpressiveActivity(); BottomScrollView scrollView = getGlifLayout(mActivity) .findViewById(com.google.android.setupdesign.R.id.sud_scroll_view); Loading @@ -428,7 +481,7 @@ public class FaceEnrollIntroductionTest { @Test public void testFaceEnrollIntroduction_showFooterPrimaryButton() { setupActivity(); setupNonExpressiveActivity(); FooterBarMixin footer = getGlifLayout(mActivity).getMixin(FooterBarMixin.class); FooterButton footerButton = footer.getPrimaryButton(); Loading @@ -440,7 +493,7 @@ public class FaceEnrollIntroductionTest { @Test public void testFaceEnrollIntroduction_footerSecondaryButtonWhenCanEnroll() { setupActivity(); setupNonExpressiveActivity(); FooterBarMixin footer = getGlifLayout(mActivity).getMixin(FooterBarMixin.class); FooterButton footerButton = footer.getSecondaryButton(); Loading Loading @@ -477,7 +530,7 @@ public class FaceEnrollIntroductionTest { @Test public void testFaceEnrollIntroduction_defaultNeverLaunchPostureGuidance() { setupActivity(); setupNonExpressiveActivity(); assertThat(mActivity.launchPostureGuidance()).isFalse(); assertThat(mActivity.getDevicePostureState()).isEqualTo(DEVICE_POSTURE_UNKNOWN); Loading @@ -485,7 +538,7 @@ public class FaceEnrollIntroductionTest { @Test public void testFaceEnrollIntroduction_onStartNeverRegisterPostureChangeCallback() { setupActivity(); setupNonExpressiveActivity(); mActivity.onStart(); assertThat(mActivity.getPostureGuidanceIntent()).isNull(); Loading Loading @@ -692,7 +745,7 @@ public class FaceEnrollIntroductionTest { @Test public void testFaceEnrollIntroduction_forwardsEnrollOptions() { setupActivity(); setupNonExpressiveActivity(); final Intent intent = mActivity.getEnrollingIntent(); assertThat(intent.getIntExtra(BiometricUtils.EXTRA_ENROLL_REASON, -1)) Loading @@ -701,7 +754,7 @@ public class FaceEnrollIntroductionTest { @Test public void drops_pendingIntents() { setupActivity(); setupNonExpressiveActivity(); mController.start(); Shadows.shadowOf(Looper.getMainLooper()).idle(); Loading