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

Commit 97af8601 authored by Joshua Mccloskey's avatar Joshua Mccloskey Committed by Automerger Merge Worker
Browse files

Merge "Revert "Have a new method in NetworkAgentConfig.Builder to set...

Merge "Revert "Have a new method in NetworkAgentConfig.Builder to set allowBypass"" into sc-dev am: f9bb86f1

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13951498

Change-Id: Idbc2addc641fd625ca71a146b30ff3fb6edf15ec
parents ef3fbcb9 f9bb86f1
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -36,11 +36,9 @@ package android.net {

  public final class NetworkAgentConfig implements android.os.Parcelable {
    method @Nullable public String getSubscriberId();
    method public boolean isBypassableVpn();
  }

  public static final class NetworkAgentConfig.Builder {
    method @NonNull public android.net.NetworkAgentConfig.Builder setBypassableVpn(boolean);
    method @NonNull public android.net.NetworkAgentConfig.Builder setSubscriberId(@Nullable String);
  }

+0 −23
Original line number Diff line number Diff line
@@ -63,16 +63,6 @@ public final class NetworkAgentConfig implements Parcelable {
        return explicitlySelected;
    }

    /**
     * @return whether this VPN connection can be bypassed by the apps.
     *
     * @hide
     */
    @SystemApi(client = MODULE_LIBRARIES)
    public boolean isBypassableVpn() {
        return allowBypass;
    }

    /**
     * Set if the user desires to use this network even if it is unvalidated. This field has meaning
     * only if {@link explicitlySelected} is true. If it is, this field must also be set to the
@@ -356,19 +346,6 @@ public final class NetworkAgentConfig implements Parcelable {
            return this;
        }

        /**
         * Sets whether the apps can bypass the VPN connection.
         *
         * @return this builder, to facilitate chaining.
         * @hide
         */
        @NonNull
        @SystemApi(client = MODULE_LIBRARIES)
        public Builder setBypassableVpn(boolean allowBypass) {
            mConfig.allowBypass = allowBypass;
            return this;
        }

        /**
         * Returns the constructed {@link NetworkAgentConfig} object.
         */
+2 −3
Original line number Diff line number Diff line
@@ -1248,9 +1248,8 @@ public class Vpn {
        mLegacyState = LegacyVpnInfo.STATE_CONNECTING;
        updateState(DetailedState.CONNECTING, "agentConnect");

        final NetworkAgentConfig networkAgentConfig = new NetworkAgentConfig.Builder()
                .setBypassableVpn(mConfig.allowBypass && !mLockdown)
                .build();
        NetworkAgentConfig networkAgentConfig = new NetworkAgentConfig.Builder().build();
        networkAgentConfig.allowBypass = mConfig.allowBypass && !mLockdown;

        capsBuilder.setOwnerUid(mOwnerUID);
        capsBuilder.setAdministratorUids(new int[] {mOwnerUID});