summaryrefslogtreecommitdiff
path: root/src/de/blinkt/openvpn/NetworkSateReceiver.java
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2013-02-09 17:03:27 +0100
committerArne Schwabe <arne@rfc2549.org>2013-02-09 17:03:27 +0100
commitc89414179f77982751064a5709122913c3ffd6c4 (patch)
tree225211a18ce80513c4b05a9525538444b563f18b /src/de/blinkt/openvpn/NetworkSateReceiver.java
parent9fab59b5c4b928989eec21bd598c01e5234a18d0 (diff)
Merge non OpenVPN3 specific into main
Diffstat (limited to 'src/de/blinkt/openvpn/NetworkSateReceiver.java')
-rw-r--r--src/de/blinkt/openvpn/NetworkSateReceiver.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/de/blinkt/openvpn/NetworkSateReceiver.java b/src/de/blinkt/openvpn/NetworkSateReceiver.java
index e20c8e52..487639a9 100644
--- a/src/de/blinkt/openvpn/NetworkSateReceiver.java
+++ b/src/de/blinkt/openvpn/NetworkSateReceiver.java
@@ -11,13 +11,13 @@ import android.preference.PreferenceManager;
public class NetworkSateReceiver extends BroadcastReceiver {
private int lastNetwork=-1;
- private OpenVpnManagementThread mManangement;
+ private OpenVPNMangement mManangement;
private String lastStateMsg=null;
- public NetworkSateReceiver(OpenVpnManagementThread managementThread) {
+ public NetworkSateReceiver(OpenVPNMangement magnagement) {
super();
- mManangement = managementThread;
+ mManangement = magnagement;
}
@Override
@@ -57,15 +57,19 @@ public class NetworkSateReceiver extends BroadcastReceiver {
if(networkInfo!=null && networkInfo.getState() == State.CONNECTED) {
int newnet = networkInfo.getType();
- if(sendusr1 && lastNetwork!=newnet)
- mManangement.reconnect();
+ if(sendusr1 && lastNetwork!=newnet) {
+ if (lastNetwork==-1)
+ mManangement.resume();
+ else
+ mManangement.reconnect();
+ }
lastNetwork = newnet;
} else if (networkInfo==null) {
// Not connected, stop openvpn, set last connected network to no network
lastNetwork=-1;
if(sendusr1)
- mManangement.signalusr1();
+ mManangement.pause();
}
if(!netstatestring.equals(lastStateMsg))