Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cf1e4027 authored by Rakesh Pallerla's avatar Rakesh Pallerla Committed by Steve Kondik
Browse files

Telephony: Few PIN/PUK fixes

Following changes have been made as part of this:
-> Changes done to display retry counter on wrong entry of
   PIN1,and message to indicate Code accepted/PIN1 blocked
   during PIN1 verification as per certain carrier requirements.
->The current APIs that are used to verify the PIN and PUK only convey
  whether the operation succeeded or failed. As a result on ANY failure
  clients ask the user to re-enter the PIN.
  Add 2 new APIs that report the actual error code in case of failure.
->Display the complete text including attempts remaining to
 unlock PIN on SimUnlockScreen if user entered incorrect PIN.
 On some devices the display text is ellipsized when trying to
 display on a single line.
CRs-Fixed: 184479, 260481, 181402, 181380, 181401, 326286, 441001,
479414, 479417

Change-Id: I73718c9e6a8aa7244097e0dd4593a6226ff0ac08
parent 9a51a3de
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/toast_layout_root"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
+24 −3
Original line number Diff line number Diff line
@@ -97,6 +97,8 @@
         the SIM card. -->
    <string name="needPuk">Your SIM card is PUK-locked. Type the PUK code to unlock it.</string>
    <string name="needPuk2">Type PUK2 to unblock SIM card.</string>
    <!-- Displayed when user attempts to change SIM PIN1 without enabling PIN1. -->
    <string name="enablePin">Unsuccessful. Enable SIM/RUIM Lock.</string>
    <!-- Title for the dialog used to display the user's IMEI number [CHAR LIMIT=10] -->
    <string name="imei">IMEI</string>

@@ -2126,6 +2128,25 @@
         to unlock the keyguard.  Displayed in one line in a large font.  -->
    <string name="keyguard_password_wrong_pin_code">Incorrect PIN code.</string>

    <!-- Instructions telling the user that they entered the wrong puk while trying
         to unlock the keyguard.  Displayed in one line in a large font.  -->
    <string name="keyguard_password_wrong_puk_code">Incorrect PUK code!</string>

    <!-- Instructions telling the user that the operation to unlock the keyguard
         with PIN failed. Displayed in one line in a large font.  -->
    <string name="keyguard_password_pin_failed">PIN operation failed!</string>

    <!-- Instructions telling the user that the operation to unlock the keyguard
         with PUK failed. Displayed in one line in a large font.  -->
    <string name="keyguard_password_puk_failed">PUK operation failed!</string>


    <!-- Notification telling the user that the PIN1 they entered is valid -->
    <string name="keyguard_pin_accepted">Code Accepted!</string>

    <!-- Displayed when a SIM PIN/PUK is entered incorrectly. -->
    <string name="pinpuk_attempts">\nAttempts Remaining :</string>

    <!-- Instructions telling the user how to unlock the phone. -->
    <string name="keyguard_label_text">To unlock, press Menu then 0.</string>

@@ -2220,10 +2241,10 @@
         PUK locked (Pin Unlock Kode) -->
    <string name="lockscreen_sim_puk_locked_message">SIM card is PUK-locked.</string>
    <!-- Shown in the lock screen when the SIM has become PUK locked and the user must call customer care to unlock it. -->
    <string name="lockscreen_sim_puk_locked_instructions">See the User Guide or contact Customer Care.</string>
    <string name="lockscreen_sim_puk_locked_instructions">PIN1 Blocked. Enter PUK1.\nor\nPlease see the User Guide or contact Customer Care.</string>

    <!-- Shown in the lock screen to tell the user that their SIM is locked and they must unlock it. -->
    <string name="lockscreen_sim_locked_message">SIM card is locked.</string>
    <!-- Shown in the lock screen to tell the user that their SIM/RUIM is locked and they must unlock it. -->
    <string name="lockscreen_sim_locked_message">SIM/RUIM card is locked.</string>

    <!-- For the unlock screen, When the user enters a sim unlock code, it takes a little while to check
         whether it is valid, and to unlock the sim if it is valid.  we display a
