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

Commit 31ab4172 authored by Sreeram Ramachandran's avatar Sreeram Ramachandran
Browse files

Delete unused APIs in NetworkManagementService.

Change-Id: Idc6c0ac0d3a4149821fc7820b7f37d4209fc55d3
parent 1710e031
Loading
Loading
Loading
Loading
+0 −15
Original line number Diff line number Diff line
@@ -340,21 +340,6 @@ interface INetworkManagementService
     */
    int getMarkForUid(int uid);

    /**
     * Get the SO_MARK associated with protecting packets from VPN routing rules
     */
    int getMarkForProtect();

    /**
     * Route all traffic in {@code route} to {@code iface} setup for marked forwarding
     */
    void setMarkedForwardingRoute(String iface, in RouteInfo route);

    /**
     * Clear routes set by {@link setMarkedForwardingRoute}
     */
    void clearMarkedForwardingRoute(String iface, in RouteInfo route);

    /**
     * Exempts {@code host} from the routing set up by {@link setMarkedForwardingRoute}
     * All connects to {@code host} will use the global routing table
+0 −37
Original line number Diff line number Diff line
@@ -1762,43 +1762,6 @@ public class NetworkManagementService extends INetworkManagementService.Stub
        return Integer.parseInt(event.getMessage());
    }

    @Override
    public int getMarkForProtect() {
        mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG);
        final NativeDaemonEvent event;
        try {
            event = mConnector.execute("interface", "fwmark", "get", "protect");
        } catch (NativeDaemonConnectorException e) {
            throw e.rethrowAsParcelableException();
        }
        event.checkCode(GetMarkResult);
        return Integer.parseInt(event.getMessage());
    }

    @Override
    public void setMarkedForwardingRoute(String iface, RouteInfo route) {
        mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG);
        try {
            LinkAddress dest = route.getDestinationLinkAddress();
            mConnector.execute("interface", "fwmark", "route", "add", iface,
                    dest.getAddress().getHostAddress(), dest.getPrefixLength());
        } catch (NativeDaemonConnectorException e) {
            throw e.rethrowAsParcelableException();
        }
    }

    @Override
    public void clearMarkedForwardingRoute(String iface, RouteInfo route) {
        mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG);
        try {
            LinkAddress dest = route.getDestinationLinkAddress();
            mConnector.execute("interface", "fwmark", "route", "remove", iface,
                    dest.getAddress().getHostAddress(), dest.getPrefixLength());
        } catch (NativeDaemonConnectorException e) {
            throw e.rethrowAsParcelableException();
        }
    }

    @Override
    public void setHostExemption(LinkAddress host) {
        mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG);