am 049694bf: Merge "Reset connection while data state changed." into honeycomb-LTE

* commit '049694bfa249c9238d24e0f635b763a53c179ca2':
  Reset connection while data state changed.
This commit is contained in:
Wink Saville
2011-05-19 11:28:36 -07:00
committed by Android Git Automerger
2 changed files with 29 additions and 1 deletions

View File

@@ -68,7 +68,8 @@ public class LinkProperties implements Parcelable {
mLinkAddresses = source.getLinkAddresses();
mDnses = source.getDnses();
mRoutes = source.getRoutes();
mHttpProxy = new ProxyProperties(source.getHttpProxy());
mHttpProxy = (source.getHttpProxy() == null) ?
null : new ProxyProperties(source.getHttpProxy());
}
}

View File

@@ -140,6 +140,33 @@ public class RouteInfo implements Parcelable {
}
}
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (!(obj instanceof RouteInfo)) return false;
RouteInfo target = (RouteInfo) obj;
boolean sameDestination = ( mDestination == null) ?
target.getDestination() == null
: mDestination.equals(target.getDestination());
boolean sameAddress = (mGateway == null) ?
target.getGateway() == null
: mGateway.equals(target.getGateway());
return sameDestination && sameAddress
&& mIsDefault == target.mIsDefault;
}
@Override
public int hashCode() {
return (mDestination == null ? 0 : mDestination.hashCode())
+ (mGateway == null ? 0 :mGateway.hashCode())
+ (mIsDefault ? 3 : 7);
}
public static final Creator<RouteInfo> CREATOR =
new Creator<RouteInfo>() {
public RouteInfo createFromParcel(Parcel in) {