Merge "Merge "The method of parseEfSpdi does not match TS24008." am: cd03d0db9d am: cfbd4a354a am: 1cdd44bd9d am: 793c4be8d4" into oc-mr1-dev-plus-aosp
This commit is contained in:
committed by
Android (Google) Code Review
commit
d6fab9dae9
@@ -64,7 +64,7 @@ public class IccUtils {
|
|||||||
/**
|
/**
|
||||||
* PLMN (MCC/MNC) is encoded as per 24.008 10.5.1.3
|
* PLMN (MCC/MNC) is encoded as per 24.008 10.5.1.3
|
||||||
* Returns a concatenated string of MCC+MNC, stripping
|
* Returns a concatenated string of MCC+MNC, stripping
|
||||||
* a trailing character for a 2-digit MNC
|
* all invalid character 'f'
|
||||||
*/
|
*/
|
||||||
public static String bcdPlmnToString(byte[] data, int offset) {
|
public static String bcdPlmnToString(byte[] data, int offset) {
|
||||||
if (offset + 3 > data.length) {
|
if (offset + 3 > data.length) {
|
||||||
@@ -76,9 +76,9 @@ public class IccUtils {
|
|||||||
trans[2] = (byte) ((data[2 + offset] & 0xF0) | ((data[1 + offset] >> 4) & 0xF));
|
trans[2] = (byte) ((data[2 + offset] & 0xF0) | ((data[1 + offset] >> 4) & 0xF));
|
||||||
String ret = bytesToHexString(trans);
|
String ret = bytesToHexString(trans);
|
||||||
|
|
||||||
// For a 2-digit MNC we trim the trailing 'f'
|
// For a valid plmn we trim all character 'f'
|
||||||
if (ret.endsWith("f")) {
|
if (ret.contains("f")) {
|
||||||
ret = ret.substring(0, ret.length() - 1);
|
ret = ret.replaceAll("f", "");
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user