summaryrefslogtreecommitdiff
path: root/src/de/blinkt/openvpn/OpenVpnService.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/de/blinkt/openvpn/OpenVpnService.java')
-rw-r--r--src/de/blinkt/openvpn/OpenVpnService.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/de/blinkt/openvpn/OpenVpnService.java b/src/de/blinkt/openvpn/OpenVpnService.java
index 4dff943b..53ae80b1 100644
--- a/src/de/blinkt/openvpn/OpenVpnService.java
+++ b/src/de/blinkt/openvpn/OpenVpnService.java
@@ -58,7 +58,7 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac
private CIDRIP mLocalIP=null;
- private OpenVpnManagementThread mSocketManager;
+ private OpenVpnManagementThread mManagementThread;
private Thread mSocketManagerThread;
private int mMtu;
@@ -214,7 +214,7 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac
void registerNetworkStateReceiver() {
// Registers BroadcastReceiver to track network connection changes.
IntentFilter filter = new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION);
- mNetworkStateReceiver = new NetworkSateReceiver(mSocketManager);
+ mNetworkStateReceiver = new NetworkSateReceiver(mManagementThread);
this.registerReceiver(mNetworkStateReceiver, filter);
}
@@ -266,8 +266,8 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac
if(mgmtsocket!=null) {
// start a Thread that handles incoming messages of the managment socket
- mSocketManager = new OpenVpnManagementThread(mProfile,mgmtsocket,this);
- mSocketManagerThread = new Thread(mSocketManager,"OpenVPNMgmtThread");
+ mManagementThread=new OpenVpnManagementThread(mProfile,mgmtsocket,this);
+ mSocketManagerThread = new Thread(mManagementThread,"OpenVPNMgmtThread");
mSocketManagerThread.start();
OpenVPN.logInfo("started Socket Thread");
registerNetworkStateReceiver();
@@ -288,7 +288,7 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac
@Override
public void onDestroy() {
if (mProcessThread != null) {
- mSocketManager.managmentCommand("signal SIGINT\n");
+ mManagementThread.managmentCommand("signal SIGINT\n");
mProcessThread.interrupt();
}
@@ -505,4 +505,8 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac
return false;
}
}
+
+ public OpenVpnManagementThread getManagementThread() {
+ return mManagementThread;
+ }
}