summaryrefslogtreecommitdiffstats
path: root/core/java/android/net/RouteInfo.java
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2014-06-09 22:58:46 +0900
committerRobert Greenwalt <rgreenwalt@google.com>2014-06-11 18:52:19 +0000
commit00a0fd650b7a31dffb88c229242bb04fa0b487a4 (patch)
treefede654ba17701546fac7417f47d173bbe76a024 /core/java/android/net/RouteInfo.java
parenteeaf164bea829325af343b9e41196bc9680ecac9 (diff)
downloadframeworks_base-00a0fd650b7a31dffb88c229242bb04fa0b487a4.zip
frameworks_base-00a0fd650b7a31dffb88c229242bb04fa0b487a4.tar.gz
frameworks_base-00a0fd650b7a31dffb88c229242bb04fa0b487a4.tar.bz2
Minor changes to the LinkAddress API docs.
1. Rename getNetworkPrefixLength to getPrefixLength. Update all callers in frameworks/base and add a shim method and a TODO for the rest. 2. @hide isSameAddressAs. It doesn't add much, and it's just one-liner that callers can implement if they want. 3. Fix the alignment of the initial paragraph (<ul> should have been </ul>). 4. Remove the documentation that talks about creating LinkAddresses, since there's no public API for creating them. With these changes I think LinkAddress is fine as a public API. Bug: 15142362 Change-Id: Iaf3b1db577745bb68a9e1dd7f96d666dd3f3ec7c (cherry picked from commit 9ab53650cfcd91a2a151b44b3fd1381841f76269)
Diffstat (limited to 'core/java/android/net/RouteInfo.java')
-rw-r--r--core/java/android/net/RouteInfo.java18
1 files changed, 9 insertions, 9 deletions
diff --git a/core/java/android/net/RouteInfo.java b/core/java/android/net/RouteInfo.java
index ad8e4f7..0f35096 100644
--- a/core/java/android/net/RouteInfo.java
+++ b/core/java/android/net/RouteInfo.java
@@ -105,7 +105,7 @@ public class RouteInfo implements Parcelable {
mHasGateway = (!gateway.isAnyLocalAddress());
mDestination = new LinkAddress(NetworkUtils.getNetworkPart(destination.getAddress(),
- destination.getNetworkPrefixLength()), destination.getNetworkPrefixLength());
+ destination.getPrefixLength()), destination.getPrefixLength());
if ((destination.getAddress() instanceof Inet4Address &&
(gateway instanceof Inet4Address == false)) ||
(destination.getAddress() instanceof Inet6Address &&
@@ -176,18 +176,18 @@ public class RouteInfo implements Parcelable {
private boolean isHost() {
return (mDestination.getAddress() instanceof Inet4Address &&
- mDestination.getNetworkPrefixLength() == 32) ||
+ mDestination.getPrefixLength() == 32) ||
(mDestination.getAddress() instanceof Inet6Address &&
- mDestination.getNetworkPrefixLength() == 128);
+ mDestination.getPrefixLength() == 128);
}
private boolean isDefault() {
boolean val = false;
if (mGateway != null) {
if (mGateway instanceof Inet4Address) {
- val = (mDestination == null || mDestination.getNetworkPrefixLength() == 0);
+ val = (mDestination == null || mDestination.getPrefixLength() == 0);
} else {
- val = (mDestination == null || mDestination.getNetworkPrefixLength() == 0);
+ val = (mDestination == null || mDestination.getPrefixLength() == 0);
}
}
return val;
@@ -263,7 +263,7 @@ public class RouteInfo implements Parcelable {
// match the route destination and destination with prefix length
InetAddress dstNet = NetworkUtils.getNetworkPart(destination,
- mDestination.getNetworkPrefixLength());
+ mDestination.getPrefixLength());
return mDestination.getAddress().equals(dstNet);
}
@@ -285,8 +285,8 @@ public class RouteInfo implements Parcelable {
for (RouteInfo route : routes) {
if (NetworkUtils.addressTypeMatches(route.mDestination.getAddress(), dest)) {
if ((bestRoute != null) &&
- (bestRoute.mDestination.getNetworkPrefixLength() >=
- route.mDestination.getNetworkPrefixLength())) {
+ (bestRoute.mDestination.getPrefixLength() >=
+ route.mDestination.getPrefixLength())) {
continue;
}
if (route.matches(dest)) bestRoute = route;
@@ -339,7 +339,7 @@ public class RouteInfo implements Parcelable {
} else {
dest.writeByte((byte) 1);
dest.writeByteArray(mDestination.getAddress().getAddress());
- dest.writeInt(mDestination.getNetworkPrefixLength());
+ dest.writeInt(mDestination.getPrefixLength());
}
if (mGateway == null) {