summaryrefslogtreecommitdiff
path: root/app/src/main/java/se
diff options
context:
space:
mode:
authorfupduck <fupduck@riseup.net>2018-02-13 01:28:26 -0800
committerfupduck <fupduck@riseup.net>2018-02-13 01:28:26 -0800
commitba1d730c12a5168c3a261604e0efd3b77ba3ec5b (patch)
tree649aea9abe2424dd091b5fea04635e14113d8d62 /app/src/main/java/se
parentb37575a680cd1e345339bdc5c4c4bc1137b2e4f1 (diff)
parent757293ca946f1b8c25d7bf13fc9f70bf70b4d8c5 (diff)
Merge branch '#8837_update_errorhandling_illegalStateException' into '0.9.8'
#8837 new handling of connection state LEVEL_VPNPAUSED - don't throw an illegal state exception See merge request leap/bitmask_android!42
Diffstat (limited to 'app/src/main/java/se')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/eip/EipStatus.java10
1 files changed, 9 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..df252500 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,14 @@ 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() != null && 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;
+ }
+ break;
case LEVEL_CONNECTING_SERVER_REPLIED:
case LEVEL_CONNECTING_NO_SERVER_REPLY_YET:
case LEVEL_WAITING_FOR_USER_INPUT: