OSDN Git Service

am 9fc039e7: Merge "Add a preference panel for mouse speed." into honeycomb-mr2
authorJeff Brown <jeffbrown@android.com>
Fri, 3 Jun 2011 00:27:39 +0000 (17:27 -0700)
committerAndroid Git Automerger <android-git-automerger@android.com>
Fri, 3 Jun 2011 00:27:39 +0000 (17:27 -0700)
* commit '9fc039e7bcea7f1845a51fcb70d608663ceec227':
  Add a preference panel for mouse speed.

res/values/strings.xml
src/com/android/settings/ApnEditor.java
src/com/android/settings/RadioInfo.java
src/com/android/settings/wifi/WifiConfigController.java

index c37fba2..7808b63 100644 (file)
     <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" -->
index f738823..13b7aa5 100644 (file)
@@ -38,6 +38,7 @@ import android.view.Menu;
 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 @@ public class ApnEditor extends PreferenceActivity
 
         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);
index 4f8b374..ba07fb5 100644 (file)
@@ -755,41 +755,41 @@ public class RadioInfo extends Activity {
     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());
     }
index db1870e..a20e160 100644 (file)
@@ -26,6 +26,7 @@ import android.net.NetworkInfo.DetailedState;
 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 @@ public class WifiConfigController implements TextWatcher,
             }
 
             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 @@ public class WifiConfigController implements TextWatcher,
         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 @@ public class WifiConfigController implements TextWatcher,
         } 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 @@ public class WifiConfigController implements TextWatcher,
             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 @@ public class WifiConfigController implements TextWatcher,
                             .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 @@ public class WifiConfigController implements TextWatcher,
         if (parent == mSecuritySpinner) {
             mAccessPointSecurity = position;
             showSecurityFields();
-            enableSubmitIfAppropriate();
         } else if (parent == mNetworkSetupSpinner) {
             showNetworkSetupFields();
         } else if (parent == mProxySettingsSpinner) {
             showProxyFields();
-            enableSubmitIfAppropriate();
         } else {
             showIpConfigFields();
-            enableSubmitIfAppropriate();
         }
+        enableSubmitIfAppropriate();
     }
 
     @Override