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

Commit 3859643c authored by Maurice Lam's avatar Maurice Lam
Browse files

[LockScreenSetup] Start SUW-style screens in setup flow

Implement the new overloaded methods in the setup-specific screens
so that the SUW-styled screens will be started instead of the regular
ones as seen in Settings.

Bug: 20304053
Change-Id: I68e778e6421cfe08e20c9b4af9ed98e0f5ebcee1
parent a928ff4a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -403,7 +403,7 @@ public class ChooseLockGeneric extends SettingsActivity {
                    maxLength, requirePasswordToDecrypt, challenge);
        }

        private Intent getLockPasswordIntent(Context context, int quality, int minLength,
        protected Intent getLockPasswordIntent(Context context, int quality, int minLength,
                final int maxLength, boolean requirePasswordToDecrypt, String password) {
            return ChooseLockPassword.createIntent(context, quality, minLength, maxLength,
                    requirePasswordToDecrypt, password);
@@ -420,7 +420,7 @@ public class ChooseLockGeneric extends SettingsActivity {
            return ChooseLockPattern.createIntent(context, requirePassword, challenge);
        }

        private Intent getLockPatternIntent(Context context, final boolean requirePassword,
        protected Intent getLockPatternIntent(Context context, final boolean requirePassword,
                final String pattern) {
            return ChooseLockPattern.createIntent(context, requirePassword, pattern);
        }
+4 −4
Original line number Diff line number Diff line
@@ -78,16 +78,16 @@ public class ChooseLockPassword extends SettingsActivity {

    public static Intent createIntent(Context context, int quality,
            int minLength, final int maxLength, boolean requirePasswordToDecrypt, String password) {
        Intent intent = createIntent(context, quality, minLength, maxLength, requirePasswordToDecrypt,
                false);
        Intent intent = createIntent(context, quality, minLength, maxLength,
                requirePasswordToDecrypt, false);
        intent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_PASSWORD, password);
        return intent;
    }

    public static Intent createIntent(Context context, int quality,
            int minLength, final int maxLength, boolean requirePasswordToDecrypt, long challenge) {
        Intent intent = createIntent(context, quality, minLength, maxLength, requirePasswordToDecrypt,
                false);
        Intent intent = createIntent(context, quality, minLength, maxLength,
                requirePasswordToDecrypt, false);
        intent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_HAS_CHALLENGE, true);
        intent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE, challenge);
        return intent;
+45 −8
Original line number Diff line number Diff line
@@ -130,19 +130,56 @@ public class SetupChooseLockGeneric extends ChooseLockGeneric

        @Override
        protected Intent getLockPasswordIntent(Context context, int quality,
                int minLength, int maxLength, boolean requirePasswordToDecrypt,
                boolean confirmCredentials) {
            final Intent intent = SetupChooseLockPassword.createIntent(context, quality,
                    minLength, maxLength, requirePasswordToDecrypt, confirmCredentials);
                int minLength, final int maxLength,
                boolean requirePasswordToDecrypt, boolean confirmCredentials) {
            final Intent intent = SetupChooseLockPassword.createIntent(context, quality, minLength,
                    maxLength, requirePasswordToDecrypt, confirmCredentials);
            SetupWizardUtils.copySetupExtras(getActivity().getIntent(), intent);
            return intent;
        }

        @Override
        protected Intent getLockPatternIntent(Context context,
                boolean requirePassword, boolean confirmCredentials) {
            final Intent intent = SetupChooseLockPattern.createIntent(context,
                    requirePassword, confirmCredentials);
        protected Intent getLockPasswordIntent(Context context, int quality,
                int minLength, final int maxLength,
                boolean requirePasswordToDecrypt, long challenge) {
            final Intent intent = SetupChooseLockPassword.createIntent(context, quality, minLength,
                    maxLength, requirePasswordToDecrypt, challenge);
            SetupWizardUtils.copySetupExtras(getActivity().getIntent(), intent);
            return intent;
        }

        @Override
        protected Intent getLockPasswordIntent(Context context, int quality, int minLength,
                final int maxLength, boolean requirePasswordToDecrypt, String password) {
            final Intent intent = SetupChooseLockPassword.createIntent(context, quality, minLength,
                    maxLength, requirePasswordToDecrypt, password);
            SetupWizardUtils.copySetupExtras(getActivity().getIntent(), intent);
            return intent;
        }

        @Override
        protected Intent getLockPatternIntent(Context context, final boolean requirePassword,
                final boolean confirmCredentials) {
            final Intent intent = SetupChooseLockPattern.createIntent(context, requirePassword,
                    confirmCredentials);
            SetupWizardUtils.copySetupExtras(getActivity().getIntent(), intent);
            return intent;
        }

        @Override
        protected Intent getLockPatternIntent(Context context, final boolean requirePassword,
                long challenge) {
            final Intent intent = SetupChooseLockPattern.createIntent(context, requirePassword,
                    challenge);
            SetupWizardUtils.copySetupExtras(getActivity().getIntent(), intent);
            return intent;
        }

        @Override
        protected Intent getLockPatternIntent(Context context, final boolean requirePassword,
                final String pattern) {
            final Intent intent = SetupChooseLockPattern.createIntent(context, requirePassword,
                    pattern);
            SetupWizardUtils.copySetupExtras(getActivity().getIntent(), intent);
            return intent;
        }
+18 −0
Original line number Diff line number Diff line
@@ -48,6 +48,24 @@ public class SetupChooseLockPassword extends ChooseLockPassword
        return intent;
    }

    public static Intent createIntent(Context context, int quality,
            int minLength, final int maxLength, boolean requirePasswordToDecrypt, String password) {
        Intent intent = ChooseLockPassword.createIntent(context, quality, minLength, maxLength,
                requirePasswordToDecrypt, password);
        intent.setClass(context, SetupChooseLockPassword.class);
        intent.putExtra(EXTRA_PREFS_SHOW_BUTTON_BAR, false);
        return intent;
    }

    public static Intent createIntent(Context context, int quality,
            int minLength, final int maxLength, boolean requirePasswordToDecrypt, long challenge) {
        Intent intent = ChooseLockPassword.createIntent(context, quality, minLength, maxLength,
                requirePasswordToDecrypt, challenge);
        intent.setClass(context, SetupChooseLockPassword.class);
        intent.putExtra(EXTRA_PREFS_SHOW_BUTTON_BAR, false);
        return intent;
    }

    private SetupWizardNavBar mNavigationBar;
    private SetupChooseLockPasswordFragment mFragment;

+14 −2
Original line number Diff line number Diff line
@@ -38,14 +38,26 @@ import android.widget.Button;
public class SetupChooseLockPattern extends ChooseLockPattern
        implements SetupWizardNavBar.NavigationBarListener {

    public static Intent createIntent(Context context,
            boolean requirePassword, boolean confirmCredentials) {
    public static Intent createIntent(Context context, boolean requirePassword,
            boolean confirmCredentials) {
        Intent intent = ChooseLockPattern.createIntent(context, requirePassword,
                confirmCredentials);
        intent.setClass(context, SetupChooseLockPattern.class);
        return intent;
    }

    public static Intent createIntent(Context context, boolean requirePassword, String pattern) {
        Intent intent = ChooseLockPattern.createIntent(context, requirePassword, pattern);
        intent.setClass(context, SetupChooseLockPattern.class);
        return intent;
    }

    public static Intent createIntent(Context context, boolean requirePassword, long challenge) {
        Intent intent = ChooseLockPattern.createIntent(context, requirePassword, challenge);
        intent.setClass(context, SetupChooseLockPattern.class);
        return intent;
    }

    private SetupWizardNavBar mNavigationBar;
    private SetupChooseLockPatternFragment mFragment;