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

Commit c344f9b8 authored by Sreeram Ramachandran's avatar Sreeram Ramachandran Committed by Android (Google) Code Review
Browse files

Merge "Delete unused APIs in NetworkManagementService."

parents 39afc200 31ab4172
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);