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

Commit cc26b4cc authored by Sreeram Ramachandran's avatar Sreeram Ramachandran
Browse files

Allow VPN interfaces to be put into blocking mode.

New API with stub implementation to be filled out later.

Bug: 12879610
Change-Id: Iff711994dec4598c74fe11447c8c670004c1188c
parent cbaecd0f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -17517,6 +17517,7 @@ package android.net {
    method public android.net.VpnService.Builder allowBypass();
    method public android.net.VpnService.Builder allowFamily(int);
    method public android.os.ParcelFileDescriptor establish();
    method public android.net.VpnService.Builder setBlocking(boolean);
    method public android.net.VpnService.Builder setConfigureIntent(android.app.PendingIntent);
    method public android.net.VpnService.Builder setMtu(int);
    method public android.net.VpnService.Builder setSession(java.lang.String);
+14 −0
Original line number Diff line number Diff line
@@ -567,6 +567,20 @@ public class VpnService extends Service {
            return this;
        }

        /**
         * Sets the VPN interface's file descriptor to be in blocking/non-blocking mode.
         *
         * By default, the file descriptor returned by {@link #establish} is non-blocking.
         *
         * @param blocking True to put the descriptor into blocking mode; false for non-blocking.
         *
         * @return this {@link Builder} object to facilitate chaining method calls.
         */
        public Builder setBlocking(boolean blocking) {
            // TODO
            return this;
        }

        /**
         * Create a VPN interface using the parameters supplied to this
         * builder. The interface works on IP packets, and a file descriptor