summaryrefslogtreecommitdiff
path: root/src/de/blinkt/openvpn/OpenVPNThread.java
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2012-08-16 23:52:03 +0200
committerArne Schwabe <arne@rfc2549.org>2012-08-16 23:52:03 +0200
commita9aaf6c38d80dda30331275359a554539e3b134b (patch)
treedf131b2034a47b99a96a41638a8d768b57c59d97 /src/de/blinkt/openvpn/OpenVPNThread.java
parente0649f9e0fee05488fd356a86c415e12f4baf904 (diff)
- Fix the problem Android sometimes killing the service in the background causing miniopenvpn to exit
- Use setForeground to enable foreground priority, this forces to use a notification icon - Remove the ability to deselect Bytecounter.
Diffstat (limited to 'src/de/blinkt/openvpn/OpenVPNThread.java')
-rw-r--r--src/de/blinkt/openvpn/OpenVPNThread.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/de/blinkt/openvpn/OpenVPNThread.java b/src/de/blinkt/openvpn/OpenVPNThread.java
index 97e07c9d..0bde3205 100644
--- a/src/de/blinkt/openvpn/OpenVPNThread.java
+++ b/src/de/blinkt/openvpn/OpenVPNThread.java
@@ -13,17 +13,21 @@ public class OpenVPNThread implements Runnable {
private String[] mArgv;
private Process mProcess;
private String mNativeDir;
+ private OpenVpnService mService;
public OpenVPNThread(OpenVpnService service,String[] argv, String nativelibdir)
{
mArgv = argv;
mNativeDir = nativelibdir;
+ mService = service;
}
public void stopProcess() {
mProcess.destroy();
}
+
+
@Override
public void run() {
try {
@@ -34,20 +38,19 @@ public class OpenVPNThread implements Runnable {
Log.e(TAG, "Got " + e.toString());
} finally {
try {
- /// mInterface.close();
+
} catch (Exception e) {
// ignore
}
- //mInterface = null;
-
OpenVPN.updateStateString("NOPROCESS","No process running");
- // Not a good place to do it, but will do
- OpenVPN.logBuilderConfig(null);
+
+
+ mService.processDied();
Log.i(TAG, "Exiting");
}
}
-
+
private void startOpenVPNThreadArgs(String[] argv) {
LinkedList<String> argvlist = new LinkedList<String>();