Need to trim mmsc and apn url

Tested by duplicating the Italian situation by adding a leading
space to the APN used on my phone. Bug 3261633

Change-Id: Ia5a546a330bd055464b9100d04755d2729d9d3d5
diff --git a/src/com/android/mms/transaction/TransactionSettings.java b/src/com/android/mms/transaction/TransactionSettings.java
index 11f2cc6..f65fd33 100644
--- a/src/com/android/mms/transaction/TransactionSettings.java
+++ b/src/com/android/mms/transaction/TransactionSettings.java
@@ -61,7 +61,7 @@
      */
     public TransactionSettings(Context context, String apnName) {
         String selection = (apnName != null)?
-                Telephony.Carriers.APN + "='"+apnName+"'": null;
+                Telephony.Carriers.APN + "='" + apnName.trim() + "'": null;
 
         Cursor cursor = SqliteWrapper.query(context, context.getContentResolver(),
                             Uri.withAppendedPath(Telephony.Carriers.CONTENT_URI, "current"),
@@ -78,7 +78,7 @@
                 // Read values from APN settings
                 if (isValidApnType(cursor.getString(COLUMN_TYPE), Phone.APN_TYPE_MMS)) {
                     sawValidApn = true;
-                    mServiceCenter = cursor.getString(COLUMN_MMSC);
+                    mServiceCenter = cursor.getString(COLUMN_MMSC).trim();
                     mProxyAddress = cursor.getString(COLUMN_MMSPROXY);
                     if (isProxySet()) {
                         String portString = cursor.getString(COLUMN_MMSPORT);
@@ -113,7 +113,7 @@
      * false otherwise.
      */
     public TransactionSettings(String mmscUrl, String proxyAddr, int proxyPort) {
-        mServiceCenter = mmscUrl;
+        mServiceCenter = mmscUrl != null ? mmscUrl.trim() : null;
         mProxyAddress = proxyAddr;
         mProxyPort = proxyPort;
     }