summaryrefslogtreecommitdiff
path: root/app/src/main/java/se/leap
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/se/leap')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/eip/GatewaysManager.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/GatewaysManager.java b/app/src/main/java/se/leap/bitmaskclient/eip/GatewaysManager.java
index 7fc810cc..d573e70c 100644
--- a/app/src/main/java/se/leap/bitmaskclient/eip/GatewaysManager.java
+++ b/app/src/main/java/se/leap/bitmaskclient/eip/GatewaysManager.java
@@ -420,9 +420,10 @@ public class GatewaysManager {
private void configureFromCurrentProvider() {
Provider provider = ProviderObservable.getInstance().getCurrentProvider();
parseDefaultGateways(provider);
- if (BuildConfig.BUILD_TYPE.equals("debug")) {
- keepOnlyPinnedGateway();
- } else if (hasSortedGatewaysWithLoad(provider)) {
+ if (BuildConfig.BUILD_TYPE.equals("debug") && handleGatewayPinning()) {
+ return;
+ }
+ if (hasSortedGatewaysWithLoad(provider)) {
parseGatewaysWithLoad(provider);
} else {
parseSimpleGatewayList(provider);
@@ -430,16 +431,17 @@ public class GatewaysManager {
}
- private void keepOnlyPinnedGateway() {
+ private boolean handleGatewayPinning() {
String host = PreferenceHelper.getPinnedGateway(this.context);
if (host == null) {
- return;
+ return false;
}
Gateway gateway = gateways.get(host);
gateways.clear();
if (gateway != null) {
gateways.put(host, gateway);
}
+ return true;
}
}