Use RouteInfo API constructor in VpnService

Instead of using the RouteInfo(destination, gateway) constructor which
is private API, use the RouteInfo(destination, gateway, iface, type)
constructor which is system API.

This separates the VpnService better from internal implementations, and
is necessary to move RouteInfo to the connectivity module.

Bug: 174436414
Test: m

Change-Id: Idc98b2258f3c78bdba40b5fcb97769b5ad99d016
This commit is contained in:
Remi NGUYEN VAN
2021-02-18 03:37:49 +00:00
parent 4ea84f0b97
commit 6e9ab0553d

View File

@@ -596,7 +596,8 @@ public class VpnService extends Service {
}
}
}
mRoutes.add(new RouteInfo(new IpPrefix(address, prefixLength), null));
mRoutes.add(new RouteInfo(new IpPrefix(address, prefixLength), null, null,
RouteInfo.RTN_UNICAST));
mConfig.updateAllowedFamilies(address);
return this;
}