summaryrefslogtreecommitdiff
path: root/src/de/blinkt/openvpn/NetworkSateReceiver.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/de/blinkt/openvpn/NetworkSateReceiver.java')
-rw-r--r--src/de/blinkt/openvpn/NetworkSateReceiver.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/de/blinkt/openvpn/NetworkSateReceiver.java b/src/de/blinkt/openvpn/NetworkSateReceiver.java
index 6584e0fa..a649bd65 100644
--- a/src/de/blinkt/openvpn/NetworkSateReceiver.java
+++ b/src/de/blinkt/openvpn/NetworkSateReceiver.java
@@ -44,11 +44,17 @@ public class NetworkSateReceiver extends BroadcastReceiver {
if(networkInfo!=null && networkInfo.getState() == State.CONNECTED) {
int newnet = networkInfo.getType();
- if(sendusr1 && lastNetwork!=-1 && (lastNetwork!=newnet))
+ if(sendusr1 && lastNetwork!=newnet)
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();
}
+
if(!netstatestring.equals(lastStateMsg))
OpenVPN.logInfo(R.string.netstatus, netstatestring);
lastStateMsg=netstatestring;