Update string displayed on work pin/password challenge

* The incorrect string was being displayed when the user
  was asked to enter their pin/password.
* Updated the string to include **work** instead of
  **device** when entering a work pin/password.

Bug: 148211118
Test: Manual testing
Change-Id: I2239a5011dec62fd63574bbf75495548ddd0d907
This commit is contained in:
Alex Johnston
2020-01-28 17:49:33 +00:00
parent 613371047b
commit 28c6b577ad
2 changed files with 10 additions and 5 deletions

View File

@@ -56,12 +56,16 @@ import java.util.ArrayList;
public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity {
// The index of the array is isStrongAuth << 1 + isAlpha.
// The index of the array is isStrongAuth << 2 + isManagedProfile << 1 + isAlpha.
private static final int[] DETAIL_TEXTS = new int[] {
R.string.lockpassword_confirm_your_pin_generic,
R.string.lockpassword_confirm_your_password_generic,
R.string.lockpassword_confirm_your_pin_generic_profile,
R.string.lockpassword_confirm_your_password_generic_profile,
R.string.lockpassword_strong_auth_required_device_pin,
R.string.lockpassword_strong_auth_required_device_password
R.string.lockpassword_strong_auth_required_device_password,
R.string.lockpassword_strong_auth_required_work_pin,
R.string.lockpassword_strong_auth_required_work_password
};
public static class InternalActivity extends ConfirmLockPassword {
@@ -218,8 +222,9 @@ public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity {
: R.string.lockpassword_confirm_your_pin_details_frp;
}
boolean isStrongAuthRequired = isStrongAuthRequired();
// Map boolean flags to an index by isStrongAuth << 1 + isAlpha.
int index = ((isStrongAuthRequired ? 1 : 0) << 1) + (mIsAlpha ? 1 : 0);
// Map boolean flags to an index by isStrongAuth << 2 + isManagedProfile << 1 + isAlpha.
int index = ((isStrongAuthRequired ? 1 : 0) << 2) + ((mIsManagedProfile ? 1 : 0) << 1)
+ (mIsAlpha ? 1 : 0);
return DETAIL_TEXTS[index];
}

View File

@@ -239,7 +239,7 @@ public class ConfirmLockPattern extends ConfirmDeviceCredentialBaseActivity {
return R.string.lockpassword_confirm_your_pattern_details_frp;
}
final boolean isStrongAuthRequired = isStrongAuthRequired();
if (UserManager.get(getActivity()).isManagedProfile(mEffectiveUserId)) {
if (mIsManagedProfile) {
return isStrongAuthRequired
? R.string.lockpassword_strong_auth_required_work_pattern
: R.string.lockpassword_confirm_your_pattern_generic_profile;