summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2015-08-20 15:16:59 +0200
committerArne Schwabe <arne@rfc2549.org>2015-08-20 15:16:59 +0200
commit2756ba844be7d434b5e1fe5632f484827c8f2cc3 (patch)
treee6de28d6dc947bcc0b80612fb7128aca4e084a59
parenta34b7a56fb7f09c1fa5a64a74c5aed3ec782bdb9 (diff)
Fix logic when a network is temporary unavailable
-rw-r--r--main/src/main/java/de/blinkt/openvpn/core/DeviceStateReceiver.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/main/src/main/java/de/blinkt/openvpn/core/DeviceStateReceiver.java b/main/src/main/java/de/blinkt/openvpn/core/DeviceStateReceiver.java
index 240e9e32..f0acb6df 100644
--- a/main/src/main/java/de/blinkt/openvpn/core/DeviceStateReceiver.java
+++ b/main/src/main/java/de/blinkt/openvpn/core/DeviceStateReceiver.java
@@ -219,24 +219,24 @@ public class DeviceStateReceiver extends BroadcastReceiver implements ByteCountL
else
sameNetwork = true;
+ /* Same network, connection still 'established' */
if (pendingDisconnect && sameNetwork) {
mDisconnectHandler.removeCallbacks(mDelayDisconnectRunnable);
// Reprotect the sockets just be sure
mManagement.networkChange(true);
- }
+ } else {
+ /* Different network or connection not established anymore */
- if (!sameNetwork) {
if (screen == connectState.PENDINGDISCONNECT)
screen = connectState.DISCONNECTED;
if (shouldBeConnected()) {
mDisconnectHandler.removeCallbacks(mDelayDisconnectRunnable);
- if (lastNetwork == -1 && !pendingDisconnect) {
- mManagement.resume();
- } else {
- mManagement.networkChange(false);
- }
+ if (pendingDisconnect)
+ mManagement.networkChange(false);
+ else
+ mManagement.resume();
}
lastNetwork = newnet;