summaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2018-02-10 23:19:00 +0100
committercyBerta <cyberta@riseup.net>2018-02-10 23:19:00 +0100
commitf728bbb6eb24268d7223ac4347ad2cd5f004e85c (patch)
tree99fb121f2331ed2244e0ffd70905800aaabd65c7 /app/src/main/java
parentb37575a680cd1e345339bdc5c4c4bc1137b2e4f1 (diff)
#8837 new handling of connection state LEVEL_VPNPAUSED - don't throw an illegal state exception
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/eip/EipStatus.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/EipStatus.java b/app/src/main/java/se/leap/bitmaskclient/eip/EipStatus.java
index 0da74872..855bfc64 100644
--- a/app/src/main/java/se/leap/bitmaskclient/eip/EipStatus.java
+++ b/app/src/main/java/se/leap/bitmaskclient/eip/EipStatus.java
@@ -24,6 +24,7 @@ import java.util.Observable;
import de.blinkt.openvpn.core.ConnectionStatus;
import de.blinkt.openvpn.core.LogItem;
+import de.blinkt.openvpn.core.ProfileManager;
import de.blinkt.openvpn.core.VpnStatus;
/**
@@ -92,7 +93,13 @@ public class EipStatus extends Observable implements VpnStatus.StateListener {
currentEipLevel = EipLevel.CONNECTED;
break;
case LEVEL_VPNPAUSED:
- throw new IllegalStateException("Ics-Openvpn's VPNPAUSED state is not supported by Bitmask");
+ if (ProfileManager.getLastConnectedVpn().mPersistTun) {
+ //if persistTun is enabled, treat EipLevel as connecting as it *shouldn't* allow passing traffic in the clear...
+ currentEipLevel = EipLevel.CONNECTING;
+ } else {
+ //... if persistTun is not enabled, background network traffic will pass in the clear
+ currentEipLevel = EipLevel.DISCONNECTED;
+ }
case LEVEL_CONNECTING_SERVER_REPLIED:
case LEVEL_CONNECTING_NO_SERVER_REPLY_YET:
case LEVEL_WAITING_FOR_USER_INPUT: