Merge "Add NetworkProperties to DataConnection."

This commit is contained in:
Wink Saville
2010-08-27 11:38:48 -07:00
committed by Android (Google) Code Review
2 changed files with 12 additions and 3 deletions

View File

@@ -99,19 +99,20 @@ public class NetworkProperties implements Parcelable {
return 0; return 0;
} }
@Override
public synchronized String toString() { public synchronized String toString() {
String ifaceName = (mIface == null ? "" : "InterfaceName: " + mIface.getName() + " "); String ifaceName = (mIface == null ? "" : "InterfaceName: " + mIface.getName() + " ");
String ip = "IpAddresses: ["; String ip = "IpAddresses: [";
for (InetAddress addr : mAddresses) ip += addr.toString() + ","; for (InetAddress addr : mAddresses) ip += addr.getHostAddress() + ",";
ip += "] "; ip += "] ";
String dns = "DnsAddresses: ["; String dns = "DnsAddresses: [";
for (InetAddress addr : mDnses) dns += addr.toString() + ","; for (InetAddress addr : mDnses) dns += addr.getHostAddress() + ",";
dns += "] "; dns += "] ";
String proxy = (mHttpProxy == null ? "" : "HttpProxy: " + mHttpProxy.toString() + " "); String proxy = (mHttpProxy == null ? "" : "HttpProxy: " + mHttpProxy.toString() + " ");
String gateway = (mGateway == null ? "" : "Gateway: " + mGateway.toString() + " "); String gateway = (mGateway == null ? "" : "Gateway: " + mGateway.getHostAddress() + " ");
return ifaceName + ip + gateway + dns + proxy; return ifaceName + ip + gateway + dns + proxy;
} }

View File

@@ -57,6 +57,14 @@ public class ProxyProperties implements Parcelable {
mExclusionList = exclusionList; mExclusionList = exclusionList;
} }
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(mProxy.getHostAddress()).append(":").append(mPort)
.append(" xl=").append(mExclusionList);
return sb.toString();
}
/** /**
* Implement the Parcelable interface * Implement the Parcelable interface
* @hide * @hide