summaryrefslogtreecommitdiff
path: root/app/src/main/java/de/blinkt
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/de/blinkt')
-rw-r--r--app/src/main/java/de/blinkt/openvpn/core/DeviceStateReceiver.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/src/main/java/de/blinkt/openvpn/core/DeviceStateReceiver.java b/app/src/main/java/de/blinkt/openvpn/core/DeviceStateReceiver.java
index eeed29bc..02184f03 100644
--- a/app/src/main/java/de/blinkt/openvpn/core/DeviceStateReceiver.java
+++ b/app/src/main/java/de/blinkt/openvpn/core/DeviceStateReceiver.java
@@ -17,6 +17,7 @@ import android.preference.PreferenceManager;
import se.leap.bitmaskclient.R;
import de.blinkt.openvpn.core.VpnStatus.ByteCountListener;
+import se.leap.bitmaskclient.tethering.TetheringObservable;
import java.util.LinkedList;
import java.util.Objects;
@@ -143,8 +144,8 @@ public class DeviceStateReceiver extends BroadcastReceiver implements ByteCountL
networkStateChange(context);
} else if (Intent.ACTION_SCREEN_OFF.equals(intent.getAction())) {
boolean screenOffPause = prefs.getBoolean("screenoff", false);
-
- if (screenOffPause) {
+ boolean isTethering = TetheringObservable.getInstance().getTetheringState().isVpnTetheringRunning();
+ if (screenOffPause && !isTethering) {
if (VpnStatus.getLastConnectedVpnProfile() != null && !VpnStatus.getLastConnectedVpnProfile().mPersistTun)
VpnStatus.logError(R.string.screen_nopersistenttun);