summaryrefslogtreecommitdiff
path: root/main/src
diff options
context:
space:
mode:
Diffstat (limited to 'main/src')
-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;