Refine network-related commands porting
Test: runtest frameworks-net passes
Test: manual testing of network related function works
Change-Id: Ica4685fee30308f3494d4afa02b673ba29876be0
diff --git a/services/core/java/com/android/server/NetworkManagementService.java b/services/core/java/com/android/server/NetworkManagementService.java
index ab50059..26f2427 100644
--- a/services/core/java/com/android/server/NetworkManagementService.java
+++ b/services/core/java/com/android/server/NetworkManagementService.java
@@ -2548,18 +2548,18 @@
@Override
public void addInterfaceToLocalNetwork(String iface, List<RouteInfo> routes) {
- modifyInterfaceInNetwork(MODIFY_OPERATION_ADD, INetd.NETID_LOCAL, iface);
+ modifyInterfaceInNetwork(MODIFY_OPERATION_ADD, INetd.LOCAL_NET_ID, iface);
for (RouteInfo route : routes) {
if (!route.isDefaultRoute()) {
- modifyRoute(MODIFY_OPERATION_ADD, INetd.NETID_LOCAL, route);
+ modifyRoute(MODIFY_OPERATION_ADD, INetd.LOCAL_NET_ID, route);
}
}
}
@Override
public void removeInterfaceFromLocalNetwork(String iface) {
- modifyInterfaceInNetwork(MODIFY_OPERATION_REMOVE, INetd.NETID_LOCAL, iface);
+ modifyInterfaceInNetwork(MODIFY_OPERATION_REMOVE, INetd.LOCAL_NET_ID, iface);
}
@Override
@@ -2568,7 +2568,7 @@
for (RouteInfo route : routes) {
try {
- modifyRoute(MODIFY_OPERATION_REMOVE, INetd.NETID_LOCAL, route);
+ modifyRoute(MODIFY_OPERATION_REMOVE, INetd.LOCAL_NET_ID, route);
} catch (IllegalStateException e) {
failures++;
}