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

Commit 0575a5e0 authored by Benedict Wong's avatar Benedict Wong
Browse files

Add Skeleton Ikev2VpnRunner class

Bug: 144246767
Test: FrameworksNetTests passing
Change-Id: I5a01d709bc546e8e70f6fad364e94bf603a9107a
parent e0b672d1
Loading
Loading
Loading
Loading
+28 −0
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ import android.content.pm.UserInfo;
import android.net.ConnectivityManager;
import android.net.INetworkManagementEventObserver;
import android.net.IpPrefix;
import android.net.IpSecManager;
import android.net.LinkAddress;
import android.net.LinkProperties;
import android.net.LocalSocket;
@@ -1999,6 +2000,33 @@ public class Vpn {
        protected abstract void exit();
    }

    private class IkeV2VpnRunner extends VpnRunner {
        private static final String TAG = "IkeV2VpnRunner";

        private final IpSecManager mIpSecManager;
        private final VpnProfile mProfile;

        IkeV2VpnRunner(VpnProfile profile) {
            super(TAG);
            mProfile = profile;

            // TODO: move this to startVpnRunnerPrivileged()
            mConfig = new VpnConfig();
            mIpSecManager = mContext.getSystemService(IpSecManager.class);
        }

        @Override
        public void run() {
            // TODO: Build IKE config, start IKE session
        }

        @Override
        public void exit() {
            // TODO: Teardown IKE session & any resources.
            agentDisconnect();
        }
    }

    /**
     * Bringing up a VPN connection takes time, and that is all this thread
     * does. Here we have plenty of time. The only thing we need to take