The text on toast should be changed when remains 1 time for SIM lock input

The behavior of getQuantityString() is different according to language, it gets
both "other" and "one" string if English is system language. But it always gets
"other" string if non-English, then the "other" string of wrong_pin_code is
shown even if remains 1 time of SIM lock input.

In order to change the string in any language, we add new string for
remains 1 time.

Bug: 71783850
Change-Id: I5de35eb71905b77028bf25226381e1ba79a37e92
This commit is contained in:
xiyuan.wang
2017-12-28 11:24:40 +08:00
committed by Yoshiaki Maruoka
parent 78bfc6f55f
commit b63de874fa
80 changed files with 84 additions and 1 deletions

View File

@@ -487,7 +487,9 @@ public class IccLockSettings extends SettingsPreferenceFragment
if (attemptsRemaining == 0) {
displayMessage = mRes.getString(R.string.wrong_pin_code_pukked);
} else if (attemptsRemaining > 0) {
} else if (attemptsRemaining == 1) {
displayMessage = mRes.getString(R.string.wrong_pin_code_one, attemptsRemaining);
} else if (attemptsRemaining > 1) {
displayMessage = mRes
.getQuantityString(R.plurals.wrong_pin_code, attemptsRemaining,
attemptsRemaining);