Merge "FRP: Add dedicated explanation strings for ConfirmCredential" into oc-mr1-dev am: a147d4a616
am: 1d192addc6
Change-Id: I1f349fbaad0c6807f1e3dccf30fe47b6c48d3eec
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 44342f4..f96e005 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -3502,6 +3502,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>
diff --git a/src/com/android/settings/password/ConfirmLockPassword.java b/src/com/android/settings/password/ConfirmLockPassword.java
index 328646b..dcb7b66 100644
--- a/src/com/android/settings/password/ConfirmLockPassword.java
+++ b/src/com/android/settings/password/ConfirmLockPassword.java
@@ -197,11 +197,19 @@
}
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.
diff --git a/src/com/android/settings/password/ConfirmLockPattern.java b/src/com/android/settings/password/ConfirmLockPattern.java
index eb42784..60d5a01 100644
--- a/src/com/android/settings/password/ConfirmLockPattern.java
+++ b/src/com/android/settings/password/ConfirmLockPattern.java
@@ -243,6 +243,9 @@
}
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 @@
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 @@
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();