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
This commit is contained in:
Fredrik Jagenheim
2010-02-12 15:52:39 +01:00
committed by Johan Redestig
parent ef9d148ad6
commit d26924d8d7
2 changed files with 8 additions and 1 deletions

View File

@@ -51,6 +51,8 @@ public class IccUtils {
ret.append((char)('0' + v));
v = (data[i] >> 4) & 0xf;
// Some PLMNs have 'f' as high nibble, ignore it
if (v == 0xf) continue;
if (v > 9) break;
ret.append((char)('0' + v));
}

View File

@@ -93,6 +93,7 @@ public final class SIMRecords extends IccRecords {
static final int SPN_RULE_SHOW_PLMN = 0x02;
// From TS 51.011 EF[SPDI] section
static final int TAG_SPDI = 0xA3;
static final int TAG_SPDI_PLMN_LIST = 0x80;
// Full Name IEI from TS 24.008
@@ -1426,8 +1427,12 @@ public final class SIMRecords extends IccRecords {
byte[] plmnEntries = null;
// There should only be one TAG_SPDI_PLMN_LIST
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) {
plmnEntries = tlv.getData();
break;