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

Commit 399c1365 authored by Benedict Wong's avatar Benedict Wong
Browse files

Make VpnProfile.maxMtu default value match Ikev2VpnProfile

This change corrects the VpnProfile's maxMtu defaults to match that of
the Ikev2VpnProfile. 1400 is too high as a default, and Settings will
run into an issue here quite often.

Bug: 152573931
Test: FrameworksNetTests passing
Change-Id: I97ba5903b3cc1ed6a21c706ed3d78bd8ecbeee0c
Merged-In: I97ba5903b3cc1ed6a21c706ed3d78bd8ecbeee0c
(cherry picked from commit d0a44f49)
parent 8b9538df
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -562,7 +562,7 @@ public final class Ikev2VpnProfile extends PlatformVpnProfile {
        @NonNull private List<String> mAllowedAlgorithms = new ArrayList<>();
        private boolean mIsBypassable = false;
        private boolean mIsMetered = true;
        private int mMaxMtu = 1360;
        private int mMaxMtu = PlatformVpnProfile.MAX_MTU_DEFAULT;

        /**
         * Creates a new builder with the basic parameters of an IKEv2/IPsec VPN.
+3 −0
Original line number Diff line number Diff line
@@ -59,6 +59,9 @@ public abstract class PlatformVpnProfile {
    public static final int TYPE_IKEV2_IPSEC_PSK = VpnProfile.TYPE_IKEV2_IPSEC_PSK;
    public static final int TYPE_IKEV2_IPSEC_RSA = VpnProfile.TYPE_IKEV2_IPSEC_RSA;

    /** @hide */
    public static final int MAX_MTU_DEFAULT = 1360;

    /** @hide */
    @PlatformVpnType protected final int mType;

+5 −4
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.internal.net;
import android.annotation.NonNull;
import android.compat.annotation.UnsupportedAppUsage;
import android.net.Ikev2VpnProfile;
import android.net.PlatformVpnProfile;
import android.net.ProxyInfo;
import android.os.Build;
import android.os.Parcel;
@@ -133,7 +134,7 @@ public final class VpnProfile implements Cloneable, Parcelable {
    private List<String> mAllowedAlgorithms = new ArrayList<>(); // 19
    public boolean isBypassable = false;                         // 20
    public boolean isMetered = false;                            // 21
    public int maxMtu = 1400;                                  // 22
    public int maxMtu = PlatformVpnProfile.MAX_MTU_DEFAULT;      // 22
    public boolean areAuthParamsInline = false;                  // 23

    // Helper fields.
+1 −1
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@ public class VpnProfileTest {
        assertTrue(p.getAllowedAlgorithms() != null && p.getAllowedAlgorithms().isEmpty());
        assertFalse(p.isBypassable);
        assertFalse(p.isMetered);
        assertEquals(1400, p.maxMtu);
        assertEquals(1360, p.maxMtu);
        assertFalse(p.areAuthParamsInline);
    }