summaryrefslogtreecommitdiff
path: root/app/src/main/java/se/leap/bitmaskclient/eip
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2019-10-06 00:18:20 +0200
committercyBerta <cyberta@riseup.net>2019-10-06 00:18:20 +0200
commit454e755d71b7c7a3f62bc1f6ab76b860fa4dfb3d (patch)
tree8e57a517c2234b14c9c4c4a84acf248e8ef2651b /app/src/main/java/se/leap/bitmaskclient/eip
parentc637bffe1c9843b9de7366eee3584c51360e3867 (diff)
show error dialog if no valid gateway configuration can be found for a provider
Diffstat (limited to 'app/src/main/java/se/leap/bitmaskclient/eip')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/eip/EIP.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java b/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java
index 19c539e8..474e639e 100644
--- a/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java
+++ b/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java
@@ -77,6 +77,7 @@ import static se.leap.bitmaskclient.Constants.PROVIDER_VPN_CERTIFICATE;
import static se.leap.bitmaskclient.Constants.SHARED_PREFERENCES;
import static se.leap.bitmaskclient.MainActivityErrorDialog.DOWNLOAD_ERRORS.ERROR_INVALID_VPN_CERTIFICATE;
import static se.leap.bitmaskclient.R.string.vpn_certificate_is_invalid;
+import static se.leap.bitmaskclient.R.string.warning_client_parsing_error_gateways;
import static se.leap.bitmaskclient.utils.ConfigHelper.ensureNotOnMainThread;
import static se.leap.bitmaskclient.utils.PreferenceHelper.getUsePluggableTransports;
@@ -206,6 +207,12 @@ public final class EIP extends JobIntentService implements Observer {
}
GatewaysManager gatewaysManager = gatewaysFromPreferences();
+ if (gatewaysManager.isEmpty()) {
+ setErrorResult(result, warning_client_parsing_error_gateways, null);
+ tellToReceiverOrBroadcast(EIP_ACTION_START, RESULT_CANCELED, result);
+ return;
+ }
+
Gateway gateway = gatewaysManager.select(nClosestGateway);
if (launchActiveGateway(gateway, nClosestGateway)) {
@@ -377,7 +384,6 @@ public final class EIP extends JobIntentService implements Observer {
result.putBoolean(BROADCAST_RESULT_KEY, false);
}
-
/**
* disable Bitmask starting on after phone reboot
* then stop VPN