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

Commit 6600ddec authored by Adrian Roos's avatar Adrian Roos
Browse files

FRP: Add dedicated explanation strings for ConfirmCredential

Change-Id: I1bf63898509032560cd302fde9dfe05473336e49
Fixes: 63958816
Test: adb shell settings put global device_provisioned 1 && adb shell am start -a android.app.action.CONFIRM_FRP_CREDENTIAL; verify strings
parent 5984c71a
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -3491,6 +3491,20 @@
         continue. [CHAR LIMIT=100] -->
    <string name="lockpassword_strong_auth_required_work_password">For added security, enter your work password</string>
    <!-- An explanation text that the pattern needs to be solved because the device was factory reset. [CHAR LIMIT=100] -->
    <string name="lockpassword_confirm_your_pattern_details_frp">Your phone was reset to factory settings. To use this phone, enter your previous pattern.</string>
    <!-- An explanation text that the pin needs to be solved because the device was factory reset. [CHAR LIMIT=100] -->
    <string name="lockpassword_confirm_your_pin_details_frp">Your phone was reset to factory settings. To use this phone, enter your previous PIN.</string>
    <!-- An explanation text that the password needs to be solved because the device was factory reset. [CHAR LIMIT=100] -->
    <string name="lockpassword_confirm_your_password_details_frp">Your phone was reset to factory settings. To use this phone, enter your previous password.</string>
    <!-- Header shown when pattern needs to be solved because the device was factory reset. [CHAR LIMIT=100] -->
    <string name="lockpassword_confirm_your_pattern_header_frp">Verify pattern</string>
    <!-- Header shown when the pin needs to be solved because the device was factory reset. [CHAR LIMIT=100] -->
    <string name="lockpassword_confirm_your_pin_header_frp">Verify PIN</string>
    <!-- Header shown when the password needs to be solved because the device was factory reset. [CHAR LIMIT=100] -->
    <string name="lockpassword_confirm_your_password_header_frp">Verify password</string>
    <!-- Security & location settings screen, change security method screen instruction if user
         enters incorrect PIN [CHAR LIMIT=30] -->
    <string name="lockpassword_invalid_pin">Wrong PIN</string>
+8 −0
Original line number Diff line number Diff line
@@ -197,11 +197,19 @@ public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity {
        }

        private int getDefaultHeader() {
            if (mFrp) {
                return mIsAlpha ? R.string.lockpassword_confirm_your_password_header_frp
                        : R.string.lockpassword_confirm_your_pin_header_frp;
            }
            return mIsAlpha ? R.string.lockpassword_confirm_your_password_header
                    : R.string.lockpassword_confirm_your_pin_header;
        }

        private int getDefaultDetails() {
            if (mFrp) {
                return mIsAlpha ? R.string.lockpassword_confirm_your_password_details_frp
                        : R.string.lockpassword_confirm_your_pin_details_frp;
            }
            boolean isStrongAuthRequired = isStrongAuthRequired();
            boolean isProfile = UserManager.get(getActivity()).isManagedProfile(mEffectiveUserId);
            // Map boolean flags to an index by isStrongAuth << 2 + isProfile << 1 + isAlpha.
+9 −1
Original line number Diff line number Diff line
@@ -243,6 +243,9 @@ public class ConfirmLockPattern extends ConfirmDeviceCredentialBaseActivity {
        }

        private int getDefaultDetails() {
            if (mFrp) {
                return R.string.lockpassword_confirm_your_pattern_details_frp;
            }
            final boolean isStrongAuthRequired = isStrongAuthRequired();
            if (UserManager.get(getActivity()).isManagedProfile(mEffectiveUserId)) {
                return isStrongAuthRequired
@@ -296,7 +299,7 @@ public class ConfirmLockPattern extends ConfirmDeviceCredentialBaseActivity {
                    if (mHeaderText != null) {
                        mHeaderTextView.setText(mHeaderText);
                    } else {
                        mHeaderTextView.setText(R.string.lockpassword_confirm_your_pattern_header);
                        mHeaderTextView.setText(getDefaultHeader());
                    }
                    if (mDetailsText != null) {
                        mDetailsTextView.setText(mDetailsText);
@@ -331,6 +334,11 @@ public class ConfirmLockPattern extends ConfirmDeviceCredentialBaseActivity {
            mHeaderTextView.announceForAccessibility(mHeaderTextView.getText());
        }

        private int getDefaultHeader() {
            return mFrp ? R.string.lockpassword_confirm_your_pattern_header_frp
                    : R.string.lockpassword_confirm_your_pattern_header;
        }

        private Runnable mClearPatternRunnable = new Runnable() {
            public void run() {
                mLockPatternView.clearPattern();