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

Commit 38c9b9eb authored by Adrian Roos's avatar Adrian Roos
Browse files

Update FRP warning to spec

Bug: 22672924
Change-Id: Ie275d5099553539707f86bf0e8cec5d5022ad227
parent 36c76014
Loading
Loading
Loading
Loading
+22 −11
Original line number Diff line number Diff line
@@ -958,9 +958,6 @@
    <!-- Summary specifying that this is the current screen lock setting [CHAR LIMIT=45] -->
    <string name="current_screen_lock">Current screen lock</string>
    <!--  Content of warning dialog about disabling device protection features when user is switching from a secure unlock method to an insecure one. [CHAR LIMIT=NONE] -->
    <string name="unlock_disable_frp_warning_content">Device protection features will no longer work.</string>
    <!-- Summary for preference that has been disabled by because of the DevicePolicyAdmin, or because device encryption is enabled, or because there are credentials in the credential storage [CHAR LIMIT=50] -->
    <string name="unlock_set_unlock_disabled_summary">Disabled by administrator, encryption policy, or credential storage</string>
@@ -983,14 +980,28 @@
    <!-- Title for option to turn of password/pin/pattern unlock. [CHAR LIMIT=22] -->
    <string name="unlock_disable_lock_title">Turn off screen lock</string>
    <!-- Summary shown under unlock_disable_lock_title when pattern is in use and can be removed [CHAR LIMIT=45] -->
    <string name="unlock_disable_lock_pattern_summary">Remove unlock pattern</string>
    <!-- Summary shown under unlock_disable_lock_title when PIN is in use and can be removed [CHAR LIMIT=45]-->
    <string name="unlock_disable_lock_pin_summary">Remove unlock PIN</string>
    <!-- Summary shown under unlock_disable_lock_title when password is in use and can be removed [CHAR LIMIT=45]-->
    <string name="unlock_disable_lock_password_summary">Remove unlock password</string>
    <!-- Summary shown under unlock_disable_lock_title when an unknown secure unlocking method is in use and can be removed [CHAR LIMIT=45]-->
    <string name="unlock_disable_lock_unknown_summary">Remove screen lock</string>
    <!-- Title of the dialog shown when the user removes the device lock [CHAR LIMIT=NONE] -->
    <string name="unlock_disable_frp_warning_title">Remove device protection?</string>
    <!-- Content of the dialog shown when the user removes the device lock pattern [CHAR LIMIT=NONE] -->
    <string name="unlock_disable_frp_warning_content_pattern">"Device protection features will not work without your pattern."</string>
    <!-- Content of the dialog shown when the user removes the device lock pattern and the user has fingerprints enrolled [CHAR LIMIT=NONE] -->
    <string name="unlock_disable_frp_warning_content_pattern_fingerprint">"Device protection features will not work without your pattern.<xliff:g id="empty_line">\n\n</xliff:g>Your saved fingerprints will also be removed from this device and you won't be able to unlock your phone, authorize purchases, or sign in to apps with them."</string>
    <!-- Content of the dialog shown when the user removes the device lock PIN [CHAR LIMIT=NONE] -->
    <string name="unlock_disable_frp_warning_content_pin">"Device protection features will not work without your PIN."</string>
    <!-- Content of the dialog shown when the user removes the device lock PIN and the user has fingerprints enrolled [CHAR LIMIT=NONE] -->
    <string name="unlock_disable_frp_warning_content_pin_fingerprint">"Device protection features will not work without your PIN.<xliff:g id="empty_line">\n\n</xliff:g>Your saved fingerprints will also be removed from this device and you won't be able to unlock your phone, authorize purchases, or sign in to apps with them."</string>
    <!-- Content of the dialog shown when the user removes the device lock password [CHAR LIMIT=NONE] -->
    <string name="unlock_disable_frp_warning_content_password">"Device protection features will not work without your password."</string>
    <!-- Content of the dialog shown when the user removes the device lock password and the user has fingerprints enrolled [CHAR LIMIT=NONE] -->
    <string name="unlock_disable_frp_warning_content_password_fingerprint">"Device protection features will not work without your password.<xliff:g id="empty_line">\n\n</xliff:g>Your saved fingerprints will also be removed from this device and you won't be able to unlock your phone, authorize purchases, or sign in to apps with them."</string>
    <!-- Content of the dialog shown when the user removes the device lock of unknown type [CHAR LIMIT=NONE] -->
    <string name="unlock_disable_frp_warning_content_unknown">"Device protection features will not work without your screen lock."</string>
    <!-- Content of the dialog shown when the user removes the device lock of unknown type and the user has fingerprints enrolled [CHAR LIMIT=NONE] -->
    <string name="unlock_disable_frp_warning_content_unknown_fingerprint">"Device protection features will not work without your screen lock.<xliff:g id="empty_line">\n\n</xliff:g>Your saved fingerprints will also be removed from this device and you won't be able to unlock your phone, authorize purchases, or sign in to apps with them."</string>
    <!-- Affirmative action of the dialog shown when the user removes the device lock [CHAR LIMIT=25] -->
    <string name="unlock_disable_frp_warning_ok">Yes, remove</string>
    <!-- Title shown on security settings to allow the user to change their lockscreen pattern [CHAR LIMIT=22] -->
    <string name="unlock_change_lock_pattern_title">Change unlock pattern</string>
