Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3c78330e authored by Luke Huang's avatar Luke Huang Committed by android-build-merger
Browse files

Merge "Refine network-related commands porting"

am: 82696f8e

Change-Id: I1829678dd0071d4d9c51ec69d15b4975530000a8
parents bed02718 82696f8e
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -2548,18 +2548,18 @@ public class NetworkManagementService extends INetworkManagementService.Stub


    @Override
    @Override
    public void addInterfaceToLocalNetwork(String iface, List<RouteInfo> routes) {
    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) {
        for (RouteInfo route : routes) {
            if (!route.isDefaultRoute()) {
            if (!route.isDefaultRoute()) {
                modifyRoute(MODIFY_OPERATION_ADD, INetd.NETID_LOCAL, route);
                modifyRoute(MODIFY_OPERATION_ADD, INetd.LOCAL_NET_ID, route);
            }
            }
        }
        }
    }
    }


    @Override
    @Override
    public void removeInterfaceFromLocalNetwork(String iface) {
    public void removeInterfaceFromLocalNetwork(String iface) {
        modifyInterfaceInNetwork(MODIFY_OPERATION_REMOVE, INetd.NETID_LOCAL, iface);
        modifyInterfaceInNetwork(MODIFY_OPERATION_REMOVE, INetd.LOCAL_NET_ID, iface);
    }
    }


    @Override
    @Override
@@ -2568,7 +2568,7 @@ public class NetworkManagementService extends INetworkManagementService.Stub


        for (RouteInfo route : routes) {
        for (RouteInfo route : routes) {
            try {
            try {
                modifyRoute(MODIFY_OPERATION_REMOVE, INetd.NETID_LOCAL, route);
                modifyRoute(MODIFY_OPERATION_REMOVE, INetd.LOCAL_NET_ID, route);
            } catch (IllegalStateException e) {
            } catch (IllegalStateException e) {
                failures++;
                failures++;
            }
            }