diff options
author | Arne Schwabe <arne@rfc2549.org> | 2012-08-12 15:01:08 +0200 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2012-08-12 15:01:08 +0200 |
commit | ecc89f37fd4c70865229aa8784cd191e9bf07895 (patch) | |
tree | 059356e313258ffa8dab98d549635d7eab45b6aa /src/de/blinkt/openvpn/NetworkSateReceiver.java | |
parent | 9986deff0c87c66157b6bff2f31d2c9efb1faab1 (diff) |
Keep Openvpn in hold whiteout network (closes issue #63)
Diffstat (limited to 'src/de/blinkt/openvpn/NetworkSateReceiver.java')
-rw-r--r-- | src/de/blinkt/openvpn/NetworkSateReceiver.java | 8 |
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;
|