Commit 959f7c41 authored by Azeem Arshad's avatar Azeem Arshad Committed by Chromium LUCI CQ

[CrOS Cellular] Fix PIN/PUK unlock error strings.

This CL updates error strings in PIN/PUK unlock dialog.
This makes it clear that network connection will be lost
after final attempt. This also separates PUK error string
from warning and moves it closer to corresponding input
button.

Fixed: 1155235
Change-Id: I28668a1699843a08010e6e5311b9176e8d56ecea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2579808Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Commit-Queue: Azeem Arshad <azeemarshad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#834985}
parent 8272b59d
......@@ -2134,7 +2134,7 @@
SIM Card is locked
</message>
<message name="IDS_SETTINGS_INTERNET_NETWORK_SIM_LOCKED_WARNING" desc="Settings > Internet > Network details > Lock/unlock SIM card: Warning for SIM locked dialog when PUK is required.">
Your SIM card will be permanently disabled if you cannot enter the correct PIN Unlock Key.
If you fail to verify, your network access will be disabled.
</message>
<message name="IDS_SETTINGS_INTERNET_NETWORK_SIM_ENTER_PIN" desc="Settings > Internet > Network details > Lock/unlock SIM card: Label for entering a PIN.">
Enter PIN
......@@ -2151,17 +2151,29 @@
<message name="IDS_SETTINGS_INTERNET_NETWORK_SIM_ENTER_PUK" desc="Settings > Internet > Network details > Lock/unlock SIM card: Label for entering a PUK.">
Enter PIN Unlock Key
</message>
<message name="IDS_SETTINGS_INTERNET_NETWORK_SIM_ERROR_INCORRECT_PIN" desc="Settings > Internet > Network details > Lock/unlock SIM card: Message when an incorrect PIN was entered.">
Incorrect PIN. Retries left: <ph name="RETRIES">$1<ex>3</ex></ph>.
<message name="IDS_SETTINGS_INTERNET_NETWORK_SIM_ERROR_INCORRECT_PIN" desc="Settings > Internet > Network details > Lock/unlock SIM card: Message when an incorrect PIN was entered and there is only a single retry attempt remaining.">
Incorrect PIN. You have 1 remaining attempt.
</message>
<message name="IDS_SETTINGS_INTERNET_NETWORK_SIM_ERROR_INCORRECT_PIN_PLURAL" desc="Settings > Internet > Network details > Lock/unlock SIM card: Message when an incorrect PIN was entered and there are multiple retry attempts remaining.">
Incorrect PIN. You have <ph name="RETRIES">$1<ex>3</ex></ph> remaining attempts.
</message>
<message name="IDS_SETTINGS_INTERNET_NETWORK_SIM_ERROR_INCORRECT_PUK" desc="Settings > Internet > Network details > Lock/unlock SIM card: Message when an incorrect PUK was entered.">
Incorrect PUK. Retries left: <ph name="RETRIES">$1<ex>3</ex></ph>.
Incorrect PUK. You have 1 remaining attempt before you must contact your carrier to regain network access.
</message>
<message name="IDS_SETTINGS_INTERNET_NETWORK_SIM_ERROR_INCORRECT_PUK_PLURAL" desc="Settings > Internet > Network details > Lock/unlock SIM card: Message when an incorrect PUK was entered and there is only a single retry attempte remaining.">
Incorrect PUK. You have <ph name="RETRIES">$1<ex>3</ex></ph> remaining attempts before you must contact your carrier to regain network access.
</message>
<message name="IDS_SETTINGS_INTERNET_NETWORK_SIM_ERROR_INVALID_PIN" desc="Settings > Internet > Network details > Lock/unlock SIM card: Message when an invalid PIN was entered.">
Invalid PIN. Retries left: <ph name="RETRIES">$1<ex>3</ex></ph>.
Invalid PIN. You have 1 remaining attempt.
</message>
<message name="IDS_SETTINGS_INTERNET_NETWORK_SIM_ERROR_INVALID_PIN_PLURAL" desc="Settings > Internet > Network details > Lock/unlock SIM card: Message when an invalid PIN was entered and there are multiple retry attempts remaining.">
Invalid PIN. You have <ph name="RETRIES">$1<ex>3</ex></ph> remaining attempts.
</message>
<message name="IDS_SETTINGS_INTERNET_NETWORK_SIM_ERROR_INVALID_PUK" desc="Settings > Internet > Network details > Lock/unlock SIM card: Message when an invalid PUK was entered and there is only a single retry attempt remaining.">
Invalid PUK. You have 1 remaining attempt.
</message>
<message name="IDS_SETTINGS_INTERNET_NETWORK_SIM_ERROR_INVALID_PUK" desc="Settings > Internet > Network details > Lock/unlock SIM card: Message when an invalid PUK was entered.">
Invalid PUK. Retries left: <ph name="RETRIES">$1<ex>3</ex></ph>.
<message name="IDS_SETTINGS_INTERNET_NETWORK_SIM_ERROR_INVALID_PUK_PLURAL" desc="Settings > Internet > Network details > Lock/unlock SIM card: Message when an invalid PUK was entered and there are multiple retry attempts remaining.">
Invalid PUK. You have <ph name="RETRIES">$1<ex>3</ex></ph> remaining attempts.
</message>
<message name="IDS_SETTINGS_INTERNET_NETWORK_SIM_ERROR_PIN_MISMATCH" desc="Settings > Internet > Network details > Lock/unlock SIM card: Message when PIN values do not match.">
PIN values do not match.
......
3cce6a6d3e0fed415be0b91444472f41a60b0d1a
\ No newline at end of file
46dfa3fd9075d3fc6c07f493d4da01b9f5da0d38
\ No newline at end of file
05eddea8d6ff61df66fa5901cc00cd4b17b1a2aa
\ No newline at end of file
4ff4ba737231e1a3c7733b124ceae8f2c026b819
\ No newline at end of file
272825c98b547f36f792e1688fdc1d615f5a52ee
\ No newline at end of file
c973a1d4b4457cac723d3b55c97ae4c8afcbdb14
\ No newline at end of file
c6c82af3bf591569c8f4adaf6d5255c8acc8804c
\ No newline at end of file
......@@ -292,12 +292,20 @@ void AddDetailsLocalizedStrings(content::WebUIDataSource* html_source) {
IDS_SETTINGS_INTERNET_NETWORK_SIM_RE_ENTER_NEW_PIN},
{"networkSimErrorIncorrectPin",
IDS_SETTINGS_INTERNET_NETWORK_SIM_ERROR_INCORRECT_PIN},
{"networkSimErrorIncorrectPinPlural",
IDS_SETTINGS_INTERNET_NETWORK_SIM_ERROR_INCORRECT_PIN_PLURAL},
{"networkSimErrorIncorrectPuk",
IDS_SETTINGS_INTERNET_NETWORK_SIM_ERROR_INCORRECT_PUK},
{"networkSimErrorIncorrectPukPlural",
IDS_SETTINGS_INTERNET_NETWORK_SIM_ERROR_INCORRECT_PUK_PLURAL},
{"networkSimErrorInvalidPin",
IDS_SETTINGS_INTERNET_NETWORK_SIM_ERROR_INVALID_PIN},
{"networkSimErrorInvalidPinPlural",
IDS_SETTINGS_INTERNET_NETWORK_SIM_ERROR_INVALID_PIN_PLURAL},
{"networkSimErrorInvalidPuk",
IDS_SETTINGS_INTERNET_NETWORK_SIM_ERROR_INVALID_PUK},
{"networkSimErrorInvalidPukPlural",
IDS_SETTINGS_INTERNET_NETWORK_SIM_ERROR_INVALID_PUK_PLURAL},
{"networkSimErrorPinMismatch",
IDS_SETTINGS_INTERNET_NETWORK_SIM_ERROR_PIN_MISMATCH},
{"networkSimUnlock", IDS_SETTINGS_INTERNET_NETWORK_SIM_BUTTON_UNLOCK},
......
......@@ -29,7 +29,7 @@
color: red;
font-size: 125%;
font-weight: 500;
margin-top: 10px;
margin-bottom: 10px;
}
.error {
......@@ -181,6 +181,9 @@
label="[[i18n('networkSimEnterPuk')]]"
disabled="[[inProgress_]]">
</network-password-input>
<div class="dialog-error">
[[getErrorMsg_(error_, deviceState)]]
</div>
<network-password-input id="unlockPin1" value="{{pin_new1_}}"
label="[[i18n('networkSimEnterNewPin')]]"
disabled="[[inProgress_]]">
......@@ -192,9 +195,6 @@
<div class="dialog-error">
[[i18n('networkSimLockedWarning')]]
</div>
<div class="dialog-error">
[[getErrorMsg_(error_, deviceState)]]
</div>
</div>
<div slot="button-container">
<cr-button class="cancel-button" on-click="closeDialogs_">
......
......@@ -508,29 +508,36 @@ Polymer({
getErrorMsg_() {
if (this.error_ === ErrorType.NONE) {
return '';
} else if (this.error_ === ErrorType.MISMATCHED_PIN) {
return this.i18n('networkSimErrorPinMismatch');
}
let errorStringId = '';
switch (this.error_) {
case ErrorType.INCORRECT_PIN:
errorStringId = 'networkSimErrorIncorrectPin';
break;
case ErrorType.INCORRECT_PUK:
errorStringId = 'networkSimErrorIncorrectPuk';
break;
case ErrorType.INVALID_PIN:
errorStringId = 'networkSimErrorInvalidPin';
break;
case ErrorType.INVALID_PUK:
errorStringId = 'networkSimErrorInvalidPuk';
break;
default:
assertNotReached();
}
const retriesLeft = (this.simUnlockSent_ && this.deviceState &&
this.deviceState.simLockStatus) ?
this.deviceState.simLockStatus.retriesLeft :
0;
if (this.error_ === ErrorType.INCORRECT_PIN) {
return this.i18n('networkSimErrorIncorrectPin', retriesLeft);
}
if (this.error_ === ErrorType.INCORRECT_PUK) {
return this.i18n('networkSimErrorIncorrectPuk', retriesLeft);
}
if (this.error_ === ErrorType.MISMATCHED_PIN) {
return this.i18n('networkSimErrorPinMismatch');
}
if (this.error_ === ErrorType.INVALID_PIN) {
return this.i18n('networkSimErrorInvalidPin', retriesLeft);
}
if (this.error_ === ErrorType.INVALID_PUK) {
return this.i18n('networkSimErrorInvalidPuk', retriesLeft);
if (retriesLeft > 1) {
errorStringId += 'Plural';
}
assertNotReached();
return '';
return this.i18n(errorStringId, retriesLeft);
},
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment