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
This commit is contained in:
Robert Greenwalt
2013-04-11 13:48:16 -07:00
parent bd286426fa
commit ca441ee2f0
3 changed files with 9 additions and 3 deletions

View File

@ -1470,8 +1470,7 @@ public class ConnectivityService extends IConnectivityManager.Stub {
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())) {