From daa7b6fd567a5037a85a11f6c601997c37b42c53 Mon Sep 17 00:00:00 2001 From: cyBerta Date: Sat, 7 Dec 2024 03:47:46 +0100 Subject: implement Provider's hasGatewaysInDifferentLocations for APIv5, disables location selection in case there's just one location available --- app/src/main/java/se/leap/bitmaskclient/base/models/Provider.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'app/src/main/java/se/leap') diff --git a/app/src/main/java/se/leap/bitmaskclient/base/models/Provider.java b/app/src/main/java/se/leap/bitmaskclient/base/models/Provider.java index 17b200f2..ac3aba7a 100644 --- a/app/src/main/java/se/leap/bitmaskclient/base/models/Provider.java +++ b/app/src/main/java/se/leap/bitmaskclient/base/models/Provider.java @@ -549,8 +549,11 @@ public final class Provider implements Parcelable { public boolean hasGatewaysInDifferentLocations() { if (apiVersion >= 5) { - //FIXME: getService().getLocations() - return true; + try { + return getService().getLocations().size() > 1; + } catch (NullPointerException e) { + return false; + } } else { try { return getEipServiceJson().getJSONObject(LOCATIONS).length() > 1; -- cgit v1.2.3