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

Commit dba0a348 authored by Fredrik Jagenheim's avatar Fredrik Jagenheim Committed by Steve Kondik
Browse files

Corrected SPN and PLMN name handling

SPDI-file on SIM and BCD encoded PLMN-entries wasn't parsed correctly
causing us to display wrong networknames.

Change-Id: I09d80deec45b4b3ad525a9359b4866de7549e39e
parent 361d32a2
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -51,6 +51,8 @@ public class IccUtils {
            ret.append((char)('0' + v));
            ret.append((char)('0' + v));


            v = (data[i] >> 4) & 0xf;
            v = (data[i] >> 4) & 0xf;
            // Some PLMNs have 'f' as high nibble, ignore it
            if (v == 0xf) continue;
            if (v > 9)  break;
            if (v > 9)  break;
            ret.append((char)('0' + v));
            ret.append((char)('0' + v));
        }
        }
+6 −1
Original line number Original line Diff line number Diff line
@@ -93,6 +93,7 @@ public final class SIMRecords extends IccRecords {
    static final int SPN_RULE_SHOW_PLMN = 0x02;
    static final int SPN_RULE_SHOW_PLMN = 0x02;


    // From TS 51.011 EF[SPDI] section
    // From TS 51.011 EF[SPDI] section
    static final int TAG_SPDI = 0xA3;
    static final int TAG_SPDI_PLMN_LIST = 0x80;
    static final int TAG_SPDI_PLMN_LIST = 0x80;


    // Full Name IEI from TS 24.008
    // Full Name IEI from TS 24.008
@@ -1426,8 +1427,12 @@ public final class SIMRecords extends IccRecords {


        byte[] plmnEntries = null;
        byte[] plmnEntries = null;


        // There should only be one TAG_SPDI_PLMN_LIST
        for ( ; tlv.isValidObject() ; tlv.nextObject()) {
        for ( ; tlv.isValidObject() ; tlv.nextObject()) {
            // Skip SPDI tag, if existant
            if (tlv.getTag() == TAG_SPDI) {
              tlv = new SimTlv(tlv.getData(), 0, tlv.getData().length);
            }
            // There should only be one TAG_SPDI_PLMN_LIST
            if (tlv.getTag() == TAG_SPDI_PLMN_LIST) {
            if (tlv.getTag() == TAG_SPDI_PLMN_LIST) {
                plmnEntries = tlv.getData();
                plmnEntries = tlv.getData();
                break;
                break;