Fix Confirm/Choose Credentials strings related to profile

The messages in ConfirmDeviceCredentials have been updated to
inform the user that the pattern/pin/password to be entered is
the profile one.

The strings in the confirmation dialog when the user removes
the lock have also been updated.

Ideally we would have a parametrized approach to strings here,
but capitalization makes it a hard problem.

Bug: 26706338, 26709116
Change-Id: I9f5508d6f449f9e572d65e5b2dcb15cca23832b3
This commit is contained in:
Clara Bayarri
2016-01-22 14:59:24 +00:00
parent cc8d37a4c6
commit 34ec5f97fe
4 changed files with 99 additions and 19 deletions

View File

@@ -26,6 +26,7 @@ import android.os.Bundle;
import android.os.CountDownTimer;
import android.os.Handler;
import android.os.SystemClock;
import android.os.UserManager;
import android.os.storage.StorageManager;
import android.text.InputType;
import android.text.TextUtils;
@@ -180,8 +181,16 @@ public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity {
}
private int getDefaultDetails() {
return mIsAlpha ? R.string.lockpassword_confirm_your_password_generic
: R.string.lockpassword_confirm_your_pin_generic;
boolean isProfile = Utils.isManagedProfile(
UserManager.get(getActivity()), mEffectiveUserId);
if (mIsAlpha && !isProfile) {
return R.string.lockpassword_confirm_your_password_generic;
} else if (mIsAlpha && isProfile) {
return R.string.lockpassword_confirm_your_password_generic_profile;
} else if (!isProfile) {
return R.string.lockpassword_confirm_your_pin_generic;
}
return R.string.lockpassword_confirm_your_pin_generic_profile;
}
private int getErrorMessage() {