diff options
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/net/RouteInfo.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/java/android/net/RouteInfo.java b/core/java/android/net/RouteInfo.java index cc3c5f7cffaf..1d051dde497d 100644 --- a/core/java/android/net/RouteInfo.java +++ b/core/java/android/net/RouteInfo.java @@ -60,6 +60,7 @@ public class RouteInfo implements Parcelable { private final boolean mIsDefault; private final boolean mIsHost; + private final boolean mHasGateway; /** * Constructs a RouteInfo object. @@ -97,6 +98,8 @@ public class RouteInfo implements Parcelable { gateway = Inet6Address.ANY; } } + mHasGateway = (!gateway.isAnyLocalAddress()); + mDestination = new LinkAddress(NetworkUtils.getNetworkPart(destination.getAddress(), destination.getNetworkPrefixLength()), destination.getNetworkPrefixLength()); mGateway = gateway; @@ -171,6 +174,10 @@ public class RouteInfo implements Parcelable { return mIsHost; } + public boolean hasGateway() { + return mHasGateway; + } + public String toString() { String val = ""; if (mDestination != null) val = mDestination.toString(); |
