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

Commit 4ff9f0fd authored by Lorenzo Colitti's avatar Lorenzo Colitti
Browse files

Add a protectFromVpn method that takes a FileDescriptor

Bug: 19704592
Change-Id: I9aeb29c2f6cf55fa010bc606c99b21a797ac5a19
parent 04b8d3aa
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -177,6 +177,15 @@ public class NetworkUtils {
     */
     */
    public native static int bindSocketToNetwork(int socketfd, int netId);
    public native static int bindSocketToNetwork(int socketfd, int netId);


    /**
     * Protect {@code fd} from VPN connections.  After protecting, data sent through
     * this socket will go directly to the underlying network, so its traffic will not be
     * forwarded through the VPN.
     */
    public static boolean protectFromVpn(FileDescriptor fd) {
        return protectFromVpn(fd.getInt$());
    }

    /**
    /**
     * Protect {@code socketfd} from VPN connections.  After protecting, data sent through
     * Protect {@code socketfd} from VPN connections.  After protecting, data sent through
     * this socket will go directly to the underlying network, so its traffic will not be
     * this socket will go directly to the underlying network, so its traffic will not be