Add new route.hasGateway() api
Fixes issues brought in by change to isHostRoute. isHostRoute
was technically correct, but the callers really wanted hasNextHop
behavior.
bug:8597268
Change-Id: I360761ccfa98b2ba34642f717a78fa71ec1bae4f
diff --git a/services/java/com/android/server/ConnectivityService.java b/services/java/com/android/server/ConnectivityService.java
index f320562..01625dd 100644
--- a/services/java/com/android/server/ConnectivityService.java
+++ b/services/java/com/android/server/ConnectivityService.java
@@ -1470,8 +1470,7 @@
loge("Error modifying route - no interface name");
return false;
}
-
- if (r.isHostRoute() == false) {
+ if (r.hasGateway()) {
RouteInfo bestRoute = RouteInfo.selectBestRoute(lp.getAllRoutes(), r.getGateway());
if (bestRoute != null) {
if (bestRoute.getGateway().equals(r.getGateway())) {