diff options
author | cyBerta <cyberta@riseup.net> | 2024-12-07 03:47:46 +0100 |
---|---|---|
committer | cyberta <cyberta@riseup.net> | 2024-12-11 00:09:34 +0000 |
commit | daa7b6fd567a5037a85a11f6c601997c37b42c53 (patch) | |
tree | 6008a7d922a894408cf0e7271ad4c8a5b5a0fcd5 /app/src/main/java | |
parent | c3032f4cd83c94655c86351b578a829df3a6180b (diff) |
implement Provider's hasGatewaysInDifferentLocations for APIv5, disables location selection in case there's just one location available
Diffstat (limited to 'app/src/main/java')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/base/models/Provider.java | 7 |
1 files changed, 5 insertions, 2 deletions
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; |