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

Commit bfc4c06f authored by Chiachang Wang's avatar Chiachang Wang Committed by Automerger Merge Worker
Browse files

Merge "Only set excludeLocalRoutes in the bypassable VpnProfile" am: b70a0862

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

Change-Id: Ic065fe4ede606af2343bf3a87dc14982ac9b9a9b
parents 5cb92ff1 b70a0862
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line Diff line number Diff line
@@ -35,6 +35,7 @@ import android.annotation.Nullable;
import android.annotation.RequiresFeature;
import android.annotation.RequiresFeature;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager;
import android.security.Credentials;
import android.security.Credentials;
import android.util.Log;


import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.net.VpnProfile;
import com.android.internal.net.VpnProfile;
@@ -70,6 +71,7 @@ import java.util.Objects;
 *     Exchange, Version 2 (IKEv2)</a>
 *     Exchange, Version 2 (IKEv2)</a>
 */
 */
public final class Ikev2VpnProfile extends PlatformVpnProfile {
public final class Ikev2VpnProfile extends PlatformVpnProfile {
    private static final String TAG = Ikev2VpnProfile.class.getSimpleName();
    /** Prefix for when a Private Key is an alias to look for in KeyStore @hide */
    /** Prefix for when a Private Key is an alias to look for in KeyStore @hide */
    public static final String PREFIX_KEYSTORE_ALIAS = "KEYSTORE_ALIAS:";
    public static final String PREFIX_KEYSTORE_ALIAS = "KEYSTORE_ALIAS:";
    /** Prefix for when a Private Key is stored directly in the profile @hide */
    /** Prefix for when a Private Key is stored directly in the profile @hide */
@@ -524,7 +526,10 @@ public final class Ikev2VpnProfile extends PlatformVpnProfile {
                throw new IllegalArgumentException("Invalid auth method set");
                throw new IllegalArgumentException("Invalid auth method set");
        }
        }


        builder.setExcludeLocalRoutes(profile.excludeLocalRoutes);
        if (profile.excludeLocalRoutes && !profile.isBypassable) {
            Log.w(TAG, "ExcludeLocalRoutes should only be set in the bypassable VPN");
        }
        builder.setExcludeLocalRoutes(profile.excludeLocalRoutes && profile.isBypassable);


        return builder.build();
        return builder.build();
    }
    }