FileReader spnReader;
final File spnFile = new File(Environment.getRootDirectory(),
PARTNER_SPN_OVERRIDE_PATH);
try {
spnReader = new FileReader(spnFile);
} catch (FileNotFoundException e) {
Log.w(LOG_TAG, "Can't open " +
Environment.getRootDirectory() + "/" + PARTNER_SPN_OVERRIDE_PATH);
return;
}
try {
XmlPullParser parser = Xml.newPullParser();
parser.setInput(spnReader);
XmlUtils.beginDocument(parser, "spnOverrides");
while (true) {
XmlUtils.nextElement(parser);
String name = parser.getName();
if (!"spnOverride".equals(name)) {
break;
}
String numeric = parser.getAttributeValue(null, "numeric");
String data = parser.getAttributeValue(null, "spn");
CarrierSpnMap.put(numeric, data);
}
} catch (XmlPullParserException e) {
Log.w(LOG_TAG, "Exception in spn-conf parser " + e);
} catch (IOException e) {
Log.w(LOG_TAG, "Exception in spn-conf parser " + e);
}