diff options
author | jsh <jsh@google.com> | 2009-08-19 12:17:32 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2009-08-19 12:17:32 -0700 |
commit | d6e519377f025a3ce99ce34861e7861789db2899 (patch) | |
tree | 461a2c9f865df60619b135220433a4e99e260897 | |
parent | 59fd26a145ba0940947c3252ced918e40f5f41b1 (diff) | |
parent | f78227df417eb8ec43c80923a39fba5c50bfe768 (diff) | |
download | packages_apps_Settings-d6e519377f025a3ce99ce34861e7861789db2899.zip packages_apps_Settings-d6e519377f025a3ce99ce34861e7861789db2899.tar.gz packages_apps_Settings-d6e519377f025a3ce99ce34861e7861789db2899.tar.bz2 |
am f78227df: Merge change 21838 into eclair
Merge commit 'f78227df417eb8ec43c80923a39fba5c50bfe768'
* commit 'f78227df417eb8ec43c80923a39fba5c50bfe768':
Fix RadioInfo for CDMA.
-rw-r--r-- | src/com/android/settings/RadioInfo.java | 52 |
1 files changed, 35 insertions, 17 deletions
diff --git a/src/com/android/settings/RadioInfo.java b/src/com/android/settings/RadioInfo.java index 27d8c7e..ac9600d 100644 --- a/src/com/android/settings/RadioInfo.java +++ b/src/com/android/settings/RadioInfo.java @@ -51,6 +51,7 @@ import android.widget.Spinner; import android.widget.TextView; import android.widget.EditText; +import com.android.internal.telephony.DataConnection; import com.android.internal.telephony.Phone; import com.android.internal.telephony.PhoneFactory; import com.android.internal.telephony.PhoneStateIntentReceiver; @@ -200,7 +201,7 @@ public class RadioInfo extends Activity { int type = ((int[])ar.result)[0]; preferredNetworkType.setSelection(type, true); } else { - preferredNetworkType.setSelection(3, true); + preferredNetworkType.setSelection(8, true); } break; case EVENT_SET_PREFERRED_TYPE_DONE: @@ -916,20 +917,24 @@ public class RadioInfo extends Activity { private final void updatePdpList() { StringBuilder sb = new StringBuilder("========DATA=======\n"); - List<PdpConnection> pdps = phone.getCurrentPdpList(); + List<DataConnection> dcs = phone.getCurrentDataConnectionList(); - for (PdpConnection pdp : pdps) { - sb.append(" State: ").append(pdp.getState().toString()).append("\n"); - if (pdp.getState().isActive()) { + for (DataConnection dc : dcs) { + sb.append(" State: ").append(dc.getState().toString()).append("\n"); + if (dc.getState().isActive()) { long timeElapsed = - (System.currentTimeMillis() - pdp.getConnectionTime())/1000; + (System.currentTimeMillis() - dc.getConnectionTime())/1000; sb.append(" connected at ") - .append(DateUtils.timeString(pdp.getConnectionTime())) + .append(DateUtils.timeString(dc.getConnectionTime())) .append(" and elapsed ") - .append(DateUtils.formatElapsedTime(timeElapsed)) - .append("\n to ") - .append(pdp.getApn().toString()) - .append("\ninterface: ") + .append(DateUtils.formatElapsedTime(timeElapsed)); + + if (dc instanceof PdpConnection) { + PdpConnection pdp = (PdpConnection)dc; + sb.append("\n to ") + .append(pdp.getApn().toString()); + } + sb.append("\ninterface: ") .append(phone.getInterfaceName(phone.getActiveApnTypes()[0])) .append("\naddress: ") .append(phone.getIpAddress(phone.getActiveApnTypes()[0])) @@ -939,14 +944,19 @@ public class RadioInfo extends Activity { if (dns != null) { sb.append("\ndns: ").append(dns[0]).append(", ").append(dns[1]); } - } else if (pdp.getState().isInactive()) { + } else if (dc.getState().isInactive()) { sb.append(" disconnected with last try at ") - .append(DateUtils.timeString(pdp.getLastFailTime())) + .append(DateUtils.timeString(dc.getLastFailTime())) .append("\n fail because ") - .append(pdp.getLastFailCause().toString()); + .append(dc.getLastFailCause().toString()); } else { - sb.append(" is connecting to ") - .append(pdp.getApn().toString()); + if (dc instanceof PdpConnection) { + PdpConnection pdp = (PdpConnection)dc; + sb.append(" is connecting to ") + .append(pdp.getApn().toString()); + } else { + sb.append(" is connecting"); + } } sb.append("\n==================="); } @@ -1148,5 +1158,13 @@ public class RadioInfo extends Activity { }; private String[] mPreferredNetworkLabels = { - "WCDMA preferred", "GSM only", "WCDMA only", "Unknown"}; + "WCDMA preferred", + "GSM only", + "WCDMA only", + "GSM auto (PRL)", + "CDMA auto (PRL)", + "CDMA only", + "EvDo only", + "GSM/CDMA auto (PRL)", + "Unknown"}; } |