+22 −13
Original line number Diff line number Diff line
@@ -500,19 +500,28 @@ public class ChooseLockGeneric extends SettingsActivity {
            return R.string.help_url_choose_lockscreen;
        }

        private int getResIdForFactoryResetProtectionWarningTitle() {
        private int getResIdForFactoryResetProtectionWarningMessage() {
            boolean hasFingerprints = mFingerprintManager.hasEnrolledFingerprints();
            switch (mLockPatternUtils.getKeyguardStoredPasswordQuality(UserHandle.myUserId())) {
                case DevicePolicyManager.PASSWORD_QUALITY_SOMETHING:
                    return R.string.unlock_disable_lock_pattern_summary;
                    return hasFingerprints
                            ? R.string.unlock_disable_frp_warning_content_pattern_fingerprint
                            : R.string.unlock_disable_frp_warning_content_pattern;
                case DevicePolicyManager.PASSWORD_QUALITY_NUMERIC:
                case DevicePolicyManager.PASSWORD_QUALITY_NUMERIC_COMPLEX:
                    return R.string.unlock_disable_lock_pin_summary;
                    return hasFingerprints
                            ? R.string.unlock_disable_frp_warning_content_pin_fingerprint
                            : R.string.unlock_disable_frp_warning_content_pin;
                case DevicePolicyManager.PASSWORD_QUALITY_ALPHABETIC:
                case DevicePolicyManager.PASSWORD_QUALITY_ALPHANUMERIC:
                case DevicePolicyManager.PASSWORD_QUALITY_COMPLEX:
                    return R.string.unlock_disable_lock_password_summary;
                    return hasFingerprints
                            ? R.string.unlock_disable_frp_warning_content_password_fingerprint
                            : R.string.unlock_disable_frp_warning_content_password;
                default:
                    return R.string.unlock_disable_lock_unknown_summary;
                    return hasFingerprints
                            ? R.string.unlock_disable_frp_warning_content_unknown_fingerprint
                            : R.string.unlock_disable_frp_warning_content_unknown;
            }
        }

@@ -547,23 +556,23 @@ public class ChooseLockGeneric extends SettingsActivity {
        }

        private void showFactoryResetProtectionWarningDialog(String unlockMethodToSet) {
            int title = getResIdForFactoryResetProtectionWarningTitle();
            int message = getResIdForFactoryResetProtectionWarningMessage();
            FactoryResetProtectionWarningDialog dialog =
                    FactoryResetProtectionWarningDialog.newInstance(title, unlockMethodToSet);
                    FactoryResetProtectionWarningDialog.newInstance(message, unlockMethodToSet);
            dialog.show(getChildFragmentManager(), TAG_FRP_WARNING_DIALOG);
        }

        public static class FactoryResetProtectionWarningDialog extends DialogFragment {

            private static final String ARG_TITLE_RES = "titleRes";
            private static final String ARG_MESSAGE_RES = "messageRes";
            private static final String ARG_UNLOCK_METHOD_TO_SET = "unlockMethodToSet";

            public static FactoryResetProtectionWarningDialog newInstance(int title,
            public static FactoryResetProtectionWarningDialog newInstance(int messageRes,
                    String unlockMethodToSet) {
                FactoryResetProtectionWarningDialog frag =
                        new FactoryResetProtectionWarningDialog();
                Bundle args = new Bundle();
                args.putInt(ARG_TITLE_RES, title);
                args.putInt(ARG_MESSAGE_RES, messageRes);
                args.putString(ARG_UNLOCK_METHOD_TO_SET, unlockMethodToSet);
                frag.setArguments(args);
                return frag;
@@ -582,9 +591,9 @@ public class ChooseLockGeneric extends SettingsActivity {
                final Bundle args = getArguments();

                return new AlertDialog.Builder(getActivity())
                        .setTitle(args.getInt(ARG_TITLE_RES))
                        .setMessage(R.string.unlock_disable_frp_warning_content)
                        .setPositiveButton(R.string.okay,
                        .setTitle(R.string.unlock_disable_frp_warning_title)
                        .setMessage(args.getInt(ARG_MESSAGE_RES))
                        .setPositiveButton(R.string.unlock_disable_frp_warning_ok,
                                new DialogInterface.OnClickListener() {
                                    @Override
                                    public void onClick(DialogInterface dialog, int whichButton) {