PAN-20279 [ORG] No proper identification of blocked SIM
前提
-在两个SIM卡插槽中,插入SIM卡并启用PIN请求。
-SIM2被PIN阻止并要求PUK1
测试步骤
-重启设备并检查是否仍然请求插槽1中SIM的PIN1代码和插槽2中SIM的PUK1代码。
预期成绩
-请求并接受插槽1中SIM的PIN1代码。
-请求插槽2中SIM卡的PUK1解锁PIN1码。
实际结果
当在sim2上阻塞puk1然后执行断电时,问题与sim的识别错误有关。 预期的行为是,在断电后,请求pinim1,然后请求puk1 sim2。 断电后,设备首先要求puk1 sim2代码,而不提及所涉及的SIM卡。 因此,用户无法了解哪个引脚被阻止。
在这种情况下,预期的行为是:
-请求pinsim1然后请求puk1sim2。
-puk1请求应清楚地标识相关的sim。
因为在Android源码中, SIM卡的PIN码区分卡, PUK是不区分的, 需修改代码, 代码修改如下:
frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSimPukView.java
public class KeyguardSimPukView extends KeyguardPinBasedInputView {
private int mSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
private ImageView mSimImageView;
+ private int mSlotId;
private void showDefaultMessage() {
if (mRemainingAttempts >= 0) {
mSecurityMessageDisplay.setMessage(getPukPasswordErrorMessage(
mRemainingAttempts, true));
return;
}
boolean isEsimLocked = KeyguardEsimArea.isEsimLocked(mContext, mSubId);
+ mSlotId = SubscriptionManager.getSlotIndex(mSubId) + 1;
int count = TelephonyManager.getDefault().getSimCount();
......
private String getPukPasswordErrorMessage(int attemptsRemaining, boolean isDefault) {
String displayMessage;
if (attemptsRemaining == 0) {
displayMessage = getContext().getString(R.string.kg_password_wrong_puk_code_dead);
} else if (attemptsRemaining > 0) {
int msgId = isDefault ? R.plurals.kg_password_default_puk_message :
R.plurals.kg_password_wrong_puk_code;
displayMessage = getContext().getResources()
.getQuantityString(msgId, attemptsRemaining, mSlotId, attemptsRemaining);
} else {
int msgId = isDefault ? R.string.kg_puk_enter_puk_hint :
R.string.kg_password_puk_failed;
displayMessage = getContext().getString(msgId);
}
frameworks/base/packages/SystemUI/res-keyguard/values/strings.xml
<!-- Instructions telling the user remaining times when enter SIM PUK view. -->
<plurals name="kg_password_default_puk_message">
<item quantity="one">SIM<xliff:g id="slotid">%d</xliff:g> is now disabled. Enter PUK code to continue. You have <xliff:g id="
number">%d</xliff:g> remaining attempt before SIM becomes permanently unusable. Contact carrier for details.</item>
<item quantity="other">SIM<xliff:g id="slotid">%d</xliff:g> is now disabled. Enter PUK code to continue. You have <xliff:g id="
number">%d</xliff:g> remaining attempts before SIM becomes permanently unusable. Contact carrier for details.</item>
</plurals>