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

Commit e102df0b authored by Rakesh Pallerla's avatar Rakesh Pallerla Committed by Ricardo Cerqueira
Browse files

Telephony: Add ME Depersonalization support

Add support for all ME De-Personalizations as per specs
3GPP2 C.S0068-0 and 3GPP TS 22.022.

CRs-fixed: 467276
Change-Id: Iba74e3e5eb4fe96361585f4933897c5c8f17db97
parent 5f7cdd35
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -72,6 +72,8 @@
    <!-- SIM messages --><skip />
    <!-- SIM messages --><skip />
    <!-- When the user inserts a sim card from an unsupported network, it becomes network locked -->
    <!-- When the user inserts a sim card from an unsupported network, it becomes network locked -->
    <string name="keyguard_network_locked_message">Network locked</string>
    <string name="keyguard_network_locked_message">Network locked</string>
    <!-- When the user inserts a sim card with some personalization enabled -->
    <string name="keyguard_perso_locked_message">SIM/RUIM is Perso locked</string>
    <!-- Shown when there is no SIM card. -->
    <!-- Shown when there is no SIM card. -->
    <string name="keyguard_missing_sim_message_short">No SIM card</string>
    <string name="keyguard_missing_sim_message_short">No SIM card</string>
    <!-- Shown when there is no SIM card. -->
    <!-- Shown when there is no SIM card. -->
+8 −8
Original line number Original line Diff line number Diff line
@@ -77,7 +77,7 @@ public class CarrierText extends LinearLayout {
     */
     */
    private static enum StatusMode {
    private static enum StatusMode {
        Normal, // Normal case (sim card present, it's not locked)
        Normal, // Normal case (sim card present, it's not locked)
        NetworkLocked, // SIM card is 'network locked'.
        PersoLocked, // SIM card is 'perso locked'.
        SimMissing, // SIM card is missing.
        SimMissing, // SIM card is missing.
        SimMissingLocked, // SIM card is missing, and device isn't provisioned; don't allow access
        SimMissingLocked, // SIM card is missing, and device isn't provisioned; don't allow access
        SimPukLocked, // SIM card is PUK locked because SIM entered wrong too many times
        SimPukLocked, // SIM card is PUK locked because SIM entered wrong too many times
@@ -179,9 +179,9 @@ public class CarrierText extends LinearLayout {
                carrierText = null; // nothing to display yet.
                carrierText = null; // nothing to display yet.
                break;
                break;


            case NetworkLocked:
            case PersoLocked:
                carrierText = makeCarrierStringOnEmergencyCapable(
                carrierText = makeCarrierStringOnEmergencyCapable(
                        mContext.getText(R.string.keyguard_network_locked_message), plmn);
                        getContext().getText(R.string.keyguard_perso_locked_message), plmn);
                break;
                break;


            case SimMissing:
            case SimMissing:
@@ -247,13 +247,13 @@ public class CarrierText extends LinearLayout {
                && (simState == IccCardConstants.State.ABSENT ||
                && (simState == IccCardConstants.State.ABSENT ||
                        simState == IccCardConstants.State.PERM_DISABLED);
                        simState == IccCardConstants.State.PERM_DISABLED);


        // Assume we're NETWORK_LOCKED if not provisioned
        // Assume we're PERSO_LOCKED if not provisioned
        simState = missingAndNotProvisioned ? IccCardConstants.State.NETWORK_LOCKED : simState;
        simState = missingAndNotProvisioned ? IccCardConstants.State.PERSO_LOCKED : simState;
        switch (simState) {
        switch (simState) {
            case ABSENT:
            case ABSENT:
                return StatusMode.SimMissing;
                return StatusMode.SimMissing;
            case NETWORK_LOCKED:
            case PERSO_LOCKED:
                return StatusMode.SimMissingLocked;
                return StatusMode.PersoLocked;
            case NOT_READY:
            case NOT_READY:
                return StatusMode.SimNotReady;
                return StatusMode.SimNotReady;
            case PIN_REQUIRED:
            case PIN_REQUIRED:
@@ -293,7 +293,7 @@ public class CarrierText extends LinearLayout {
        int carrierHelpTextId = 0;
        int carrierHelpTextId = 0;
        StatusMode status = getStatusForIccState(simState);
        StatusMode status = getStatusForIccState(simState);
        switch (status) {
        switch (status) {
            case NetworkLocked:
            case PersoLocked:
                carrierHelpTextId = R.string.keyguard_instructions_when_pattern_disabled;
                carrierHelpTextId = R.string.keyguard_instructions_when_pattern_disabled;
                break;
                break;


+2 −2
Original line number Original line Diff line number Diff line
@@ -523,11 +523,11 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
                    state = IccCardConstants.State.PIN_REQUIRED;
                    state = IccCardConstants.State.PIN_REQUIRED;
                } else if (IccCardConstants.INTENT_VALUE_LOCKED_ON_PUK.equals(lockedReason)) {
                } else if (IccCardConstants.INTENT_VALUE_LOCKED_ON_PUK.equals(lockedReason)) {
                    state = IccCardConstants.State.PUK_REQUIRED;
                    state = IccCardConstants.State.PUK_REQUIRED;
                } else if (IccCardConstants.INTENT_VALUE_LOCKED_PERSO.equals(lockedReason)) {
                    state = IccCardConstants.State.PERSO_LOCKED;
                } else {
                } else {
                    state = IccCardConstants.State.UNKNOWN;
                    state = IccCardConstants.State.UNKNOWN;
                }
                }
            } else if (IccCardConstants.INTENT_VALUE_LOCKED_NETWORK.equals(stateExtra)) {
                state = IccCardConstants.State.NETWORK_LOCKED;
            } else if (IccCardConstants.INTENT_VALUE_ICC_LOADED.equals(stateExtra)
            } else if (IccCardConstants.INTENT_VALUE_ICC_LOADED.equals(stateExtra)
                        || IccCardConstants.INTENT_VALUE_ICC_IMSI.equals(stateExtra)) {
                        || IccCardConstants.INTENT_VALUE_ICC_IMSI.equals(stateExtra)) {
                // This is required because telephony doesn't return to "READY" after
                // This is required because telephony doesn't return to "READY" after
+1 −1
Original line number Original line Diff line number Diff line
@@ -210,7 +210,7 @@ public class PhoneStatusBarPolicy {
                    simState = IccCardConstants.State.PUK_REQUIRED;
                    simState = IccCardConstants.State.PUK_REQUIRED;
                }
                }
                else {
                else {
                    simState = IccCardConstants.State.NETWORK_LOCKED;
                    simState = IccCardConstants.State.PERSO_LOCKED;
                }
                }
            } else {
            } else {
                simState = IccCardConstants.State.UNKNOWN;
                simState = IccCardConstants.State.UNKNOWN;
+1 −1
Original line number Original line Diff line number Diff line
@@ -565,7 +565,7 @@ public class MSimNetworkControllerImpl extends NetworkControllerImpl {
                    simState = IccCardConstants.State.PUK_REQUIRED;
                    simState = IccCardConstants.State.PUK_REQUIRED;
                }
                }
                else {
                else {
                    simState = IccCardConstants.State.NETWORK_LOCKED;
                    simState = IccCardConstants.State.PERSO_LOCKED;
                }
                }
            } else {
            } else {
                simState = IccCardConstants.State.UNKNOWN;
                simState = IccCardConstants.State.UNKNOWN;
Loading