diff options
author | cyberta <cyberta@riseup.net> | 2021-04-28 10:40:18 +0200 |
---|---|---|
committer | cyberta <cyberta@riseup.net> | 2021-04-28 10:40:18 +0200 |
commit | d4c418faf893d28e3c543f19a276fada23e2fd6e (patch) | |
tree | 36aef38d5f073ff072cf2686cc6b0668c90451de /app/src/main/java/se/leap/bitmaskclient/base | |
parent | eb99ac65e9faf306e196d1651a466244d38f9341 (diff) |
ask to disable manual gateway selection if current combination of transport and location fails
Diffstat (limited to 'app/src/main/java/se/leap/bitmaskclient/base')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/base/fragments/MainActivityErrorDialog.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/base/fragments/MainActivityErrorDialog.java b/app/src/main/java/se/leap/bitmaskclient/base/fragments/MainActivityErrorDialog.java index f036b411..4034bd04 100644 --- a/app/src/main/java/se/leap/bitmaskclient/base/fragments/MainActivityErrorDialog.java +++ b/app/src/main/java/se/leap/bitmaskclient/base/fragments/MainActivityErrorDialog.java @@ -18,6 +18,7 @@ package se.leap.bitmaskclient.base.fragments; import android.app.Dialog; import android.content.Context; +import android.content.DialogInterface; import android.os.Bundle; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -32,6 +33,8 @@ import se.leap.bitmaskclient.eip.EipCommand; import se.leap.bitmaskclient.base.models.Provider; import se.leap.bitmaskclient.providersetup.ProviderAPICommand; +import static se.leap.bitmaskclient.base.utils.PreferenceHelper.getPreferredCity; +import static se.leap.bitmaskclient.base.utils.PreferenceHelper.setPreferredCity; import static se.leap.bitmaskclient.providersetup.ProviderAPI.UPDATE_INVALID_VPN_CERTIFICATE; import static se.leap.bitmaskclient.R.string.warning_option_try_ovpn; import static se.leap.bitmaskclient.R.string.warning_option_try_pt; @@ -120,7 +123,12 @@ public class MainActivityErrorDialog extends DialogFragment { break; case NO_MORE_GATEWAYS: builder.setNegativeButton(R.string.cancel, (dialog, id) -> {}); - if (provider.supportsPluggableTransports()) { + if (getPreferredCity(applicationContext) != null) { + builder.setPositiveButton(R.string.warning_option_try_best, (dialog, which) -> { + setPreferredCity(applicationContext, null); + EipCommand.startVPN(applicationContext, false); + }); + } else if (provider.supportsPluggableTransports()) { if (getUsePluggableTransports(applicationContext)) { builder.setPositiveButton(warning_option_try_ovpn, ((dialog, which) -> { usePluggableTransports(applicationContext, false); |