From 7c19e840d5ea58313545ad7fd58b00202b60aec8 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Sun, 23 Jun 2013 22:36:43 +0200 Subject: Fix bug with new pause VPN function --- src/de/blinkt/openvpn/core/DeviceStateReceiver.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/de') diff --git a/src/de/blinkt/openvpn/core/DeviceStateReceiver.java b/src/de/blinkt/openvpn/core/DeviceStateReceiver.java index ecdf5c55..cf7493a0 100644 --- a/src/de/blinkt/openvpn/core/DeviceStateReceiver.java +++ b/src/de/blinkt/openvpn/core/DeviceStateReceiver.java @@ -124,7 +124,7 @@ public class DeviceStateReceiver extends BroadcastReceiver implements ByteCountL /* should be connected has changed because the screen is on now, connect the VPN */ if (shouldBeConnected() != connected) mManagement.resume(); - else + else if (!shouldBeConnected()) /*Update the reason why we are still paused */ mManagement.pause(getPauseReason()); @@ -224,7 +224,10 @@ public class DeviceStateReceiver extends BroadcastReceiver implements ByteCountL if (screen == connectState.DISCONNECTED) return pauseReason.screenOff; - return pauseReason.noNetwork; + if (network == connectState.DISCONNECTED) + return pauseReason.noNetwork; + + assert(false); } private NetworkInfo getCurrentNetworkInfo(Context context) { -- cgit v1.2.3