Skip to content

Commit 58424b5

Browse files
Jean-Baptiste QueruAndroid Code Review
authored andcommitted
Merge "Corrected SPN and PLMN name handling"
2 parents 4bd0073 + d26924d commit 58424b5

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

telephony/java/com/android/internal/telephony/IccUtils.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ public class IccUtils {
5151
ret.append((char)('0' + v));
5252

5353
v = (data[i] >> 4) & 0xf;
54+
// Some PLMNs have 'f' as high nibble, ignore it
55+
if (v == 0xf) continue;
5456
if (v > 9) break;
5557
ret.append((char)('0' + v));
5658
}

telephony/java/com/android/internal/telephony/gsm/SIMRecords.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ public final class SIMRecords extends IccRecords {
9393
static final int SPN_RULE_SHOW_PLMN = 0x02;
9494

9595
// From TS 51.011 EF[SPDI] section
96+
static final int TAG_SPDI = 0xA3;
9697
static final int TAG_SPDI_PLMN_LIST = 0x80;
9798

9899
// Full Name IEI from TS 24.008
@@ -1426,8 +1427,12 @@ private void getSpnFsm(boolean start, AsyncResult ar) {
14261427

14271428
byte[] plmnEntries = null;
14281429

1429-
// There should only be one TAG_SPDI_PLMN_LIST
14301430
for ( ; tlv.isValidObject() ; tlv.nextObject()) {
1431+
// Skip SPDI tag, if existant
1432+
if (tlv.getTag() == TAG_SPDI) {
1433+
tlv = new SimTlv(tlv.getData(), 0, tlv.getData().length);
1434+
}
1435+
// There should only be one TAG_SPDI_PLMN_LIST
14311436
if (tlv.getTag() == TAG_SPDI_PLMN_LIST) {
14321437
plmnEntries = tlv.getData();
14331438
break;

0 commit comments

Comments
 (0)