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

Commit c46253f8 authored by Chenbo Feng's avatar Chenbo Feng Committed by android-build-merger
Browse files

Merge "Add server information for pptp vpn" into qt-dev

am: 43110221

Change-Id: I9a18ef9c27af8920c517e1774496a5fbf6728da5
parents 67302596 43110221
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -1846,10 +1846,11 @@ public class Vpn {
        if (!profile.searchDomains.isEmpty()) {
            config.searchDomains = Arrays.asList(profile.searchDomains.split(" +"));
        }
        startLegacyVpn(config, racoon, mtpd);
        startLegacyVpn(config, racoon, mtpd, profile);
    }

    private synchronized void startLegacyVpn(VpnConfig config, String[] racoon, String[] mtpd) {
    private synchronized void startLegacyVpn(VpnConfig config, String[] racoon, String[] mtpd,
            VpnProfile profile) {
        stopLegacyVpnPrivileged();

        // Prepare for the new request.
@@ -1857,7 +1858,7 @@ public class Vpn {
        updateState(DetailedState.CONNECTING, "startLegacyVpn");

        // Start a new LegacyVpnRunner and we are done!
        mLegacyVpnRunner = new LegacyVpnRunner(config, racoon, mtpd);
        mLegacyVpnRunner = new LegacyVpnRunner(config, racoon, mtpd, profile);
        mLegacyVpnRunner.start();
    }

@@ -1923,6 +1924,7 @@ public class Vpn {
        private final String mOuterInterface;
        private final AtomicInteger mOuterConnection =
                new AtomicInteger(ConnectivityManager.TYPE_NONE);
        private final VpnProfile mProfile;

        private long mBringupStartTime = -1;

@@ -1949,7 +1951,7 @@ public class Vpn {
            }
        };

        public LegacyVpnRunner(VpnConfig config, String[] racoon, String[] mtpd) {
        LegacyVpnRunner(VpnConfig config, String[] racoon, String[] mtpd, VpnProfile profile) {
            super(TAG);
            mConfig = config;
            mDaemons = new String[] {"racoon", "mtpd"};
@@ -1965,6 +1967,8 @@ public class Vpn {
            // registering
            mOuterInterface = mConfig.interfaze;

            mProfile = profile;

            if (!TextUtils.isEmpty(mOuterInterface)) {
                final ConnectivityManager cm = ConnectivityManager.from(mContext);
                for (Network network : cm.getAllNetworks()) {
@@ -2177,7 +2181,7 @@ public class Vpn {
                }

                // Add a throw route for the VPN server endpoint, if one was specified.
                String endpoint = parameters[5];
                String endpoint = parameters[5].isEmpty() ? mProfile.server : parameters[5];
                if (!endpoint.isEmpty()) {
                    try {
                        InetAddress addr = InetAddress.parseNumericAddress(endpoint);