Remove spaces from APN types read from the file
APN types are parsed from apns-conf.xml and could contain
spaces. Remove the spaces from the types field before using it.
Bug: 33234377
Test: Add spaces between types in apns-conf.xml for verizon
"internet" APN and send MMS. Device was able to send
MMS successfully using the "internet" APN on 1X.
Change-Id: I69b597b2a2519b2ecfa4b41918fbd2d0e0bf35d5
diff --git a/src/com/android/providers/telephony/TelephonyProvider.java b/src/com/android/providers/telephony/TelephonyProvider.java
index 9c88030..4081bb7 100644
--- a/src/com/android/providers/telephony/TelephonyProvider.java
+++ b/src/com/android/providers/telephony/TelephonyProvider.java
@@ -1078,7 +1078,14 @@
addStringAttribute(parser, "mmsproxy", map, MMSPROXY);
addStringAttribute(parser, "mmsport", map, MMSPORT);
addStringAttribute(parser, "mmsc", map, MMSC);
- addStringAttribute(parser, "type", map, TYPE);
+
+ String apnType = parser.getAttributeValue(null, "type");
+ if (apnType != null) {
+ // Remove spaces before putting it in the map.
+ apnType = apnType.replaceAll("\\s+", "");
+ map.put(TYPE, apnType);
+ }
+
addStringAttribute(parser, "protocol", map, PROTOCOL);
addStringAttribute(parser, "roaming_protocol", map, ROAMING_PROTOCOL);