From 61075e5788d83685e70c9cfe993cd14e4531216c Mon Sep 17 00:00:00 2001 From: cyBerta Date: Sat, 25 Jul 2020 13:30:58 +0200 Subject: only allow geoip service calls if the vpn is not yet running in order to get proper results --- .../production/java/se/leap/bitmaskclient/ProviderApiManager.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'app') 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; } -- cgit v1.2.3