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:
@@ -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().
|
||||
*/
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user