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

Commit c13624a4 authored by Robert Greenwalt's avatar Robert Greenwalt Committed by Gerrit Code Review
Browse files

Merge "get group identifier level1 (Gid1)"

parents 958e7316 2f837b80
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ public interface IccConstants {
    // GSM SIM file ids from TS 51.011
    static final int EF_ADN = 0x6F3A;
    static final int EF_FDN = 0x6F3B;
    static final int EF_GID1 = 0x6F3E;
    static final int EF_SDN = 0x6F49;
    static final int EF_EXT1 = 0x6F4A;
    static final int EF_EXT2 = 0x6F4B;
+10 −0
Original line number Diff line number Diff line
@@ -72,6 +72,8 @@ public abstract class IccRecords extends Handler implements IccConstants {

    protected String spn;

    protected String gid1;

    // ***** Constants

    // Markers for mncLength
@@ -213,6 +215,14 @@ public abstract class IccRecords extends Handler implements IccConstants {
        return msisdn;
    }

    /**
     * Get the Group Identifier Level 1 (GID1) on a SIM for GSM.
     * @return null if SIM is not yet ready
     */
    public String getGid1() {
        return null;
    }

    /**
     * Set subscriber number to SIM record
     *
+1 −0
Original line number Diff line number Diff line
@@ -55,6 +55,7 @@ public final class SIMFileHandler extends IccFileHandler implements IccConstants
        case EF_SPDI:
        case EF_SST:
        case EF_CFIS:
        case EF_GID1:
            return MF_SIM + DF_GSM;

        case EF_MAILBOX_CPHS:
+29 −2
Original line number Diff line number Diff line
@@ -147,6 +147,7 @@ public class SIMRecords extends IccRecords {
    private static final int EVENT_SIM_REFRESH = 31;
    private static final int EVENT_GET_CFIS_DONE = 32;
    private static final int EVENT_GET_CSP_CPHS_DONE = 33;
    private static final int EVENT_GET_GID1_DONE = 34;

    // Lookup table for carriers known to produce SIMs which incorrectly indicate MNC length.

@@ -220,6 +221,7 @@ public class SIMRecords extends IccRecords {
        efCPHS_MWI = null;
        spdiNetworks = null;
        pnnHomeName = null;
        gid1 = null;

        adnCache.reset();

@@ -249,6 +251,11 @@ public class SIMRecords extends IccRecords {
        return msisdn;
    }

    @Override
    public String getGid1() {
        return gid1;
    }

    @Override
    public UsimServiceTable getUsimServiceTable() {
        return mUsimServiceTable;
@@ -1105,6 +1112,22 @@ public class SIMRecords extends IccRecords {
                handleEfCspData(data);
                break;

            case EVENT_GET_GID1_DONE:
                isRecordLoadResponse = true;

                ar = (AsyncResult)msg.obj;
                data =(byte[])ar.result;

                if (ar.exception != null) {
                    loge("Exception in get GID1 " + ar.exception);
                    gid1 = null;
                    break;
                }
                gid1 = IccUtils.bytesToHexString(data);
                log("GID1: " + gid1);

                break;

            default:
                super.handleMessage(msg);   // IccRecords handles generic record load responses

@@ -1377,6 +1400,9 @@ public class SIMRecords extends IccRecords {
        mFh.loadEFTransparent(EF_CSP_CPHS, obtainMessage(EVENT_GET_CSP_CPHS_DONE));
        recordsToLoad++;

        mFh.loadEFTransparent(EF_GID1, obtainMessage(EVENT_GET_GID1_DONE));
        recordsToLoad++;

        // XXX should seek instead of examining them all
        if (false) { // XXX
            mFh.loadEFLinearFixedAll(EF_SMS, obtainMessage(EVENT_GET_ALL_SMS_DONE));
@@ -1696,6 +1722,7 @@ public class SIMRecords extends IccRecords {
        pw.println(" spdiNetworks[]=" + spdiNetworks);
        pw.println(" pnnHomeName=" + pnnHomeName);
        pw.println(" mUsimServiceTable=" + mUsimServiceTable);
        pw.println(" gid1=" + gid1);
        pw.flush();
    }
}
+1 −0
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ public final class UsimFileHandler extends IccFileHandler implements IccConstant
        case EF_EXT2:
        case EF_INFO_CPHS:
        case EF_CSP_CPHS:
        case EF_GID1:
            return MF_SIM + DF_ADF;

        case EF_PBR: