diff options
author | Wink Saville <wink@google.com> | 2011-05-18 15:59:04 -0700 |
---|---|---|
committer | Wink Saville <wink@google.com> | 2011-05-18 15:59:04 -0700 |
commit | be2b058ec1e11e1d33b6d03230c21e5d2d7ac40c (patch) | |
tree | eafdffcbc1df5c5a4049617c8beb8f084127cbba /core/java/android/net | |
parent | 5a6c3d491ccac07ef3f6a624a8a3e0c36959b661 (diff) | |
download | frameworks_base-be2b058ec1e11e1d33b6d03230c21e5d2d7ac40c.zip frameworks_base-be2b058ec1e11e1d33b6d03230c21e5d2d7ac40c.tar.gz frameworks_base-be2b058ec1e11e1d33b6d03230c21e5d2d7ac40c.tar.bz2 |
Reset connection while data state changed.
Check data call states and reset connection if any link properties changed.
Change-Id: I008aea969378648192852161959fdf4aad6211a1
Diffstat (limited to 'core/java/android/net')
-rw-r--r-- | core/java/android/net/LinkProperties.java | 3 | ||||
-rw-r--r-- | core/java/android/net/RouteInfo.java | 27 |
2 files changed, 29 insertions, 1 deletions
diff --git a/core/java/android/net/LinkProperties.java b/core/java/android/net/LinkProperties.java index 61acf2b..19894a0 100644 --- a/core/java/android/net/LinkProperties.java +++ b/core/java/android/net/LinkProperties.java @@ -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()); } } diff --git a/core/java/android/net/RouteInfo.java b/core/java/android/net/RouteInfo.java index 39e708a..74ebed1 100644 --- a/core/java/android/net/RouteInfo.java +++ b/core/java/android/net/RouteInfo.java @@ -128,6 +128,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) { |