summaryrefslogtreecommitdiff
path: root/src/de/blinkt/openvpn/NetworkSateReceiver.java
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2012-08-12 15:01:08 +0200
committerArne Schwabe <arne@rfc2549.org>2012-08-12 15:01:08 +0200
commit4baedb9349cc34a71dee50bbbeb0a1a473b84208 (patch)
tree980725ca2eea961efdfcdd31814668b2f5b571ca /src/de/blinkt/openvpn/NetworkSateReceiver.java
parent74f6a4ad27c29b6ea5e427ec0e3730c62fb36427 (diff)
Keep Openvpn in hold whiteout network (closes issue #63)
--HG-- extra : rebase_source : 47459245a591d7898976efa8648ce940f97f4e4a
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;