Remove RouteInfo hidden depdendency in NMS

Update legecy route is replaced by calling INetd directly.
addLegacyRouteForNetId() is no longer needed. This method also
have dependency with the hidden method in RouteInfo which will
be a part of incoming connectivity module. Thus, remove the
addLegacyRouteForNetId() to resolve the dependency.

Bug: 172183305
Test: m ; atest FrameworksNetTests
Change-Id: Ifc561b6dfb45bc51dee244ae114029ae520d8556
This commit is contained in:
Chiachang Wang
2021-02-24 20:02:28 +08:00
parent 7c7ca85882
commit ce554e8152
2 changed files with 0 additions and 23 deletions

View File

@@ -295,8 +295,6 @@ interface INetworkManagementService
void setFirewallUidRules(int chain, in int[] uids, in int[] rules);
void setFirewallChainEnabled(int chain, boolean enable);
void addLegacyRouteForNetId(int netId, in RouteInfo routeInfo, int uid);
/**
* Allow UID to call protect().
*/

View File

@@ -1759,27 +1759,6 @@ public class NetworkManagementService extends INetworkManagementService.Stub {
}
}
@Override
public void addLegacyRouteForNetId(int netId, RouteInfo routeInfo, int uid) {
NetworkStack.checkNetworkStackPermission(mContext);
final LinkAddress la = routeInfo.getDestinationLinkAddress();
final String ifName = routeInfo.getInterface();
final String dst = la.toString();
final String nextHop;
if (routeInfo.hasGateway()) {
nextHop = routeInfo.getGateway().getHostAddress();
} else {
nextHop = "";
}
try {
mNetdService.networkAddLegacyRoute(netId, ifName, dst, nextHop, uid);
} catch (RemoteException | ServiceSpecificException e) {
throw new IllegalStateException(e);
}
}
@Override
public void allowProtect(int uid) {
NetworkStack.checkNetworkStackPermission(mContext);