+8 −0
Original line number Diff line number Diff line
@@ -210,6 +210,7 @@
  <java-symbol type="id" name="status_bar_latest_event_content" />
  <java-symbol type="id" name="action_divider" />
  <java-symbol type="id" name="overflow_divider" />
  <java-symbol type="id" name="toast_layout_root" />
  <java-symbol type="id" name="sms_short_code_confirm_message" />
  <java-symbol type="id" name="sms_short_code_detail_layout" />
  <java-symbol type="id" name="sms_short_code_detail_message" />
@@ -438,6 +439,12 @@
  <java-symbol type="string" name="autofill_zip_code_re" />
  <java-symbol type="string" name="badPin" />
  <java-symbol type="string" name="badPuk" />
  <java-symbol type="string" name="pinpuk_attempts" />
  <java-symbol type="string" name="lockscreen_sim_error_message_short" />
  <java-symbol type="string" name="keyguard_pin_accepted" />
  <java-symbol type="string" name="keyguard_password_pin_failed" />
  <java-symbol type="string" name="keyguard_password_puk_failed" />
  <java-symbol type="string" name="keyguard_password_wrong_puk_code" />
  <java-symbol type="string" name="byteShort" />
  <java-symbol type="string" name="capability_desc_canRequestEnhancedWebAccessibility" />
  <java-symbol type="string" name="capability_title_canRequestFilterKeyEvents" />
@@ -652,6 +659,7 @@
  <java-symbol type="string" name="orgTypeOther" />
  <java-symbol type="string" name="orgTypeWork" />
  <java-symbol type="string" name="passwordIncorrect" />
  <java-symbol type="string" name="enablePin" />
  <java-symbol type="string" name="perms_description_app" />
  <java-symbol type="string" name="perms_new_perm_prefix" />
  <java-symbol type="string" name="petabyteShort" />
+3 −0
Original line number Diff line number Diff line
@@ -507,6 +507,9 @@ public class NetworkController extends BroadcastReceiver {
        if (IccCardConstants.INTENT_VALUE_ICC_ABSENT.equals(stateExtra)) {
            mSimState = IccCardConstants.State.ABSENT;
        }
        else if (IccCardConstants.INTENT_VALUE_ICC_CARD_IO_ERROR.equals(stateExtra)) {
            mSimState = IccCardConstants.State.CARD_IO_ERROR;
        }
        else if (IccCardConstants.INTENT_VALUE_ICC_READY.equals(stateExtra)) {
            mSimState = IccCardConstants.State.READY;
        }
+10 −1
Original line number Diff line number Diff line
@@ -60,7 +60,8 @@ public class CarrierText extends TextView {
        SimPukLocked, // SIM card is PUK locked because SIM entered wrong too many times
        SimLocked, // SIM card is currently locked
        SimPermDisabled, // SIM card is permanently disabled due to PUK unlock failure
        SimNotReady; // SIM is not ready yet. May never be on devices w/o a SIM.
        SimNotReady, // SIM is not ready yet. May never be on devices w/o a SIM.
        SimIOError; //The sim card is faulty
    }

    public CarrierText(Context context) {
@@ -159,6 +160,12 @@ public class CarrierText extends TextView {
                        getContext().getText(R.string.lockscreen_sim_puk_locked_message),
                        plmn);
                break;

            case SimIOError:
                carrierText = makeCarrierStringOnEmergencyCapable(
                        getContext().getText(R.string.lockscreen_sim_error_message_short),
                        plmn);
                break;
        }

        return carrierText;
@@ -208,6 +215,8 @@ public class CarrierText extends TextView {
                return StatusMode.SimPermDisabled;
            case UNKNOWN:
                return StatusMode.SimMissing;
            case CARD_IO_ERROR:
                return StatusMode.SimIOError;
        }
        return StatusMode.SimMissing;
    }
Loading