Apply the dns and route diff which we get a change
bug:5008973 Change-Id: Ib99e43d9d852452cc1f2aea6bef07bbd194f28cc
This commit is contained in:
parent
051a664b14
commit
e8d2a4a8a0
1 changed files with 221 additions and 177 deletions
|
|
@ -43,6 +43,7 @@ public class RouteInfo implements Parcelable {
|
|||
private final InetAddress mGateway;
|
||||
|
||||
private final boolean mIsDefault;
|
||||
private final boolean mIsHost;
|
||||
|
||||
public RouteInfo(LinkAddress destination, InetAddress gateway) {
|
||||
if (destination == null) {
|
||||
|
|
@ -68,6 +69,7 @@ public class RouteInfo implements Parcelable {
|
|||
destination.getNetworkPrefixLength()), destination.getNetworkPrefixLength());
|
||||
mGateway = gateway;
|
||||
mIsDefault = isDefault();
|
||||
mIsHost = isHost();
|
||||
}
|
||||
|
||||
public RouteInfo(InetAddress gateway) {
|
||||
|
|
@ -88,6 +90,10 @@ public class RouteInfo implements Parcelable {
|
|||
}
|
||||
}
|
||||
|
||||
private boolean isHost() {
|
||||
return (mGateway.equals(Inet4Address.ANY) || mGateway.equals(Inet6Address.ANY));
|
||||
}
|
||||
|
||||
private boolean isDefault() {
|
||||
boolean val = false;
|
||||
if (mGateway != null) {
|
||||
|
|
@ -100,6 +106,7 @@ public class RouteInfo implements Parcelable {
|
|||
return val;
|
||||
}
|
||||
|
||||
|
||||
public LinkAddress getDestination() {
|
||||
return mDestination;
|
||||
}
|
||||
|
|
@ -112,6 +119,10 @@ public class RouteInfo implements Parcelable {
|
|||
return mIsDefault;
|
||||
}
|
||||
|
||||
public boolean isHostRoute() {
|
||||
return mIsHost;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
String val = "";
|
||||
if (mDestination != null) val = mDestination.toString();
|
||||
|
|
|
|||
Loading…
Reference in a new issue