diff --git a/res/values/strings.xml b/res/values/strings.xml
index 03b4a05..bd35438 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -1548,8 +1548,8 @@
     <string name="status_min_number">MIN</string>
     <!-- About phone, status item title.  The phone PRL Version of the current device.-->
     <string name="status_prl_version">PRL Version</string>
-    <!-- About phone, status item title.  The phone MEID number of the current device.-->
-    <string name="status_meid_number">MEID</string>
+    <!-- About phone, status item title.  The phone IMEI/MEID number of the current LTE/CDMA device.-->
+    <string name="status_meid_number">IMEI / MEID</string>
     <!-- About phone, status item title for the type of data phone network we're connected to, for example 3G or Edge or GPRS -->
     <string name="status_network_type">Mobile network type</string>
     <!-- About phone, status item title. The status of data access.  For example, the value may be "Connected" -->
diff --git a/src/com/android/settings/ApnEditor.java b/src/com/android/settings/ApnEditor.java
index f738823..13b7aa5 100644
--- a/src/com/android/settings/ApnEditor.java
+++ b/src/com/android/settings/ApnEditor.java
@@ -38,6 +38,7 @@
 import android.view.MenuItem;
 
 import com.android.internal.telephony.TelephonyProperties;
+import com.android.internal.telephony.RILConstants;
 
 
 public class ApnEditor extends PreferenceActivity
@@ -431,6 +432,11 @@
 
         values.put(Telephony.Carriers.PROTOCOL, checkNotSet(mProtocol.getValue()));
 
+        // Hardcode IPv4 roaming for now until the carriers sort out all the
+        // billing arrangements.
+        values.put(Telephony.Carriers.ROAMING_PROTOCOL,
+                RILConstants.SETUP_DATA_PROTOCOL_IP);
+
         values.put(Telephony.Carriers.TYPE, checkNotSet(mApnType.getText()));
 
         values.put(Telephony.Carriers.MCC, mcc);
diff --git a/src/com/android/settings/RadioInfo.java b/src/com/android/settings/RadioInfo.java
index 4f8b374..ba07fb5 100644
--- a/src/com/android/settings/RadioInfo.java
+++ b/src/com/android/settings/RadioInfo.java
@@ -755,41 +755,41 @@
     private final void updatePdpList() {
         StringBuilder sb = new StringBuilder("========DATA=======\n");
 
-        List<DataConnection> dcs = phone.getCurrentDataConnectionList();
-
-        for (DataConnection dc : dcs) {
-            sb.append("    State=").append(dc.getStateAsString()).append("\n");
-            if (dc.isActive()) {
-                long timeElapsed =
-                    (System.currentTimeMillis() - dc.getConnectionTime())/1000;
-                sb.append("    connected at ")
-                  .append(DateUtils.timeString(dc.getConnectionTime()))
-                  .append(" and elapsed ")
-                  .append(DateUtils.formatElapsedTime(timeElapsed));
-
-                if (dc instanceof GsmDataConnection) {
-                    GsmDataConnection pdp = (GsmDataConnection)dc;
-                    sb.append("\n    to ")
-                      .append(pdp.getApn().toString());
-                }
-                sb.append("\nLinkProperties: ");
-                sb.append(phone.getLinkProperties(phone.getActiveApnTypes()[0]).toString());
-            } else if (dc.isInactive()) {
-                sb.append("    disconnected with last try at ")
-                  .append(DateUtils.timeString(dc.getLastFailTime()))
-                  .append("\n    fail because ")
-                  .append(dc.getLastFailCause().toString());
-            } else {
-                if (dc instanceof GsmDataConnection) {
-                    GsmDataConnection pdp = (GsmDataConnection)dc;
-                    sb.append("    is connecting to ")
-                      .append(pdp.getApn().toString());
-                } else {
-                    sb.append("    is connecting");
-                }
-            }
-            sb.append("\n===================");
-        }
+//        List<DataConnection> dcs = phone.getCurrentDataConnectionList();
+//
+//        for (DataConnection dc : dcs) {
+//            sb.append("    State=").append(dc.getStateAsString()).append("\n");
+//            if (dc.isActive()) {
+//                long timeElapsed =
+//                    (System.currentTimeMillis() - dc.getConnectionTime())/1000;
+//                sb.append("    connected at ")
+//                  .append(DateUtils.timeString(dc.getConnectionTime()))
+//                  .append(" and elapsed ")
+//                  .append(DateUtils.formatElapsedTime(timeElapsed));
+//
+//                if (dc instanceof GsmDataConnection) {
+//                    GsmDataConnection pdp = (GsmDataConnection)dc;
+//                    sb.append("\n    to ")
+//                      .append(pdp.getApn().toString());
+//                }
+//                sb.append("\nLinkProperties: ");
+//                sb.append(phone.getLinkProperties(phone.getActiveApnTypes()[0]).toString());
+//            } else if (dc.isInactive()) {
+//                sb.append("    disconnected with last try at ")
+//                  .append(DateUtils.timeString(dc.getLastFailTime()))
+//                  .append("\n    fail because ")
+//                  .append(dc.getLastFailCause().toString());
+//            } else {
+//                if (dc instanceof GsmDataConnection) {
+//                    GsmDataConnection pdp = (GsmDataConnection)dc;
+//                    sb.append("    is connecting to ")
+//                      .append(pdp.getApn().toString());
+//                } else {
+//                    sb.append("    is connecting");
+//                }
+//            }
+//            sb.append("\n===================");
+//        }
 
         disconnects.setText(sb.toString());
     }
diff --git a/src/com/android/settings/wifi/WifiConfigController.java b/src/com/android/settings/wifi/WifiConfigController.java
index db1870e..a20e160 100644
--- a/src/com/android/settings/wifi/WifiConfigController.java
+++ b/src/com/android/settings/wifi/WifiConfigController.java
@@ -26,6 +26,7 @@
 import android.net.NetworkUtils;
 import android.net.Proxy;
 import android.net.ProxyProperties;
+import android.net.RouteInfo;
 import android.net.wifi.WifiConfiguration;
 import android.net.wifi.WifiConfiguration.IpAssignment;
 import android.net.wifi.WifiConfiguration.AuthAlgorithm;
@@ -196,7 +197,7 @@
             }
 
             WifiInfo info = mAccessPoint.getInfo();
-            if (info != null) {
+            if (info != null && info.getLinkSpeed() != -1) {
                 addRow(group, R.string.wifi_speed, info.getLinkSpeed() + WifiInfo.LINK_SPEED_UNITS);
             }
 
@@ -264,19 +265,25 @@
         if (submit == null) return;
         boolean enabled = false;
 
-        if ((mSsidView != null && mSsidView.length() == 0) ||
-            ((mAccessPoint == null || mAccessPoint.networkId == INVALID_NETWORK_ID) &&
+        boolean passwordInvalid = false;
+
+        /* Check password invalidity for manual network set up alone */
+        if (chosenNetworkSetupMethod() == MANUAL &&
             ((mAccessPointSecurity == AccessPoint.SECURITY_WEP && mPasswordView.length() == 0) ||
-            (mAccessPointSecurity == AccessPoint.SECURITY_PSK && mPasswordView.length() < 8)))) {
-            enabled = false;
-        } else {
-            enabled = true;
+            (mAccessPointSecurity == AccessPoint.SECURITY_PSK && mPasswordView.length() < 8))) {
+            passwordInvalid = true;
         }
 
-        if (ipAndProxyFieldsAreValid()) {
-            enabled = true;
-        } else {
+        if ((mSsidView != null && mSsidView.length() == 0) ||
+            ((mAccessPoint == null || mAccessPoint.networkId == INVALID_NETWORK_ID) &&
+            passwordInvalid)) {
             enabled = false;
+        } else {
+            if (ipAndProxyFieldsAreValid()) {
+                enabled = true;
+            } else {
+                enabled = false;
+            }
         }
         submit.setEnabled(enabled);
     }
@@ -434,7 +441,7 @@
         } catch (IllegalArgumentException e) {
             return R.string.wifi_ip_settings_invalid_gateway;
         }
-        linkProperties.addGateway(gatewayAddr);
+        linkProperties.addRoute(new RouteInfo(gatewayAddr));
 
         String dns = mDns1View.getText().toString();
         InetAddress dnsAddr = null;
@@ -518,7 +525,7 @@
             return;
         }
         mView.findViewById(R.id.eap).setVisibility(View.VISIBLE);
-        
+
         if (mEapMethodSpinner == null) {
             mEapMethodSpinner = (Spinner) mView.findViewById(R.id.method);
             mPhase2Spinner = (Spinner) mView.findViewById(R.id.phase2);
@@ -605,10 +612,13 @@
                             .getNetworkPrefixLength()));
                 }
 
-                Iterator<InetAddress>gateways = linkProperties.getGateways().iterator();
-                if (gateways.hasNext()) {
-                    mGatewayView.setText(gateways.next().getHostAddress());
+                for (RouteInfo route : linkProperties.getRoutes()) {
+                    if (route.isDefaultRoute()) {
+                        mGatewayView.setText(route.getGateway().getHostAddress());
+                        break;
+                    }
                 }
+
                 Iterator<InetAddress> dnsIterator = linkProperties.getDnses().iterator();
                 if (dnsIterator.hasNext()) {
                     mDns1View.setText(dnsIterator.next().getHostAddress());
@@ -727,16 +737,14 @@
         if (parent == mSecuritySpinner) {
             mAccessPointSecurity = position;
             showSecurityFields();
-            enableSubmitIfAppropriate();
         } else if (parent == mNetworkSetupSpinner) {
             showNetworkSetupFields();
         } else if (parent == mProxySettingsSpinner) {
             showProxyFields();
-            enableSubmitIfAppropriate();
         } else {
             showIpConfigFields();
-            enableSubmitIfAppropriate();
         }
+        enableSubmitIfAppropriate();
     }
 
     @Override
