<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" -->
import android.view.MenuItem;
import com.android.internal.telephony.TelephonyProperties;
+import com.android.internal.telephony.RILConstants;
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);
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());
}
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;
}
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);
}
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);
}
} 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;
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);
.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());
if (parent == mSecuritySpinner) {
mAccessPointSecurity = position;
showSecurityFields();
- enableSubmitIfAppropriate();
} else if (parent == mNetworkSetupSpinner) {
showNetworkSetupFields();
} else if (parent == mProxySettingsSpinner) {
showProxyFields();
- enableSubmitIfAppropriate();
} else {
showIpConfigFields();
- enableSubmitIfAppropriate();
}
+ enableSubmitIfAppropriate();
}
@Override