summaryrefslogtreecommitdiff
path: root/app/src/production
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2020-07-25 13:30:58 +0200
committercyBerta <cyberta@riseup.net>2020-07-25 13:30:58 +0200
commit61075e5788d83685e70c9cfe993cd14e4531216c (patch)
tree49940a4733d9333002211f2748117f4788e602e3 /app/src/production
parentbdd909d1faae569f27d61ad510d11fad74a5a27c (diff)
only allow geoip service calls if the vpn is not yet running in order to get proper results
Diffstat (limited to 'app/src/production')
-rw-r--r--app/src/production/java/se/leap/bitmaskclient/ProviderApiManager.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/src/production/java/se/leap/bitmaskclient/ProviderApiManager.java b/app/src/production/java/se/leap/bitmaskclient/ProviderApiManager.java
index 04ffe9e6..4a4e7b22 100644
--- a/app/src/production/java/se/leap/bitmaskclient/ProviderApiManager.java
+++ b/app/src/production/java/se/leap/bitmaskclient/ProviderApiManager.java
@@ -216,7 +216,10 @@ public class ProviderApiManager extends ProviderApiManagerBase {
}
/**
- * Fetches the Geo ip Json, containing a list of gateways sorted by distance from the users current location
+ * Fetches the geo ip Json, containing a list of gateways sorted by distance from the users current location.
+ * Fetching is only allowed if the cache timeout of 1 h was reached, a valid geoip service URL exists and the
+ * vpn is not yet active. The latter condition is needed in order to guarantee that the geoip service sees
+ * the real ip of the client
*
* @param provider
* @return
@@ -225,7 +228,7 @@ public class ProviderApiManager extends ProviderApiManagerBase {
protected Bundle getGeoIPJson(Provider provider) {
Bundle result = new Bundle();
- if (!provider.shouldUpdateGeoIpJson() || provider.getGeoipUrl().isDefault()) {
+ if (!provider.shouldUpdateGeoIpJson() || provider.getGeoipUrl().isDefault() || VpnStatus.isVPNActive()) {
result.putBoolean(BROADCAST_RESULT_KEY, false);
return result;
}