PUK code prompt to distinguish SIM card (identification of blocked SIM)

PAN-20279 [ORG] No proper identification of blocked SIM
premise
-in two SIM card slots, insert the SIM card and enable PIN request.
-SIM2 is blocked by PIN and requires PUK1
test procedure
-restart the device and check if the PIN1 code of SIM in slot 1 and the PUK1 code of SIM in slot 2 are still requested.
Expected score
-request and accept the PIN1 code of the SIM in slot 1.
-Request the PUK1 of the SIM card in slot 2 to unlock the PIN1 code.
Actual results
When blocking puk1 on sim2 and then performing a power outage, the problem is related to the identification error of sim. The expected behavior is to request pinim1 and then puk1 sim2 after a power outage. After a power failure, the device first requires the puk1 sim2 code without mentioning the SIM card involved. Therefore, the user cannot know which pin is blocked.
In this case, the expected behavior is:
-request pinsim1 and then puk1sim2.
The -puk1 request should clearly identify the relevant sim.

 

Because in the Android source code, the SIM card PIN code distinguishes the card, PUK is indistinguishable, and the code needs to be modified. The code is modified as follows:

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>

Published 31 original articles · Likes6 · Visitors 10,000+

Guess you like

Origin blog.csdn.net/u012824529/article/details/91979962